Super-light javascript library to flatten arrays
Super-light javascript library to flatten arrays
This library exposes functionality to transalte an array of
arbitarily nested arrays of integers into a flat array of integers. e.g.[[1, 2, [3]], 4] -> [1, 2, 3, 4]
It is trivial code but organised to support future extensions and is just
one step away from npm publish
.
For build generation, Node is required. Ensure Node’s available and run npm i
in project’s root directory. Find build generation step in Usage section(next).
npm build
or npm build:min
npm update:browser-build
or npm update:node-build
. Distributable file is updated in /dist
beforenode examples/node/index.js
(Node) to check code’sflyt.flatten([])
var flyt = require('./flyt'); flyt.flatten([]);
npm run test
from CLI and you shall see something likeBuilt for demonstration purposes.