reduce-flatten

WebJar for reduce-flatten

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

reduce-flatten
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

reduce-flatten
WebJar for reduce-flatten
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/75lb/reduce-flatten

Download reduce-flatten

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/reduce-flatten/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>reduce-flatten</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/reduce-flatten/
implementation 'org.webjars.npm:reduce-flatten:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/reduce-flatten/
implementation ("org.webjars.npm:reduce-flatten:2.0.0")
'org.webjars.npm:reduce-flatten:jar:2.0.0'
<dependency org="org.webjars.npm" name="reduce-flatten" rev="2.0.0">
  <artifact name="reduce-flatten" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='reduce-flatten', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "reduce-flatten" % "2.0.0"
[org.webjars.npm/reduce-flatten "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

view on npm npm module downloads Build Status Dependency Status js-standard-style

reduce-flatten

Isomorphic map-reduce function to flatten an array into the supplied array.

Example

const flatten = require('reduce-flatten')

flatten()

Kind: Exported function
Example

> numbers = [ 1, 2, [ 3, 4 ], 5 ]
> numbers.reduce(flatten, [])
[ 1, 2, 3, 4, 5 ]

Load anywhere

This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.

Node.js:

const arrayify = require('reduce-flatten')

Within Node.js with ECMAScript Module support enabled:

import arrayify from 'reduce-flatten'

Within an modern browser ECMAScript Module:

import arrayify from './node_modules/reduce-flatten/index.mjs'

Old browser (adds window.flatten):

<script nomodule src="./node_modules/reduce-flatten/dist/index.js"></script>

© 2016-19 Lloyd Brookes <[email protected]>. Documented by jsdoc-to-markdown.

Versions

Version
2.0.0
1.0.1