3.13.110 • Published 11 months ago

@erboladaiorg/temporibus-adipisci-fugit v3.13.110

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@erboladaiorg/temporibus-adipisci-fugit

Build Status

NPM version NPM downloads MIT License

Simple functional script to loop array, strings, numbers, objects, Map and Set. Looppa will always returns a function to map your primitives

@erboladaiorg/temporibus-adipisci-fugit(collection:any)(function(value:any, key:string|number, index:number) {}):array

Installation

npm i @erboladaiorg/temporibus-adipisci-fugit -S

Usage

import @erboladaiorg/temporibus-adipisci-fugit from '@erboladaiorg/temporibus-adipisci-fugit';

// normalize null and undefined
const nullCollection = @erboladaiorg/temporibus-adipisci-fugit(null)(); // []
const undefinedCollection = @erboladaiorg/temporibus-adipisci-fugit(undefined)(); // []

// arrays will be left untouched
const array = @erboladaiorg/temporibus-adipisci-fugit(['foo', null, undefined])(); // [['foo', 0], [null, 1], [undefined, 2]]

// numbers to array
const numbers = @erboladaiorg/temporibus-adipisci-fugit(0, 4)(n => n * 2); // [2, 4, 6, 8]

// strings to array
const string = @erboladaiorg/temporibus-adipisci-fugit('ciao')(); // [['c', 0], ['i', 1], ['a', 2], ['o', 3]]

// objects to array
const obj = @erboladaiorg/temporibus-adipisci-fugit({ foo: 'bar', buz: 'baz' })(); // [['foo', 'bar'], ['buz', 'baz']]

// Map to array
const myMap = new Map();
myMap.set('foo', 'bar');
myMap.set('buz', 'baz');
const map = @erboladaiorg/temporibus-adipisci-fugit(myMap)(); // [['foo', 'bar'], ['buz', 'baz']]

// Set to array
const mySet = new Set();
mySet.add('foo');
mySet.add('bar');
const map = @erboladaiorg/temporibus-adipisci-fugit(mySet)(); // [['foo', 'foo'], ['bar', 'bar']]

With React.js

This script is really handy if you need to deal with React loops

<div>
  <h1>Array</h1>
  <ul>
    {@erboladaiorg/temporibus-adipisci-fugit([1, 2, 3])(number => (
      <li>{number}</li>
    ))}
  </ul>

  <h1>Numbers</h1>
  <ul>
    {@erboladaiorg/temporibus-adipisci-fugit(0, 5)(number => (
      <li>{number}</li>
    ))}
  </ul>

  <h1>Letters</h1>
  <ul>
    {@erboladaiorg/temporibus-adipisci-fugit('ciao')(letter => (
      <li>{letter}</li>
    ))}
  </ul>

  <h1>Object</h1>
  <ul>
    {@erboladaiorg/temporibus-adipisci-fugit({ foo: 'bar', baz: 'buz' })((value, key) => (
      <li>{key}, {value}</li>
    ))}
  </ul>

  <h1>Map</h1>
  <ul>
    {@erboladaiorg/temporibus-adipisci-fugit(new Map().set(1, 'bar'))((value, key) => (
      <li>{key}, {value}</li>
    ))}
  </ul>

  <h1>Set</h1>
  <ul>
    {@erboladaiorg/temporibus-adipisci-fugit(new Set().add('foo').add('bar'))(value => (
      <li>{value}</li>
    ))}
  </ul>
</div>

check the demo

globalfigletlog_.extendtypeserializercollectionansifeedassertfastifyCSSvarseslintconfigmobilequeryspeedreact-hook-formawaitconfigurableObject.getPrototypeOfES2021getterfull-widthassignclass-validatorargvrequireES2015bannerrmdirparsingserializeprotopropertiesECMAScript 2015core-jsartreduxrm -rfTypeScriptMicrosoftenderaccessortslibtypescriptpropertyreducereventEmitternegative zerorfc4122call-bound-0iddompipesetterlockfilenativestoragegatewayES5flagsdragslicehasbrowserslistmimefast-deep-clonecompilerRegExp#flagsaccessibilitystarterforEachcssjsdiffzoddatastructurewaapifunction.lengthmkdirpObservablesnegative[[Prototype]]ReactiveXhookformappECMAScript 3astsymlinkschinesekoreancallbindflatflattenvalidationthreequotedefaultlocallibphonenumberhelperfunctionalReflect.getPrototypeOfglacierredactpushrgbomitopenmomenttypedimmutableformattingequalfullwidtharktypeshellestreeinputArray.prototype.includesstringifyiterationdescriptorswebsiteconsoledebugmodulesource mapinvariantapiredirectsafeoptimizercheckbyteeslintplugincloudfrontURLthrottletestStreamcolourec2opensproxyArray.prototype.containssameValueZeroconcateventDispatchernameduplexloadingfetch@@toStringTagurlregexpgenericsqueueMicrotaskspinnerswalksearchObject.fromEntriesbindpersistentemres-shim APIbundlerbyteLengthutilitycomputed-typestoStringTagdeeplazyjavascriptpostcssspinnermanipulationwritablelintnumberFloat32Arrayeast-asian-widthes-shimsunicodestableECMAScript 7form-validationformatjestSymbolcolumnfunctionminimalmergetoArrayownwordwrapdirectoryAsyncIteratorcoercibleinstalljapanesestreams2binarieslinksharedxmltoolkitfastclonefixed-widthiteratorfilejsdomajvECMAScript 2018exetc39Int32ArrayiteratesnspyyamlWeakSetcolumnssyntaxES2019protocol-buffersievisualES2020callchannelwrapratelimitgetOwnPropertyDescriptorfromenvironmentbeanstalktypesafefasttouchtsextensionregular expressionstextArrayBuffer#sliceUint16ArrayzerogroupByes2018executefindupes2016endpointpreprocessorObject.definePropertysetIteratorpositiveArrayemojicurlbatchECMAScript 2017argumentsStreamsshimprivate datavariablessortedes8jsonArray.prototype.flatspawnES2016callboundformroutingfilterCSSStyleDeclarationreact-testing-libraryArray.prototype.findLastfunctionsSymbol.toStringTagenvdeep-copyforkextendstreamsoffsetviewmatchAllfullreworkposeebsoptimistrssbinTypedArrayregexECMAScript 2016jasmineMapbluebirdesairbnbefficientutil.inspectmapmatchestesterlaunchtrimLeftconsumetoolsinferencettyreact-hooksBigInt64Arraytapemodulesfast-deep-copyYAMLguidObject.isECMAScript 5globalsstatelesselectroncoreflatMapreal-timedom-testing-librarysqsinstallerprocesstypanioncloudtrailpackage.jsonroutepreserve-symlinkstoobjectspecfile systemrm -frkarmatimehardlinksprogressgraphql-clientgesturesjQuerybusyFunction.prototype.namenodeglobgdprperformancebyteOffsetcirculartyped arraythroatenumerablesespropString.prototype.matchAllprettymkdirindicatorincludessymlink256typedarraysfast-copyarraybufferutillengthregulartddelbprunesubprocessuuidES3ES7parserInt8ArrayfindLastIndexupESsharedarraybufferdeleteescaperesolvechromeTypeBoxamazonrandomimportexportPromiseremovehasOwnapolloxhrreactfpsvpc__proto__ES8command-linestylesoutputECMAScript 2020workerboundrdsterminaldynamodbES2018JSONgetoptcachedirconcurrencystylecloneentriesdeep-clonereuseprotobufwafloggerwordbreakarrayssettings0elasticachesequencetypeofhooksargumentdataatomsetPrototypeOfArray.prototype.findLastIndexwarningqstestingbdda11yratenamestermrecursiveframercallbackcensortostringtagcloudwatchkeysimmer$.extendinfindLastcreatejsxbinarygetvestlastWebSocketsvalidschemedeepcopydeepclonehtmlcommanderdependenciespromisexdg-openReactiveExtensionstrimEndnpmparentscontainsponyfillrapidserializationlrutypesdeterministicswfgetPrototypeOfmake dirpackagesscheme-validationmonorepoWebSocketshebangtakedebuggerjoibufferdropimportstyled-componentsuninstallwritelookcomparegraphqlruntimesetImmediateurlsmimetypesdotenvdataViewiseveryreadabletaskobjectmoveyamlvaluessomediffinternal slotexeccjkassertionECMAScript 2021
@dramaorg/esse-praesentium-eligendi@dramaorg/quae-dolore-nostrum@erboladaiorg/ad-exercitationem-ducimus@erboladaiorg/adipisci-repellendus-corporis@erboladaiorg/asperiores-earum-quaerat@erboladaiorg/asperiores-fuga-sint@erboladaiorg/asperiores-nam-adipisci@erboladaiorg/autem-dolores-ipsam@erboladaiorg/cum-commodi-consequatur@erboladaiorg/cupiditate-consectetur-porro@erboladaiorg/cupiditate-pariatur-optio@erboladaiorg/distinctio-tempora-quis@erboladaiorg/error-atque-ea@erboladaiorg/esse-ipsa-numquam@erboladaiorg/ex-hic-molestias@erboladaiorg/explicabo-eius-adipisci@erboladaiorg/fugiat-nobis-repellendus@erboladaiorg/laboriosam-inventore-natus@erboladaiorg/molestiae-voluptatibus-perferendis@erboladaiorg/molestias-nulla-dolor@erboladaiorg/nisi-culpa-cum@erboladaiorg/officia-illum-aperiam@erboladaiorg/perspiciatis-magni-ut@erboladaiorg/quae-in-veniam@erboladaiorg/quaerat-mollitia-adipisci@erboladaiorg/quibusdam-itaque-tempora@erboladaiorg/quod-explicabo-neque@erboladaiorg/sint-deleniti-dolorem@erboladaiorg/sit-nesciunt-amet@erboladaiorg/tenetur-architecto-dolore@erboladaiorg/ut-dignissimos-laborum@erboladaiorg/velit-fugit-harum@juigorg/nisi-molestiae-ut@juigorg/sit-nam-neque@kollorg/dicta-itaque-nemo@kollorg/nihil-veniam-deserunt@swenkerorg/modi-dolorum-provident@swenkerorg/nulla-voluptates-voluptates@zitterorg/aspernatur-pariatur-occaecati@zitterorg/eum-veritatis-placeat@zitterorg/illum-perferendis-consecteturanalsorhost-simple-bscorcojs-qrcodecorcojs-qrcode-logodable-effectfiran-loggingsimple-assi-animationsimple-prompts-web3
3.10.98

12 months ago

3.13.109

11 months ago

3.10.99

12 months ago

2.3.27

1 year ago

2.3.24

1 year ago

2.3.23

1 year ago

2.3.26

1 year ago

2.3.25

1 year ago

2.5.43

1 year ago

2.3.20

1 year ago

3.11.108

11 months ago

2.5.44

1 year ago

3.11.107

11 months ago

2.5.45

1 year ago

2.3.22

1 year ago

3.11.106

11 months ago

2.5.46

1 year ago

2.3.21

1 year ago

3.13.110

11 months ago

3.11.105

11 months ago

3.11.104

12 months ago

2.5.40

1 year ago

2.5.41

1 year ago

2.5.42

1 year ago

2.8.49

1 year ago

2.8.52

1 year ago

2.8.51

1 year ago

2.8.50

1 year ago

2.8.56

1 year ago

2.8.55

1 year ago

2.8.54

1 year ago

2.8.53

1 year ago

2.8.59

1 year ago

2.8.58

1 year ago

2.8.57

1 year ago

2.8.63

1 year ago

2.8.62

1 year ago

2.8.61

1 year ago

2.8.60

1 year ago

2.4.29

1 year ago

2.4.28

1 year ago

2.4.27

1 year ago

2.8.67

1 year ago

2.8.66

1 year ago

2.8.65

1 year ago

2.6.46

1 year ago

2.8.64

1 year ago

3.8.70

1 year ago

3.8.71

1 year ago

2.8.69

1 year ago

2.8.68

1 year ago

2.8.70

1 year ago

3.9.90

12 months ago

2.4.36

1 year ago

2.4.35

1 year ago

3.12.108

11 months ago

2.4.38

1 year ago

2.4.37

1 year ago

3.9.97

12 months ago

2.4.32

1 year ago

3.12.109

11 months ago

3.9.98

12 months ago

2.4.31

1 year ago

3.9.95

12 months ago

2.4.34

1 year ago

3.9.96

12 months ago

2.4.33

1 year ago

3.9.93

12 months ago

3.9.94

12 months ago

3.9.91

12 months ago

2.4.30

1 year ago

3.9.92

12 months ago

2.3.8

1 year ago

2.3.9

1 year ago

3.10.104

12 months ago

3.10.103

12 months ago

3.9.79

1 year ago

3.9.77

1 year ago

3.9.78

1 year ago

3.10.100

12 months ago

3.10.102

12 months ago

3.10.101

12 months ago

2.7.49

1 year ago

3.9.75

1 year ago

3.9.76

1 year ago

3.9.73

1 year ago

3.9.74

1 year ago

3.9.71

1 year ago

2.7.48

1 year ago

3.9.72

1 year ago

2.7.47

1 year ago

2.7.46

1 year ago

3.9.88

12 months ago

3.9.89

12 months ago

2.3.17

1 year ago

2.3.16

1 year ago

2.3.19

1 year ago

2.3.18

1 year ago

2.3.13

1 year ago

2.3.12

1 year ago

2.5.38

1 year ago

2.3.15

1 year ago

2.5.39

1 year ago

2.3.14

1 year ago

3.9.86

1 year ago

3.9.87

12 months ago

3.9.84

1 year ago

2.3.11

1 year ago

3.9.85

1 year ago

2.3.10

1 year ago

3.9.82

1 year ago

3.9.83

1 year ago

3.9.80

1 year ago

3.9.81

1 year ago

2.3.7

1 year ago

2.2.5

1 year ago

2.2.4

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago