diff options
author | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-01 20:21:29 +0000 |
---|---|---|
committer | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-01 20:21:29 +0000 |
commit | 61cb1570a3410c85a4489b97c172e3a50715f36c (patch) | |
tree | 8fe4a5b77ea54bba80abc817ce2c9ef0e79e7e66 /sandbox/testAppNevena/Front/node_modules/lodash/invert.js | |
parent | 21a53d349788c99d2007cba91a923db982353b31 (diff) | |
parent | a9ee9e0a500a4a15bd0b5dcaf041f827228ed309 (diff) |
Merge branch 'researchML' into 'dev'
Research ml
See merge request igrannonica/neuronstellar!6
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/lodash/invert.js')
-rw-r--r-- | sandbox/testAppNevena/Front/node_modules/lodash/invert.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/lodash/invert.js b/sandbox/testAppNevena/Front/node_modules/lodash/invert.js new file mode 100644 index 00000000..8c479509 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/lodash/invert.js @@ -0,0 +1,42 @@ +var constant = require('./constant'), + createInverter = require('./_createInverter'), + identity = require('./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 + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '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)); + +module.exports = invert; |