0.0.2 • Published 2 years ago

concat-map v0.0.2

Weekly downloads
21,486,759
License
MIT
Repository
github
Last release
2 years ago

concat-map Version Badge

github actions coverage License Downloads

npm badge

Concatenative mapdashery.

example

var concatMap = require('concat-map');
var xs = [ 1, 2, 3, 4, 5, 6 ];
var ys = concatMap(xs, function (x) {
    return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
});
console.dir(ys);
[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]

methods

var concatMap = require('concat-map')

concatMap(xs, fn)

Return an array of concatenated elements by calling fn(x, i) for each element x and each index i in the array xs.

When fn(x, i) returns an array, its result will be concatenated with the result array. If fn(x, i) returns anything else, that value will be pushed onto the end of the result array.

install

With npm do:

npm install concat-map

license

MIT

notes

This module was written while sitting high above the ground in a tree.

cuc-gaf@huyhpham/rn-linearchetype-librarycomponennentteasy-select-rnchinjowwchinjowvuedragdropuploadimagespopsmart-common-authreact-native-bluetooth2killi8n-react-native-fast-imagepipihomern-send-smsspecify-importsbabel-specify-imports@icanpm/api-mastergew-nodejs-api-client@arisageha/react-lazyload@arisageha/react-lazyload-fix@oneplanetcrowd/developers@cashremit/cr-streamline-icons@almeidaa/msreact-native-template-rfbasecloud-archive-s3airscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxf@phil8795/pecuniarius-apikubii-apideneme323112@steven-torres/jsxr@texttree/demo-bsa-reference-rcl@fundefund/funde_ck@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjames@sonammalhotra/lotide@smishra17/lotide@cheapthrills/lotidediscord-music-botsreact-native-covid-sdkgql_din_modnoresca-tools-dev444bitgetalex-frontend-sdk-stagingafryxiconsreact-native-thanh-toast-librarymutasi-bca@jttechnic/interpreter@thanhnguyen14797/react-native-thanh-toast-library@l1nyanm1ng/react-picture-viewer@eginnovations/eginnovations-capacitor-plugin@cujo-common/simple-hello-world-example@saeon/ol-react@saeon/quick-formauto-extractcthpb-plugin-social@iobroker-community-adapters/iobroker.device-watcher@olivervorasai/slidermysql-formatpanqibaoreact-native-printer-brothersrn-pdf-reader-offlinesendautomessengermessagecbmis-ai-toolbox@belko.tech/belko-multi-wallet-sdkmercury-uni@newhorizon-tech/dd-npm-package-templatereact-native-shekhar-bridge-testasterjscogoportutilsukor-remasteruncoded-connect@reversodev/oceanic-fleetlevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29levinodelibuinz-notification@nicholasjj/lotidetemp-mail-fucktalent-to-vite-cliwilscanner@khalitovadel/abstract-repository@oiti/documentoscopy-react-nativejs4cytoscape@respondea/cordova-plugin-v-inappbrowser@mink-opn/build-tokensquoc-testreact-native-slider-kfnodejs-fileshareunblock-block-save-variables
0.0.2

2 years ago

0.0.1

10 years ago

0.0.0

12 years ago