From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/lodash/invertBy.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'node_modules/lodash/invertBy.js') diff --git a/node_modules/lodash/invertBy.js b/node_modules/lodash/invertBy.js index e5ba0f709..3f4f7e532 100644 --- a/node_modules/lodash/invertBy.js +++ b/node_modules/lodash/invertBy.js @@ -7,6 +7,13 @@ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + /** * This method is like `_.invert` except that the inverted object is generated * from the results of running each element of `object` thru `iteratee`. The @@ -34,6 +41,11 @@ var hasOwnProperty = objectProto.hasOwnProperty; * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { -- cgit v1.2.3