collect.js
Advanced tools
Comparing version 4.25.0 to 4.26.0
@@ -35,3 +35,3 @@ 'use strict'; | ||
Collection.prototype.average = require('./methods/average'); | ||
Collection.prototype.avg = require('./methods/average'); | ||
Collection.prototype.avg = require('./methods/avg'); | ||
Collection.prototype.chunk = require('./methods/chunk'); | ||
@@ -111,4 +111,5 @@ Collection.prototype.collapse = require('./methods/collapse'); | ||
Collection.prototype.slice = require('./methods/slice'); | ||
Collection.prototype.some = require('./methods/contains'); | ||
Collection.prototype.some = require('./methods/some'); | ||
Collection.prototype.sort = require('./methods/sort'); | ||
Collection.prototype.sortDesc = require('./methods/sortDesc'); | ||
Collection.prototype.sortBy = require('./methods/sortBy'); | ||
@@ -115,0 +116,0 @@ Collection.prototype.sortByDesc = require('./methods/sortByDesc'); |
{ | ||
"name": "collect.js", | ||
"version": "4.25.0", | ||
"version": "4.26.0", | ||
"description": "Convenient and dependency free wrapper for working with arrays and objects.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -127,2 +127,3 @@ # <img src="https://raw.githubusercontent.com/ecrmnn/collect.js/master/collectjs.jpg" alt="collect.js"> | ||
- [sortByDesc](#sortbydesc) | ||
- [sortDesc](#sortdesc) | ||
- [sortKeys](#sortkeys) | ||
@@ -2209,2 +2210,18 @@ - [sortKeysDesc](#sortkeysdesc) | ||
#### `sortDesc()` | ||
This method will sort the collection in the opposite order as the `sort` method. | ||
```js | ||
const collection = collect([1, 3, 5, 2, 4]); | ||
const sorted = collection.sortDesc(); | ||
sorted.all(); | ||
// [5, 4, 3, 2, 1] | ||
``` | ||
Unlike `sort`, you may not pass a callback to `sortDesc`. If you wish to use a callback, you should use `sort` and invert your comparison. | ||
#### `sortKeys()` | ||
@@ -2211,0 +2228,0 @@ |
@@ -33,3 +33,3 @@ 'use strict'; | ||
Collection.prototype.average = require('./methods/average'); | ||
Collection.prototype.avg = require('./methods/average'); | ||
Collection.prototype.avg = require('./methods/avg'); | ||
Collection.prototype.chunk = require('./methods/chunk'); | ||
@@ -109,4 +109,5 @@ Collection.prototype.collapse = require('./methods/collapse'); | ||
Collection.prototype.slice = require('./methods/slice'); | ||
Collection.prototype.some = require('./methods/contains'); | ||
Collection.prototype.some = require('./methods/some'); | ||
Collection.prototype.sort = require('./methods/sort'); | ||
Collection.prototype.sortDesc = require('./methods/sortDesc'); | ||
Collection.prototype.sortBy = require('./methods/sortBy'); | ||
@@ -113,0 +114,0 @@ Collection.prototype.sortByDesc = require('./methods/sortByDesc'); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
611728
368
5451
2916