aboutsummaryrefslogtreecommitdiff
path: root/test/scripts
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-11-07 17:26:27 +0100
committerGitHub <[email protected]>2023-11-07 16:26:27 +0000
commit8542ef30bd4eda3d9f04db2c4a79abf0369d57c3 (patch)
tree94f768aa2c1c48faedddb745843f6d0b34b19988 /test/scripts
parent9498203190e37a96114ddc8e861b02ccd94e517b (diff)
downloadfaker-8542ef30bd4eda3d9f04db2c4a79abf0369d57c3.tar.xz
faker-8542ef30bd4eda3d9f04db2c4a79abf0369d57c3.zip
infra(unicorn): no-array-reduce (#2479)
Diffstat (limited to 'test/scripts')
-rw-r--r--test/scripts/apidoc/verify-jsdoc-tags.spec.ts18
1 files changed, 7 insertions, 11 deletions
diff --git a/test/scripts/apidoc/verify-jsdoc-tags.spec.ts b/test/scripts/apidoc/verify-jsdoc-tags.spec.ts
index a924c268..47eca926 100644
--- a/test/scripts/apidoc/verify-jsdoc-tags.spec.ts
+++ b/test/scripts/apidoc/verify-jsdoc-tags.spec.ts
@@ -47,28 +47,24 @@ describe('verify JSDoc tags', () => {
}
const allowedReferences = new Set(
- Object.values(modules).reduce<string[]>((acc, [module, methods]) => {
+ Object.values(modules).flatMap(([module, methods]) => {
const moduleFieldName = extractModuleFieldName(module);
- return [
- ...acc,
- ...Object.keys(methods).map(
- (methodName) => `faker.${moduleFieldName}.${methodName}`
- ),
- ];
- }, [])
+ return Object.keys(methods).map(
+ (methodName) => `faker.${moduleFieldName}.${methodName}`
+ );
+ })
);
const allowedLinks = new Set(
- Object.values(modules).reduce<string[]>((acc, [module, methods]) => {
+ Object.values(modules).flatMap(([module, methods]) => {
const moduleFieldName = extractModuleFieldName(module);
return [
- ...acc,
`/api/${moduleFieldName}.html`,
...Object.keys(methods).map(
(methodName) =>
`/api/${moduleFieldName}.html#${methodName.toLowerCase()}`
),
];
- }, [])
+ })
);
function assertDescription(description: string, isHtml: boolean): void {