chore: use Object.fromEntries over reduce (#14822)

This commit is contained in:
Simen Bekkhus
2023-12-31 17:12:00 +01:00
committed by GitHub
parent c45007e2fb
commit f9400bdf4f
3 changed files with 6 additions and 10 deletions
+5 -4
View File
@@ -79,10 +79,11 @@ function getPackages() {
},
/* eslint-enable */
'./package.json': './package.json',
...Object.values(pkg.bin || {}).reduce(
(mem, curr) =>
Object.assign(mem, {[curr.replace(/\.js$/, '')]: curr}),
{},
...Object.fromEntries(
Object.values(pkg.bin || {}).map(curr => [
curr.replace(/\.js$/, ''),
curr,
]),
),
...(pkg.name === 'jest-circus'
? {'./runner': './build/runner.js'}