1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import baseIteratee from './_baseIteratee.js';
- import createInverter from './_createInverter.js';
- var objectProto = Object.prototype;
- var hasOwnProperty = objectProto.hasOwnProperty;
- var nativeObjectToString = objectProto.toString;
- var invertBy = createInverter(function(result, value, key) {
- if (value != null &&
- typeof value.toString != 'function') {
- value = nativeObjectToString.call(value);
- }
- if (hasOwnProperty.call(result, value)) {
- result[value].push(key);
- } else {
- result[value] = [key];
- }
- }, baseIteratee);
- export default invertBy;
|