Bump to v4.17.5.

This commit is contained in:
John-David Dalton
2018-02-02 21:16:59 -08:00
parent 955537d67f
commit 6339af7cb1
16 changed files with 225 additions and 113 deletions

View File

@@ -1,5 +1,15 @@
define(['./constant', './_createInverter', './identity'], function(constant, createInverter, identity) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite
@@ -19,6 +29,11 @@ define(['./constant', './_createInverter', './identity'], function(constant, cre
* // => { '1': 'c', '2': 'b' }
*/
var invert = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
result[value] = key;
}, constant(identity));