Sha256: 08c7a7c1dcb6f10aa591441516226c2e22dca63aa7cb47b4f2edf8019f5da20e

Contents?: true

Size: 739 Bytes

Versions: 87

Compression:

Stored size: 739 Bytes

Contents

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;

Version data entries

87 entries across 64 versions & 9 rubygems

Version Path
sumomo-0.10.8 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.10.4 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.10.3 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.10.2 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.10.1 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.10.0 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.9.0 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.22 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.21 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.20 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.17 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.16 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.14 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.13 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.12 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.11 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.10 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.9 data/sumomo/api_modules/node_modules/lodash/invert.js
sumomo-0.8.8 data/sumomo/api_modules/node_modules/lodash/invert.js