123456789101112131415161718192021222324252627282930313233343536373839404142 |
- var constant = require('./constant'),
- createInverter = require('./_createInverter'),
- identity = require('./identity');
- var objectProto = Object.prototype;
- var nativeObjectToString = objectProto.toString;
- 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;
|