Travis build: 2114 [cron]
This commit is contained in:
7
test/toHash/toHash.js
Normal file
7
test/toHash/toHash.js
Normal file
@ -0,0 +1,7 @@
|
||||
const toHash = (object, key) =>
|
||||
Array.prototype.reduce.call(
|
||||
object,
|
||||
(acc, data, index) => ((acc[!key ? index : data[key]] = data), acc),
|
||||
{}
|
||||
);
|
||||
module.exports = toHash;
|
||||
Reference in New Issue
Block a user