Remove semicolons.

This commit is contained in:
John-David Dalton
2017-02-04 23:50:10 -08:00
parent f3a8e55e70
commit 6cb3460fce
452 changed files with 4261 additions and 4261 deletions

View File

@@ -1,7 +1,7 @@
import baseForOwn from './baseForOwn.js';
import baseForOwn from './baseForOwn.js'
/** Used to check objects for own properties. */
const hasOwnProperty = Object.prototype.hasOwnProperty;
const hasOwnProperty = Object.prototype.hasOwnProperty
/**
* This method is like `invert` except that the inverted object is generated
@@ -17,22 +17,22 @@ const hasOwnProperty = Object.prototype.hasOwnProperty;
* @returns {Object} Returns the new inverted object.
* @example
*
* const object = { 'a': 1, 'b': 2, 'c': 1 };
* const object = { 'a': 1, 'b': 2, 'c': 1 }
*
* invertBy(object, value => `group${ value }`);
* invertBy(object, value => `group${ value }`)
* // => { 'group1': ['a', 'c'], 'group2': ['b'] }
*/
function invertBy(object, iteratee) {
const result = {};
const result = {}
baseForOwn(object, (value, key) => {
value = iteratee(value);
value = iteratee(value)
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
result[value].push(key)
} else {
result[value] = [key];
result[value] = [key]
}
});
return result;
})
return result
}
export default invertBy;
export default invertBy