File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 13173
13173
* // => { '1': 'c', '2': 'b' }
13174
13174
*/
13175
13175
var invert = createInverter(function(result, value, key) {
13176
+ if (value != null &&
13177
+ typeof value.toString != 'function') {
13178
+ value = nativeObjectToString.call(value);
13179
+ }
13180
+
13176
13181
result[value] = key;
13177
13182
}, constant(identity));
13178
13183
13203
13208
* // => { 'group1': ['a', 'c'], 'group2': ['b'] }
13204
13209
*/
13205
13210
var invertBy = createInverter(function(result, value, key) {
13211
+ if (value != null &&
13212
+ typeof value.toString != 'function') {
13213
+ value = nativeObjectToString.call(value);
13214
+ }
13215
+
13206
13216
if (hasOwnProperty.call(result, value)) {
13207
13217
result[value].push(key);
13208
13218
} else {
You can’t perform that action at this time.
0 commit comments