-
-
Notifications
You must be signed in to change notification settings - Fork 420
Closed
Labels
Description
Fail
const foo = _.fromPairs(pairs);Configurable function list like https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat.md#functions
const foo = pairs.reduce((object, [key, value]) => Object.assign(object, {[key]: value}), {});const foo = pairs.reduce((object, [key, value]) => Object.assign(object, {[key]: value}), Object.create(null));const foo = pairs.reduce((object, [key, value]) => ({...object, [key]: value}), {});const foo = pairs.reduce((object, [key, value]) => {
object[key] = value;
return object;
}, {});const foo = {};
for (const [key, value] of pairs) {
foo[key] = value;
}Pass
const foo = Object.fromEntries(pairs);sindresorhus, yakov116, dimaMachina, bschlenk, fregante and 1 moredimaMachinadimaMachina