diff options
| author | ST-DDT <[email protected]> | 2023-11-07 17:26:27 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-07 16:26:27 +0000 |
| commit | 8542ef30bd4eda3d9f04db2c4a79abf0369d57c3 (patch) | |
| tree | 94f768aa2c1c48faedddb745843f6d0b34b19988 /scripts | |
| parent | 9498203190e37a96114ddc8e861b02ccd94e517b (diff) | |
| download | faker-8542ef30bd4eda3d9f04db2c4a79abf0369d57c3.tar.xz faker-8542ef30bd4eda3d9f04db2c4a79abf0369d57c3.zip | |
infra(unicorn): no-array-reduce (#2479)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/apidoc/writer.ts | 23 |
1 files changed, 10 insertions, 13 deletions
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)]) + ), + }, }; } |
