1.0.0 • Published 5 years ago

@~gregoryalary/n-map v1.0.0

Weekly downloads
1
License
UNLICENSED
Repository
-
Last release
5 years ago

n-map

n-map is a simple Javascript / Typescript library yo map an array to multiple other arrays.

Install

npm

npm install @~gregoryalary/n-map --save

yarn

yarn add @~gregoryalary/n-map

Example

Typescript

import {nmap} from "@~gregoryalary/n-map";

nmap<number>(2).bind([
  (elt: number): number  => elt - 1,
  (elt: number): number  => elt + 1
]).map([1, 2, 3]); // => [
                   //   [0, 1, 2],
                   //   [2, 3, 4]
                   // ]

Javascript

var nmap = require('./node_modules/@~gregoryalary/n-map/dist/index');

nmap.nmap(2).bind([
    (elt) => elt * 2,
    (elt) => String(elt)
]).map([0, 5, 10]); // => [
                    //   [0, 10, 20],
                    //   ['0', '5', '10']
                    // ]
1.0.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago