collect.js
Advanced tools
Comparing version 4.14.0 to 4.15.0
@@ -6,2 +6,10 @@ # 4.14.0 | ||
## Methods | ||
#### ``values()`` | ||
- Reverted change in `4.13.0`. Values method are no longer recursive. | ||
# 4.14.0 | ||
## Breaking changes | ||
## Methods | ||
#### ``where()`` | ||
@@ -8,0 +16,0 @@ - This method now supports one, two or three arguments. This may cause unexpected output if you're using this function with one or two arguments earlier. |
'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var getValues = require('../helpers/values'); | ||
module.exports = function values() { | ||
var valuesRecursive = function valuesRecursive(items) { | ||
var extractedValues = getValues(items); | ||
if (items !== null && (typeof items === 'undefined' ? 'undefined' : _typeof(items)) === 'object') { | ||
return extractedValues.map(function (item) { | ||
return valuesRecursive(item); | ||
}); | ||
} | ||
return items; | ||
}; | ||
return new this.constructor(valuesRecursive(this.items)); | ||
return new this.constructor(getValues(this.items)); | ||
}; |
{ | ||
"name": "collect.js", | ||
"version": "4.14.0", | ||
"version": "4.15.0", | ||
"description": "Convenient and dependency free wrapper for working with arrays and objects.", | ||
@@ -11,3 +11,3 @@ "main": "dist/index.js", | ||
"transpile": "babel src --quiet --out-dir dist", | ||
"bundle": "webpack dist/index.js build/collect.js --output-library collect", | ||
"bundle": "webpack-cli dist/index.js --output build/collect.js --mode development --output-library collect", | ||
"uglify": "uglifyjs build/collect.js --compress --mangle --output build/collect.min.js", | ||
@@ -69,4 +69,5 @@ "build": "npm run transpile && npm run bundle && npm run uglify", | ||
"uglify-js": "^3.2.2", | ||
"webpack": "^3.10.0" | ||
"webpack": "^4.36.1", | ||
"webpack-cli": "^3.3.6" | ||
} | ||
} |
@@ -1936,7 +1936,7 @@ # <img src="https://raw.githubusercontent.com/ecrmnn/collect.js/master/collectjs.jpg" alt="collect.js"> | ||
//=> 'van Dijk', | ||
//=> [ | ||
//=> 'Mané', | ||
//=> 'Origi', | ||
//=> 'Salah', | ||
//=> ], | ||
//=> { | ||
//=> 0: 'Mané', | ||
//=> 1: 'Origi', | ||
//=> 2: 'Salah', | ||
//=> }, | ||
//=> ] | ||
@@ -1943,0 +1943,0 @@ ``` |
@@ -6,13 +6,3 @@ 'use strict'; | ||
module.exports = function values() { | ||
const valuesRecursive = (items) => { | ||
const extractedValues = getValues(items); | ||
if (items !== null && typeof items === 'object') { | ||
return extractedValues.map(item => valuesRecursive(item)); | ||
} | ||
return items; | ||
}; | ||
return new this.constructor(valuesRecursive(this.items)); | ||
return new this.constructor(getValues(this.items)); | ||
}; |
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
524333
14
5136