diff options
| author | ST-DDT <[email protected]> | 2024-11-14 22:41:21 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-11-14 21:41:21 +0000 |
| commit | ef24bff82cf5eac22e2d76bff9bcc0278a17a786 (patch) | |
| tree | a9d4d76836be336d07bb53acd9c5ae308d02ac4f /scripts | |
| parent | 467bd83dbd2f34dbd5080c45de18901823f83469 (diff) | |
| download | faker-ef24bff82cf5eac22e2d76bff9bcc0278a17a786.tar.xz faker-ef24bff82cf5eac22e2d76bff9bcc0278a17a786.zip | |
docs: expose documentation for all utilities (#3242)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/apidocs/processing/class.ts | 9 | ||||
| -rw-r--r-- | scripts/apidocs/processing/method.ts | 10 |
2 files changed, 6 insertions, 13 deletions
diff --git a/scripts/apidocs/processing/class.ts b/scripts/apidocs/processing/class.ts index a2c465b8..33fa213e 100644 --- a/scripts/apidocs/processing/class.ts +++ b/scripts/apidocs/processing/class.ts @@ -13,7 +13,7 @@ import { processClassConstructors, processClassMethods, processInterfaceMethods, - processProjectFunctions, + processUtilityFunctions, } from './method'; /** @@ -192,12 +192,7 @@ export function processProjectUtilities(project: Project): RawApiDocsPage { deprecated: undefined, description: 'A list of all the utilities available in Faker.js.', examples: [], - methods: processProjectFunctions( - project, - 'mergeLocales', - 'generateMersenne32Randomizer', - 'generateMersenne53Randomizer' - ), + methods: processUtilityFunctions(project), }; } diff --git a/scripts/apidocs/processing/method.ts b/scripts/apidocs/processing/method.ts index b9d1aa38..ce978ad8 100644 --- a/scripts/apidocs/processing/method.ts +++ b/scripts/apidocs/processing/method.ts @@ -11,7 +11,6 @@ import { type MethodDeclaration, } from 'ts-morph'; import { groupBy } from '../../../src/internal/group-by'; -import { valuesForKeys } from '../utils/value-checks'; import { newProcessingError } from './error'; import type { RawApiDocsSignature, @@ -138,12 +137,11 @@ function getAllFunctions( ); } -export function processProjectFunctions( - project: Project, - ...names: string[] -): RawApiDocsMethod[] { +export function processUtilityFunctions(project: Project): RawApiDocsMethod[] { return processMethodLikes( - valuesForKeys(getAllFunctions(project), names), + Object.values(getAllFunctions(project)).filter((fn) => + fn.getSourceFile().getFilePath().includes('/src/utils/') + ), (f) => f.getNameOrThrow() ); } |
