From 8542ef30bd4eda3d9f04db2c4a79abf0369d57c3 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 7 Nov 2023 17:26:27 +0100 Subject: infra(unicorn): no-array-reduce (#2479) --- scripts/apidoc/writer.ts | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/apidoc/writer.ts b/scripts/apidoc/writer.ts index b5fa5806..0fc7ae78 100644 --- a/scripts/apidoc/writer.ts +++ b/scripts/apidoc/writer.ts @@ -63,20 +63,17 @@ export async function writeApiDocsModule( text: moduleName, link: `/api/${lowerModuleName}.html`, methods, - diff: methods.reduce( - (data, method) => ({ - ...data, - [method.name]: methodDiffHash(method), + diff: { + moduleHash: diffHash({ + name: moduleName, + field: lowerModuleName, + deprecated, + comment, }), - { - moduleHash: diffHash({ - name: moduleName, - field: lowerModuleName, - deprecated, - comment, - }), - } - ), + ...Object.fromEntries( + methods.map((method) => [method.name, methodDiffHash(method)]) + ), + }, }; } -- cgit v1.2.3