/neida

Functional utilities

Primary LanguageJavaScriptMIT LicenseMIT

neida

build status npm dependencies npm dev dependencies license npm bundle size (minified) npm bundle size (minified + gzip) node supported versions npm latest version

Modules

addnumber

Add two values.

addOnenumber

Increment value by 1.

chunkArray.<Array.<Any>>

Group elements into fixed-length chunks.

subtractOnenumber

Decrement value by 1.

sumnumber

Sum multiple values.

Typedefs

Any : *

Any type.

add ⇒ number

Add two values.

Returns: number - sum of both values
See

Param Type
n number
m number

Example

sum(2, 3)
// => 5

addOne ⇒ number

Increment value by 1.

Returns: number - value incremented by 1
See

Param Type
n number

Example

addOne(5)
// => 6

chunk ⇒ Array.<Array.<Any>>

Group elements into fixed-length chunks.

Returns: Array.<Array.<Any>> - fixed-length chunks

Param Type
o Object
o.collection Array.<Any>
o.length number

Example

chunk({
  collection: ['a', 'b', 'c', 'd', 'e', 'f'],
  length: 2
})
// => [
//  ['a', 'b'],
//  ['c', 'd'],
//  ['e', 'f']
// ]

subtractOne ⇒ number

Decrement value by 1.

Returns: number - value decremented by 1
See: addOne

Param Type
n number

Example

subtractOne(5)
// => 4

sum ⇒ number

Sum multiple values.

Returns: number - sum of arguments
See: add

Param Type
...n number

Example

sum(2, 3, 5)
// => 10

Any : *

Any type.

Kind: global typedef