array-tools
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "array-tools", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Useful functions for working with arrays", | ||
@@ -24,3 +24,3 @@ "repository": "https://github.com/75lb/array-tools.git", | ||
"lint": "jshint lib/*.js test/*.js; echo", | ||
"docs": "jsdoc2md -t jsdoc2md/README.hbs lib/*.js > README.md; echo", | ||
"docs": "jsdoc2md -t jsdoc2md/README.hbs --example-code-gfm js --heading-depth 1 --github lib/*.js > README.md; echo", | ||
"watch": "baldrick --do 'npm run docs' --when lib/*.js --change" | ||
@@ -27,0 +27,0 @@ }, |
@@ -28,3 +28,3 @@ [![view on npm](http://img.shields.io/npm/v/array-tools.svg)](https://www.npmjs.org/package/array-tools) | ||
* [.extract(array, query)](#module_array-tools.extract) ⇒ <code>Array</code> | ||
* [.flatten()](#module_array-tools.flatten) | ||
* [.flatten()](#module_array-tools.flatten) ⇒ <code>Array</code> | ||
@@ -38,3 +38,3 @@ <a name="module_array-tools.without"></a> | ||
| input | <code>Array</code> | the input array | | ||
| toRemove | <code>*</code> | a single, or array of values to omit | | ||
| toRemove | <code>\*</code> | a single, or array of values to omit | | ||
@@ -82,3 +82,3 @@ **Example** | ||
| ----- | ---- | ----------- | | ||
| input | <code>*</code> | the input value to convert to an array | | ||
| input | <code>\*</code> | the input value to convert to an array | | ||
@@ -105,3 +105,3 @@ **Example** | ||
| array | <code>Array</code> | the array to search | | ||
| value | <code>*</code> | the value to search for | | ||
| value | <code>\*</code> | the value to search for | | ||
@@ -248,3 +248,3 @@ **Example** | ||
| test | <code>RegExp</code> | the test to continue splicing while true | | ||
| ...elementN | <code>*</code> | the elements to add to the array | | ||
| ...elementN | <code>\*</code> | the elements to add to the array | | ||
@@ -271,4 +271,4 @@ **Example** | ||
<a name="module_array-tools.flatten"></a> | ||
##a.flatten() | ||
flatten | ||
##a.flatten() ⇒ <code>Array</code> | ||
flatten an array of arrays into a single array | ||
@@ -280,4 +280,14 @@ **Since**: 1.4.0 | ||
**Example** | ||
```js | ||
> numbers = [ 1, 2, [ 3, 4 ], 5 ] | ||
[ 1, | ||
2, | ||
[ 3, 4 ], | ||
5 ] | ||
> a.flatten(numbers) | ||
[ 1, 2, 3, 4, 5 ] | ||
``` | ||
*documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown)*. |
27415
287