collect.js
Advanced tools
Comparing version 4.12.2 to 4.12.5
{ | ||
"name": "collect.js", | ||
"version": "4.12.2", | ||
"version": "4.12.5", | ||
"description": "Convenient and dependency free wrapper for working with arrays and objects.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -346,5 +346,5 @@ # <img src="https://raw.githubusercontent.com/ecrmnn/collect.js/master/collectjs.jpg" alt="collect.js"> | ||
collection.crossJoin(['a', 'b']); | ||
const joined = collection.crossJoin(['a', 'b']); | ||
collection.all(); | ||
joined.all(); | ||
@@ -1108,4 +1108,4 @@ //=> [ | ||
const sequence = chunks.mapSpread((odd, even) => { | ||
return odd + even; | ||
const sequence = chunks.mapSpread((even, odd) => { | ||
return even + odd; | ||
}); | ||
@@ -1816,13 +1816,2 @@ | ||
``` | ||
#### ``split()`` | ||
The split method breaks a collection into the given number of groups: | ||
```js | ||
const collection = collect([1, 2, 3, 4, 5]); | ||
const groups = collection.split(3); | ||
//=> [[1, 2], [3, 4], [5]] | ||
``` | ||
In addition, you can pass a third argument containing the new items to replace the items removed from the collection: | ||
@@ -1843,2 +1832,12 @@ ```js | ||
#### ``split()`` | ||
The split method breaks a collection into the given number of groups: | ||
```js | ||
const collection = collect([1, 2, 3, 4, 5]); | ||
const groups = collection.split(3); | ||
//=> [[1, 2], [3, 4], [5]] | ||
``` | ||
#### ``sum()`` | ||
@@ -1845,0 +1844,0 @@ The sum method returns the sum of all items in the collection: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
407473
2378