mirror of
https://github.com/thangisme/notes.git
synced 2025-09-24 12:54:00 -04:00
Initial commit
This commit is contained in:
27
node_modules/lodash/invert.js
generated
vendored
Normal file
27
node_modules/lodash/invert.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
var constant = require('./constant'),
|
||||
createInverter = require('./_createInverter'),
|
||||
identity = require('./identity');
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
result[value] = key;
|
||||
}, constant(identity));
|
||||
|
||||
module.exports = invert;
|
Reference in New Issue
Block a user