Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

array-tools

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-tools - npm Package Compare versions

Comparing version 1.6.4 to 1.6.5

4

package.json
{
"name": "array-tools",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "1.6.4",
"version": "1.6.5",
"description": "Lightweight tool-kit for working with arrays",

@@ -30,3 +30,3 @@ "repository": "https://github.com/75lb/array-tools.git",

"lint": "jshint lib/*.js test/*.js; echo",
"docs": "jsdoc2md -t jsdoc2md/README.hbs -l js --no-gfm lib/*.js > README.md; echo",
"docs": "jsdoc2md -t jsdoc2md/README.hbs -l js lib/*.js > README.md; echo",
"watch": "baldrick --do 'npm run docs' --when lib/*.js --change"

@@ -33,0 +33,0 @@ },

@@ -65,15 +65,7 @@ [![view on npm](http://img.shields.io/npm/v/array-tools.svg)](https://www.npmjs.org/package/array-tools)

**Category**: any value in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>any</td><td><code>*</code></td><td><p>the input value to convert to an array</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| any | <code>\*</code> | the input value to convert to an array |
**Example**

@@ -97,21 +89,9 @@ ```js

**Category**: multiple arrays in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>array1</td><td><code>Array</code></td><td><p>First array</p>
</td>
</tr><tr>
<td>array2</td><td><code>Array</code></td><td><p>Second array</p>
</td>
</tr><tr>
<td>idKey</td><td><code>string</code></td><td><p>the unique ID property name</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| array1 | <code>Array</code> | First array |
| array2 | <code>Array</code> | Second array |
| idKey | <code>string</code> | the unique ID property name |
**Example**

@@ -140,18 +120,8 @@ ```js

**Category**: multiple arrays in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td><td><code>Array</code></td><td><p>first array to compare</p>
</td>
</tr><tr>
<td>b</td><td><code>Array</code></td><td><p>second array to compare</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| a | <code>Array</code> | first array to compare |
| b | <code>Array</code> | second array to compare |
**Example**

@@ -168,18 +138,8 @@ ```js

**Category**: record set in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>arrayOfObjects</td><td><code>Array.&lt;object&gt;</code></td><td><p>the input array of objects</p>
</td>
</tr><tr>
<td>...property</td><td><code>string</code></td><td><p>the property(s) to pluck</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| arrayOfObjects | <code>Array.&lt;object&gt;</code> | the input array of objects |
| ...property | <code>string</code> | the property(s) to pluck |
**Example**

@@ -205,18 +165,8 @@ ```js

**Category**: record set in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>arrayOfObjects</td><td><code>Array.&lt;object&gt;</code></td><td><p>the input</p>
</td>
</tr><tr>
<td>...property</td><td><code>string</code></td><td><p>the properties to include in the result</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| arrayOfObjects | <code>Array.&lt;object&gt;</code> | the input |
| ...property | <code>string</code> | the properties to include in the result |
**Example**

@@ -242,18 +192,8 @@ ```js

**Category**: record set in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>arrayOfObjects</td><td><code>Array.&lt;object&gt;</code></td><td><p>the array to search</p>
</td>
</tr><tr>
<td>query</td><td><code>query</code></td><td><p>an object containing the key/value pairs you want to match</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| arrayOfObjects | <code>Array.&lt;object&gt;</code> | the array to search |
| query | <code>query</code> | an object containing the key/value pairs you want to match |
**Example**

@@ -276,18 +216,8 @@ ```js

**Category**: record set in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>arrayOfObjects</td><td><code>Array.&lt;object&gt;</code></td><td><p>the array to search</p>
</td>
</tr><tr>
<td>query</td><td><code>object</code></td><td><p>an object containing the key/value pairs you want to match</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| arrayOfObjects | <code>Array.&lt;object&gt;</code> | the array to search |
| query | <code>object</code> | an object containing the key/value pairs you want to match |
**Example**

@@ -309,21 +239,9 @@ ```js

**Since**: 1.5.0
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>arrayOfObjects</td><td><code>Array.&lt;object&gt;</code></td><td><p>input array</p>
</td>
</tr><tr>
<td>columns</td><td><code>string</code> | <code>Array.&lt;string&gt;</code></td><td><p>column name(s) to sort by</p>
</td>
</tr><tr>
<td>customOrder</td><td><code>object</code></td><td><p>specific sort orders, per columns</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| arrayOfObjects | <code>Array.&lt;object&gt;</code> | input array |
| columns | <code>string</code> &#124; <code>Array.&lt;string&gt;</code> | column name(s) to sort by |
| customOrder | <code>object</code> | specific sort orders, per columns |
**Example**

@@ -359,18 +277,8 @@ ```js

**Category**: single array in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>array</td><td><code>Array</code></td><td><p>the array to search</p>
</td>
</tr><tr>
<td>value</td><td><code>*</code></td><td><p>the value to search for</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| array | <code>Array</code> | the array to search |
| value | <code>\*</code> | the value to search for |
**Example**

@@ -393,18 +301,8 @@ ```js

**Category**: single array in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>array</td><td><code>Array</code></td><td><p>the input array</p>
</td>
</tr><tr>
<td>toRemove</td><td><code>*</code></td><td><p>a single, or array of values to omit</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| array | <code>Array</code> | the input array |
| toRemove | <code>\*</code> | a single, or array of values to omit |
**Example**

@@ -423,15 +321,7 @@ ```js

**Category**: single array in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>array</td><td><code>Array</code></td><td><p>input array</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| array | <code>Array</code> | input array |
**Example**

@@ -450,24 +340,10 @@ ```js

**Category**: single array in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>array</td><td><code>Array</code></td><td><p>the input array</p>
</td>
</tr><tr>
<td>index</td><td><code>number</code></td><td><p>the position to begin splicing from</p>
</td>
</tr><tr>
<td>test</td><td><code>RegExp</code></td><td><p>the test to continue splicing while true</p>
</td>
</tr><tr>
<td>...elementN</td><td><code>*</code></td><td><p>the elements to add to the array</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| array | <code>Array</code> | the input array |
| index | <code>number</code> | the position to begin splicing from |
| test | <code>RegExp</code> | the test to continue splicing while true |
| ...elementN | <code>\*</code> | the elements to add to the array |
**Example**

@@ -489,18 +365,8 @@ ```js

**Category**: single array in
<table>
<thead>
<tr>
<th>Param</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>array</td><td><code>Array</code></td><td><p>the input array, modified directly</p>
</td>
</tr><tr>
<td>query</td><td><code>function</code> | <code>object</code></td><td><p>Per item in the array, if either the function returns truthy or the exists query is satisfied, the item is extracted</p>
</td>
</tr> </tbody>
</table>
| Param | Type | Description |
| --- | --- | --- |
| array | <code>Array</code> | the input array, modified directly |
| query | <code>function</code> &#124; <code>object</code> | Per item in the array, if either the function returns truthy or the exists query is satisfied, the item is extracted |
<a name="module_array-tools.flatten"></a>

@@ -515,3 +381,3 @@ ### a.flatten() ⇒ <code>Array</code>

- document
- [ ] document

@@ -518,0 +384,0 @@ **Example**

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc