1 var constant = require('./constant'),
2 createInverter = require('./_createInverter'),
3 identity = require('./identity');
5 /** Used for built-in method references. */
6 var objectProto = Object.prototype;
10 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
13 var nativeObjectToString = objectProto.toString;
16 * Creates an object composed of the inverted keys and values of `object`.
17 * If `object` contains duplicate values, subsequent values overwrite
18 * property assignments of previous values.
24 * @param {Object} object The object to invert.
25 * @returns {Object} Returns the new inverted object.
28 * var object = { 'a': 1, 'b': 2, 'c': 1 };
31 * // => { '1': 'c', '2': 'b' }
33 var invert = createInverter(function(result, value, key) {
35 typeof value.toString != 'function') {
36 value = nativeObjectToString.call(value);
40 }, constant(identity));
42 module.exports = invert;