@cparra/apexdocs 3.0.0-rc.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -576
- package/dist/cli/generate.js +73 -3094
- package/dist/defaults-BcE8DTat.js +13 -0
- package/dist/defaults-D07y_bq4.js +40 -0
- package/dist/defaults-gPzwP66p.js +14 -0
- package/dist/index.d.ts +35 -3
- package/dist/index.js +90 -2
- package/dist/logger-BEbUIfqN.js +3282 -0
- package/dist/logger-BGuf1PnL.js +3281 -0
- package/dist/logger-CWBRF2za.js +3284 -0
- package/dist/logger-CdBmDEN1.js +3283 -0
- package/dist/logger-Ce4QqPFR.js +3278 -0
- package/dist/logger-CyEVYaAC.js +3284 -0
- package/dist/logger-D7a83ycP.js +3277 -0
- package/dist/logger-DGaHeBKk.js +3279 -0
- package/dist/logger-Dqhl_lO_.js +3278 -0
- package/dist/logger-aySSWi0G.js +3280 -0
- package/dist/logger-qLCcAtiy.js +3284 -0
- package/package.json +5 -2
- package/.github/workflows/ci.yaml +0 -22
- package/.github/workflows/close_stale.yml +0 -22
- package/.prettierrc.js +0 -7
- package/__mocks__/chalk.js +0 -12
- package/__mocks__/log-update.js +0 -6
- package/eslint.config.mjs +0 -10
- package/examples/markdown/.forceignore +0 -12
- package/examples/markdown/config/project-scratch-def.json +0 -5
- package/examples/markdown/docs/index.md +0 -109
- package/examples/markdown/docs/miscellaneous/BaseClass.md +0 -16
- package/examples/markdown/docs/miscellaneous/MultiInheritanceClass.md +0 -72
- package/examples/markdown/docs/miscellaneous/ParentInterface.md +0 -15
- package/examples/markdown/docs/miscellaneous/ReferencedEnum.md +0 -8
- package/examples/markdown/docs/miscellaneous/SampleException.md +0 -24
- package/examples/markdown/docs/miscellaneous/SampleInterface.md +0 -116
- package/examples/markdown/docs/miscellaneous/Url.md +0 -311
- package/examples/markdown/docs/sample-enums/SampleEnum.md +0 -36
- package/examples/markdown/docs/samplegroup/SampleClass.md +0 -170
- package/examples/markdown/force-app/classes/BaseClass.cls +0 -3
- package/examples/markdown/force-app/classes/MultiInheritanceClass.cls +0 -1
- package/examples/markdown/force-app/classes/ParentInterface.cls +0 -3
- package/examples/markdown/force-app/classes/ReferencedEnum.cls +0 -3
- package/examples/markdown/force-app/classes/SampleClass.cls +0 -72
- package/examples/markdown/force-app/classes/SampleEnum.cls +0 -30
- package/examples/markdown/force-app/classes/SampleException.cls +0 -17
- package/examples/markdown/force-app/classes/SampleInterface.cls +0 -50
- package/examples/markdown/force-app/classes/Url.cls +0 -196
- package/examples/markdown/package-lock.json +0 -665
- package/examples/markdown/package.json +0 -20
- package/examples/markdown/sfdx-project.json +0 -12
- package/examples/markdown-jsconfig/.forceignore +0 -12
- package/examples/markdown-jsconfig/apexdocs.config.mjs +0 -21
- package/examples/markdown-jsconfig/config/project-scratch-def.json +0 -5
- package/examples/markdown-jsconfig/docs/index.md +0 -12
- package/examples/markdown-jsconfig/docs/miscellaneous/Url.md +0 -315
- package/examples/markdown-jsconfig/force-app/classes/Url.cls +0 -196
- package/examples/markdown-jsconfig/package-lock.json +0 -665
- package/examples/markdown-jsconfig/package.json +0 -15
- package/examples/markdown-jsconfig/sfdx-project.json +0 -12
- package/examples/open-api/config/project-scratch-def.json +0 -13
- package/examples/open-api/docs/openapi.json +0 -582
- package/examples/open-api/force-app/main/default/classes/ChildClass.cls +0 -42
- package/examples/open-api/force-app/main/default/classes/SampleClass.cls +0 -167
- package/examples/open-api/force-app/main/default/restapi/SampleRestResource.cls +0 -195
- package/examples/open-api/force-app/main/default/restapi/SampleRestResourceToSkip.cls +0 -35
- package/examples/open-api/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +0 -24
- package/examples/open-api/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +0 -15
- package/examples/open-api/force-app/main/default/restapi/references/Reference1.cls +0 -9
- package/examples/open-api/force-app/main/default/restapi/references/Reference2.cls +0 -9
- package/examples/open-api/force-app/main/default/restapi/references/Reference3.cls +0 -3
- package/examples/open-api/force-app/main/default/restapi/references/Reference4.cls +0 -3
- package/examples/open-api/force-app/main/default/restapi/references/Reference5.cls +0 -3
- package/examples/open-api/force-app/main/default/restapi/references/Reference6.cls +0 -6
- package/examples/open-api/force-app/main/default/restapi/references/Reference7.cls +0 -3
- package/examples/open-api/package-lock.json +0 -724
- package/examples/open-api/package.json +0 -20
- package/examples/open-api/sfdx-project.json +0 -12
- package/examples/vitepress/.forceignore +0 -12
- package/examples/vitepress/apexdocs.config.ts +0 -111
- package/examples/vitepress/config/project-scratch-def.json +0 -13
- package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js +0 -259
- package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/_metadata.json +0 -40
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js +0 -11474
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js +0 -9172
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/package.json +0 -3
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +0 -4339
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +0 -567
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/vue.js +0 -323
- package/examples/vitepress/docs/.vitepress/cache/deps/vue.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/config.mts +0 -21
- package/examples/vitepress/docs/.vitepress/sidebar.json +0 -119
- package/examples/vitepress/docs/api-examples.md +0 -49
- package/examples/vitepress/docs/index-frontmatter.md +0 -16
- package/examples/vitepress/docs/index.md +0 -56
- package/examples/vitepress/docs/markdown-examples.md +0 -85
- package/examples/vitepress/docs/miscellaneous/BaseClass.md +0 -20
- package/examples/vitepress/docs/miscellaneous/MultiInheritanceClass.md +0 -76
- package/examples/vitepress/docs/miscellaneous/ParentInterface.md +0 -19
- package/examples/vitepress/docs/miscellaneous/ReferencedEnum.md +0 -15
- package/examples/vitepress/docs/miscellaneous/SampleException.md +0 -28
- package/examples/vitepress/docs/miscellaneous/SampleInterface.md +0 -116
- package/examples/vitepress/docs/miscellaneous/Url.md +0 -317
- package/examples/vitepress/docs/sample-enums/SampleEnum.md +0 -40
- package/examples/vitepress/docs/samplegroup/SampleClass.md +0 -174
- package/examples/vitepress/force-app/main/default/classes/BaseClass.cls +0 -3
- package/examples/vitepress/force-app/main/default/classes/MultiInheritanceClass.cls +0 -1
- package/examples/vitepress/force-app/main/default/classes/ParentInterface.cls +0 -3
- package/examples/vitepress/force-app/main/default/classes/ReferencedEnum.cls +0 -5
- package/examples/vitepress/force-app/main/default/classes/SampleClass.cls +0 -72
- package/examples/vitepress/force-app/main/default/classes/SampleEnum.cls +0 -30
- package/examples/vitepress/force-app/main/default/classes/SampleException.cls +0 -17
- package/examples/vitepress/force-app/main/default/classes/SampleInterface.cls +0 -46
- package/examples/vitepress/force-app/main/default/classes/Url.cls +0 -198
- package/examples/vitepress/package-lock.json +0 -2574
- package/examples/vitepress/package.json +0 -18
- package/examples/vitepress/sfdx-project.json +0 -12
- package/jest.config.js +0 -10
- package/jest.d.ts +0 -7
- package/src/application/Apexdocs.ts +0 -72
- package/src/application/__tests__/apex-file-reader.spec.ts +0 -87
- package/src/application/apex-file-reader.ts +0 -55
- package/src/application/file-system.ts +0 -69
- package/src/application/file-writer.ts +0 -43
- package/src/application/generators/markdown.ts +0 -45
- package/src/application/generators/openapi.ts +0 -71
- package/src/cli/args.ts +0 -46
- package/src/cli/commands/markdown.ts +0 -51
- package/src/cli/commands/openapi.ts +0 -36
- package/src/cli/generate.ts +0 -16
- package/src/core/__test__/manifest.spec.ts +0 -16
- package/src/core/manifest.ts +0 -90
- package/src/core/markdown/__test__/expect-extensions.ts +0 -32
- package/src/core/markdown/__test__/generating-class-docs.spec.ts +0 -605
- package/src/core/markdown/__test__/generating-docs.spec.ts +0 -111
- package/src/core/markdown/__test__/generating-enum-docs.spec.ts +0 -321
- package/src/core/markdown/__test__/generating-interface-docs.spec.ts +0 -397
- package/src/core/markdown/__test__/generating-reference-guide.spec.ts +0 -180
- package/src/core/markdown/__test__/inheritance-chain.test.ts +0 -54
- package/src/core/markdown/__test__/test-helpers.ts +0 -23
- package/src/core/markdown/adapters/__tests__/documentables.spec.ts +0 -109
- package/src/core/markdown/adapters/__tests__/interface-adapter.spec.ts +0 -148
- package/src/core/markdown/adapters/__tests__/link-generator.spec.ts +0 -130
- package/src/core/markdown/adapters/__tests__/references.spec.ts +0 -136
- package/src/core/markdown/adapters/apex-types.ts +0 -238
- package/src/core/markdown/adapters/documentables.ts +0 -115
- package/src/core/markdown/adapters/fields-and-properties.ts +0 -45
- package/src/core/markdown/adapters/generate-link.ts +0 -82
- package/src/core/markdown/adapters/inline.ts +0 -143
- package/src/core/markdown/adapters/methods-and-constructors.ts +0 -133
- package/src/core/markdown/adapters/reference-guide.ts +0 -37
- package/src/core/markdown/adapters/renderable-bundle.ts +0 -61
- package/src/core/markdown/adapters/renderable-to-page-data.ts +0 -89
- package/src/core/markdown/adapters/type-utils.ts +0 -13
- package/src/core/markdown/adapters/types.d.ts +0 -180
- package/src/core/markdown/generate-docs.ts +0 -212
- package/src/core/markdown/reflection/__test__/filter-scope.spec.ts +0 -306
- package/src/core/markdown/reflection/filter-scope.ts +0 -13
- package/src/core/markdown/reflection/inheritance-chain-expanion.ts +0 -22
- package/src/core/markdown/reflection/inheritance-chain.ts +0 -23
- package/src/core/markdown/reflection/inherited-member-expansion.ts +0 -105
- package/src/core/markdown/reflection/reflect-source.ts +0 -123
- package/src/core/markdown/reflection/sort-members.ts +0 -59
- package/src/core/markdown/templates/class-template.ts +0 -75
- package/src/core/markdown/templates/constructors-partial-template.ts +0 -32
- package/src/core/markdown/templates/documentable-partial-template.ts +0 -26
- package/src/core/markdown/templates/enum-template.ts +0 -12
- package/src/core/markdown/templates/fieldsPartialTemplate.ts +0 -23
- package/src/core/markdown/templates/grouped-members-partial-template.ts +0 -6
- package/src/core/markdown/templates/hookable.ts +0 -7
- package/src/core/markdown/templates/interface-template.ts +0 -16
- package/src/core/markdown/templates/methods-partial-template.ts +0 -43
- package/src/core/markdown/templates/reference-guide.ts +0 -14
- package/src/core/markdown/templates/template.ts +0 -114
- package/src/core/markdown/templates/type-doc-partial.ts +0 -27
- package/src/core/markdown/utils.ts +0 -3
- package/src/core/openApiSettings.ts +0 -41
- package/src/core/openapi/__tests__/manifest-factory.spec.ts +0 -16
- package/src/core/openapi/__tests__/open-api-docs-processor.spec.ts +0 -56
- package/src/core/openapi/__tests__/open-api.spec.ts +0 -22
- package/src/core/openapi/apex-doc-types.ts +0 -26
- package/src/core/openapi/apex-type-wrappers/ClassMirrorWrapper.ts +0 -12
- package/src/core/openapi/apex-type-wrappers/MethodMirrorWrapper.ts +0 -11
- package/src/core/openapi/apex-type-wrappers/__tests__/ClassMirrorWrapper.spec.ts +0 -15
- package/src/core/openapi/file-container.ts +0 -13
- package/src/core/openapi/manifest-factory.ts +0 -16
- package/src/core/openapi/open-api-docs-processor.ts +0 -93
- package/src/core/openapi/open-api-types.ts +0 -119
- package/src/core/openapi/open-api.ts +0 -45
- package/src/core/openapi/openapi-type-file.ts +0 -12
- package/src/core/openapi/parser.ts +0 -160
- package/src/core/openapi/parsers/Builder.ts +0 -40
- package/src/core/openapi/parsers/MethodParser.ts +0 -249
- package/src/core/openapi/parsers/ParameterObjectBuilder.ts +0 -13
- package/src/core/openapi/parsers/ReferenceBuilder.ts +0 -299
- package/src/core/openapi/parsers/RequestBodyBuilder.ts +0 -19
- package/src/core/openapi/parsers/ResponsesBuilder.ts +0 -21
- package/src/core/openapi/parsers/__tests__/MethodParser.spec.ts +0 -44
- package/src/core/openapi/parsers/__tests__/ParameterObjectBuilder.spec.ts +0 -68
- package/src/core/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +0 -751
- package/src/core/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +0 -64
- package/src/core/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +0 -55
- package/src/core/openapi/transpiler.ts +0 -17
- package/src/core/openapi/types-repository.ts +0 -54
- package/src/core/parse-apex-metadata.ts +0 -30
- package/src/core/shared/types.d.ts +0 -148
- package/src/core/shared/utils.ts +0 -5
- package/src/defaults.ts +0 -9
- package/src/index.ts +0 -49
- package/src/test-helpers/AnnotationBuilder.ts +0 -29
- package/src/test-helpers/ClassMirrorBuilder.ts +0 -69
- package/src/test-helpers/DocCommentAnnotationBuilder.ts +0 -24
- package/src/test-helpers/DocCommentBuilder.ts +0 -36
- package/src/test-helpers/FieldMirrorBuilder.ts +0 -59
- package/src/test-helpers/InterfaceMirrorBuilder.ts +0 -39
- package/src/test-helpers/MethodMirrorBuilder.ts +0 -77
- package/src/test-helpers/SettingsBuilder.ts +0 -17
- package/src/util/error-logger.ts +0 -92
- package/src/util/fp.ts +0 -3
- package/src/util/logger.ts +0 -44
- package/src/util/string-utils.ts +0 -7
- package/tsconfig.json +0 -25
- package/tslint.json +0 -6
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { pipe } from 'fp-ts/function';
|
|
2
|
-
import * as TE from 'fp-ts/TaskEither';
|
|
3
|
-
import yaml from 'js-yaml';
|
|
4
|
-
|
|
5
|
-
import { apply } from '#utils/fp';
|
|
6
|
-
import {
|
|
7
|
-
DocPageData,
|
|
8
|
-
DocumentationBundle,
|
|
9
|
-
Frontmatter,
|
|
10
|
-
PostHookDocumentationBundle,
|
|
11
|
-
ReferenceGuidePageData,
|
|
12
|
-
UnparsedSourceFile,
|
|
13
|
-
TransformDocPage,
|
|
14
|
-
TransformDocs,
|
|
15
|
-
TransformReferenceGuide,
|
|
16
|
-
UserDefinedMarkdownConfig,
|
|
17
|
-
DocPageReference,
|
|
18
|
-
TransformReference,
|
|
19
|
-
ParsedFile,
|
|
20
|
-
} from '../shared/types';
|
|
21
|
-
import { parsedFilesToRenderableBundle } from './adapters/renderable-bundle';
|
|
22
|
-
import { reflectBundles } from './reflection/reflect-source';
|
|
23
|
-
import { addInheritanceChainToTypes } from './reflection/inheritance-chain-expanion';
|
|
24
|
-
import { addInheritedMembersToTypes } from './reflection/inherited-member-expansion';
|
|
25
|
-
import { convertToDocumentationBundle } from './adapters/renderable-to-page-data';
|
|
26
|
-
import { filterScope } from './reflection/filter-scope';
|
|
27
|
-
import { Template } from './templates/template';
|
|
28
|
-
import { hookableTemplate } from './templates/hookable';
|
|
29
|
-
import { sortMembers } from './reflection/sort-members';
|
|
30
|
-
import { isSkip } from '../shared/utils';
|
|
31
|
-
import { parsedFilesToReferenceGuide } from './adapters/reference-guide';
|
|
32
|
-
|
|
33
|
-
export type MarkdownGeneratorConfig = Pick<
|
|
34
|
-
UserDefinedMarkdownConfig,
|
|
35
|
-
| 'targetDir'
|
|
36
|
-
| 'scope'
|
|
37
|
-
| 'namespace'
|
|
38
|
-
| 'defaultGroupName'
|
|
39
|
-
| 'transformReferenceGuide'
|
|
40
|
-
| 'transformDocs'
|
|
41
|
-
| 'transformDocPage'
|
|
42
|
-
| 'transformReference'
|
|
43
|
-
| 'linkingStrategy'
|
|
44
|
-
> & {
|
|
45
|
-
referenceGuideTemplate: string;
|
|
46
|
-
sortMembersAlphabetically: boolean;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export class HookError {
|
|
50
|
-
readonly _tag = 'HookError';
|
|
51
|
-
|
|
52
|
-
constructor(public error: unknown) {}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function generateDocs(apexBundles: UnparsedSourceFile[], config: MarkdownGeneratorConfig) {
|
|
56
|
-
const filterOutOfScope = apply(filterScope, config.scope);
|
|
57
|
-
const convertToReferences = apply(parsedFilesToReferenceGuide, config);
|
|
58
|
-
const convertToRenderableBundle = apply(parsedFilesToRenderableBundle, config);
|
|
59
|
-
const convertToDocumentationBundleForTemplate = apply(convertToDocumentationBundle, config.referenceGuideTemplate);
|
|
60
|
-
const sortTypeMembers = apply(sortMembers, config.sortMembersAlphabetically);
|
|
61
|
-
|
|
62
|
-
return pipe(
|
|
63
|
-
apexBundles,
|
|
64
|
-
reflectBundles,
|
|
65
|
-
TE.map(filterOutOfScope),
|
|
66
|
-
TE.map(addInheritedMembersToTypes),
|
|
67
|
-
TE.map(addInheritanceChainToTypes),
|
|
68
|
-
TE.map(sortTypeMembers),
|
|
69
|
-
TE.bindTo('parsedFiles'),
|
|
70
|
-
TE.bind('references', ({ parsedFiles }) => TE.right(convertToReferences(parsedFiles))),
|
|
71
|
-
TE.flatMap(({ parsedFiles, references }) => transformReferenceHook(config)({ references, parsedFiles })),
|
|
72
|
-
TE.map(({ parsedFiles, references }) => convertToRenderableBundle(parsedFiles, references)),
|
|
73
|
-
TE.map(convertToDocumentationBundleForTemplate),
|
|
74
|
-
TE.flatMap(transformDocumentationBundleHook(config)),
|
|
75
|
-
TE.map(postHookCompile),
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function transformReferenceHook(config: MarkdownGeneratorConfig) {
|
|
80
|
-
async function _execute(
|
|
81
|
-
references: Record<string, DocPageReference>,
|
|
82
|
-
parsedFiles: ParsedFile[],
|
|
83
|
-
transformReference?: TransformReference | undefined,
|
|
84
|
-
): Promise<{
|
|
85
|
-
references: Record<string, DocPageReference>;
|
|
86
|
-
parsedFiles: ParsedFile[];
|
|
87
|
-
}> {
|
|
88
|
-
return {
|
|
89
|
-
references: await execTransformReferenceHook(Object.values(references), transformReference),
|
|
90
|
-
parsedFiles,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return ({ references, parsedFiles }: { references: Record<string, DocPageReference>; parsedFiles: ParsedFile[] }) =>
|
|
95
|
-
TE.tryCatch(
|
|
96
|
-
() => _execute(references, parsedFiles, config.transformReference),
|
|
97
|
-
(error) => new HookError(error),
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function transformDocumentationBundleHook(config: MarkdownGeneratorConfig) {
|
|
102
|
-
return (bundle: DocumentationBundle) =>
|
|
103
|
-
TE.tryCatch(
|
|
104
|
-
() => documentationBundleHook(bundle, config),
|
|
105
|
-
(error) => new HookError(error),
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Configurable hooks
|
|
110
|
-
function passThroughHook<T>(value: T): T {
|
|
111
|
-
return value;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const execTransformReferenceHook = async (
|
|
115
|
-
references: DocPageReference[],
|
|
116
|
-
hook: TransformReference = passThroughHook,
|
|
117
|
-
): Promise<Record<string, DocPageReference>> => {
|
|
118
|
-
const hooked = references.map<Promise<DocPageReference>>(async (reference) => {
|
|
119
|
-
const hookedResult = await hook(reference);
|
|
120
|
-
return {
|
|
121
|
-
...reference,
|
|
122
|
-
...hookedResult,
|
|
123
|
-
};
|
|
124
|
-
});
|
|
125
|
-
const awaited = await Promise.all(hooked);
|
|
126
|
-
|
|
127
|
-
return awaited.reduce<Record<string, DocPageReference>>((acc, reference) => {
|
|
128
|
-
acc[reference.source.name] = reference;
|
|
129
|
-
return acc;
|
|
130
|
-
}, {});
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const documentationBundleHook = async (
|
|
134
|
-
bundle: DocumentationBundle,
|
|
135
|
-
config: MarkdownGeneratorConfig,
|
|
136
|
-
): Promise<PostHookDocumentationBundle> => {
|
|
137
|
-
return {
|
|
138
|
-
referenceGuide: await transformReferenceGuide(bundle.referenceGuide, config.transformReferenceGuide),
|
|
139
|
-
docs: await transformDocs(bundle.docs, config.transformDocs, config.transformDocPage),
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const transformReferenceGuide = async (
|
|
144
|
-
referenceGuide: ReferenceGuidePageData,
|
|
145
|
-
hook: TransformReferenceGuide = passThroughHook,
|
|
146
|
-
) => {
|
|
147
|
-
const result = await hook(referenceGuide);
|
|
148
|
-
if (isSkip(result)) {
|
|
149
|
-
return result;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return {
|
|
153
|
-
...referenceGuide,
|
|
154
|
-
...(await hook(referenceGuide)),
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
const transformDocs = async (
|
|
159
|
-
docs: DocPageData[],
|
|
160
|
-
transformDocsHook: TransformDocs = passThroughHook,
|
|
161
|
-
transformDocPageHook: TransformDocPage = passThroughHook,
|
|
162
|
-
): Promise<Awaited<DocPageData[]>> => {
|
|
163
|
-
const transformed = await transformDocsHook(docs);
|
|
164
|
-
return Promise.all(transformed.map((doc) => transformDocPage(doc, transformDocPageHook)));
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const transformDocPage = async (doc: DocPageData, hook: TransformDocPage = passThroughHook) => {
|
|
168
|
-
return {
|
|
169
|
-
...doc,
|
|
170
|
-
...(await hook(doc)),
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
function postHookCompile(bundle: PostHookDocumentationBundle) {
|
|
175
|
-
return {
|
|
176
|
-
referenceGuide: isSkip(bundle.referenceGuide)
|
|
177
|
-
? bundle.referenceGuide
|
|
178
|
-
: {
|
|
179
|
-
...bundle.referenceGuide,
|
|
180
|
-
content: Template.getInstance().compile({
|
|
181
|
-
source: {
|
|
182
|
-
frontmatter: toFrontmatterString(bundle.referenceGuide.frontmatter),
|
|
183
|
-
content: bundle.referenceGuide.content,
|
|
184
|
-
},
|
|
185
|
-
template: hookableTemplate,
|
|
186
|
-
}),
|
|
187
|
-
},
|
|
188
|
-
docs: bundle.docs.map((doc) => ({
|
|
189
|
-
...doc,
|
|
190
|
-
content: Template.getInstance().compile({
|
|
191
|
-
source: {
|
|
192
|
-
frontmatter: toFrontmatterString(doc.frontmatter),
|
|
193
|
-
content: doc.content,
|
|
194
|
-
},
|
|
195
|
-
template: hookableTemplate,
|
|
196
|
-
}),
|
|
197
|
-
})),
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function toFrontmatterString(frontmatter: Frontmatter): string {
|
|
202
|
-
if (typeof frontmatter === 'string') {
|
|
203
|
-
return frontmatter;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
if (!frontmatter) {
|
|
207
|
-
return '';
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const yamlString = yaml.dump(frontmatter);
|
|
211
|
-
return `---\n${yamlString}---\n`;
|
|
212
|
-
}
|
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
import { ParsedFile } from '../../../shared/types';
|
|
2
|
-
import { ClassMirror, EnumMirror, InterfaceMirror, reflect } from '@cparra/apex-reflection';
|
|
3
|
-
import { filterScope } from '../filter-scope';
|
|
4
|
-
|
|
5
|
-
function parsedFileFromRawString(raw: string): ParsedFile {
|
|
6
|
-
const { error, typeMirror } = reflect(raw);
|
|
7
|
-
if (error) {
|
|
8
|
-
throw new Error(error.message);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return {
|
|
12
|
-
source: {
|
|
13
|
-
filePath: 'test.cls',
|
|
14
|
-
name: typeMirror!.name,
|
|
15
|
-
type: typeMirror!.type_name,
|
|
16
|
-
},
|
|
17
|
-
type: typeMirror!,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
describe('When filtering scope', () => {
|
|
22
|
-
it('filters out files with the @ignore annotation', () => {
|
|
23
|
-
const properties: [string, number][] = [
|
|
24
|
-
[
|
|
25
|
-
`
|
|
26
|
-
/**
|
|
27
|
-
* @ignore
|
|
28
|
-
*/
|
|
29
|
-
global class MyClass {}
|
|
30
|
-
`,
|
|
31
|
-
0,
|
|
32
|
-
],
|
|
33
|
-
['global class MyClass {}', 1],
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
for (const [input, expected] of properties) {
|
|
37
|
-
const parsedFile = parsedFileFromRawString(input);
|
|
38
|
-
|
|
39
|
-
const result = filterScope(['global'], [parsedFile]);
|
|
40
|
-
|
|
41
|
-
expect(result).toHaveLength(expected);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
describe('when scoping a class', () => {
|
|
46
|
-
it('filters out methods tagged with @ignore', () => {
|
|
47
|
-
const properties: [string, number][] = [
|
|
48
|
-
[
|
|
49
|
-
`
|
|
50
|
-
global class MyClass {
|
|
51
|
-
/**
|
|
52
|
-
* @ignore
|
|
53
|
-
*/
|
|
54
|
-
global void myMethod() {}
|
|
55
|
-
}
|
|
56
|
-
`,
|
|
57
|
-
0,
|
|
58
|
-
],
|
|
59
|
-
[
|
|
60
|
-
`
|
|
61
|
-
global class MyClass {
|
|
62
|
-
global void myMethod() {}
|
|
63
|
-
}
|
|
64
|
-
`,
|
|
65
|
-
1,
|
|
66
|
-
],
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
for (const [input, expected] of properties) {
|
|
70
|
-
const parsedFile = parsedFileFromRawString(input);
|
|
71
|
-
|
|
72
|
-
const result = filterScope(['global'], [parsedFile]);
|
|
73
|
-
|
|
74
|
-
expect((result[0].type as ClassMirror).methods).toHaveLength(expected);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('filters out properties tagged with @ignore', () => {
|
|
79
|
-
const properties: [string, number][] = [
|
|
80
|
-
[
|
|
81
|
-
`
|
|
82
|
-
global class MyClass {
|
|
83
|
-
/**
|
|
84
|
-
* @ignore
|
|
85
|
-
*/
|
|
86
|
-
global Integer myProperty { get; set; }
|
|
87
|
-
}
|
|
88
|
-
`,
|
|
89
|
-
0,
|
|
90
|
-
],
|
|
91
|
-
[
|
|
92
|
-
`
|
|
93
|
-
global class MyClass {
|
|
94
|
-
global Integer myProperty { get; set; }
|
|
95
|
-
}
|
|
96
|
-
`,
|
|
97
|
-
1,
|
|
98
|
-
],
|
|
99
|
-
];
|
|
100
|
-
|
|
101
|
-
for (const [input, expected] of properties) {
|
|
102
|
-
const parsedFile = parsedFileFromRawString(input);
|
|
103
|
-
|
|
104
|
-
const result = filterScope(['global'], [parsedFile]);
|
|
105
|
-
|
|
106
|
-
expect((result[0].type as ClassMirror).properties).toHaveLength(expected);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
it('filters out fields tagged with @ignore', () => {
|
|
111
|
-
const properties: [string, number][] = [
|
|
112
|
-
[
|
|
113
|
-
`
|
|
114
|
-
global class MyClass {
|
|
115
|
-
/**
|
|
116
|
-
* @ignore
|
|
117
|
-
*/
|
|
118
|
-
global Integer myField;
|
|
119
|
-
}
|
|
120
|
-
`,
|
|
121
|
-
0,
|
|
122
|
-
],
|
|
123
|
-
[
|
|
124
|
-
`
|
|
125
|
-
global class MyClass {
|
|
126
|
-
global Integer myField;
|
|
127
|
-
}
|
|
128
|
-
`,
|
|
129
|
-
1,
|
|
130
|
-
],
|
|
131
|
-
];
|
|
132
|
-
|
|
133
|
-
for (const [input, expected] of properties) {
|
|
134
|
-
const parsedFile = parsedFileFromRawString(input);
|
|
135
|
-
|
|
136
|
-
const result = filterScope(['global'], [parsedFile]);
|
|
137
|
-
|
|
138
|
-
expect((result[0].type as ClassMirror).fields).toHaveLength(expected);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it('filters out inner classes tagged with @ignore', () => {
|
|
143
|
-
const properties: [string, number][] = [
|
|
144
|
-
[
|
|
145
|
-
`
|
|
146
|
-
global class MyClass {
|
|
147
|
-
/**
|
|
148
|
-
* @ignore
|
|
149
|
-
*/
|
|
150
|
-
global class InnerClass {}
|
|
151
|
-
}
|
|
152
|
-
`,
|
|
153
|
-
0,
|
|
154
|
-
],
|
|
155
|
-
[
|
|
156
|
-
`
|
|
157
|
-
global class MyClass {
|
|
158
|
-
global class InnerClass {}
|
|
159
|
-
}
|
|
160
|
-
`,
|
|
161
|
-
1,
|
|
162
|
-
],
|
|
163
|
-
];
|
|
164
|
-
|
|
165
|
-
for (const [input, expected] of properties) {
|
|
166
|
-
const parsedFile = parsedFileFromRawString(input);
|
|
167
|
-
|
|
168
|
-
const result = filterScope(['global'], [parsedFile]);
|
|
169
|
-
|
|
170
|
-
expect((result[0].type as ClassMirror).classes).toHaveLength(expected);
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
it('filters out inner interfaces tagged with @ignore', () => {
|
|
175
|
-
const properties: [string, number][] = [
|
|
176
|
-
[
|
|
177
|
-
`
|
|
178
|
-
global class MyClass {
|
|
179
|
-
/**
|
|
180
|
-
* @ignore
|
|
181
|
-
*/
|
|
182
|
-
global interface InnerInterface {}
|
|
183
|
-
}
|
|
184
|
-
`,
|
|
185
|
-
0,
|
|
186
|
-
],
|
|
187
|
-
[
|
|
188
|
-
`
|
|
189
|
-
global class MyClass {
|
|
190
|
-
global interface InnerInterface {}
|
|
191
|
-
}
|
|
192
|
-
`,
|
|
193
|
-
1,
|
|
194
|
-
],
|
|
195
|
-
];
|
|
196
|
-
|
|
197
|
-
for (const [input, expected] of properties) {
|
|
198
|
-
const parsedFile = parsedFileFromRawString(input);
|
|
199
|
-
|
|
200
|
-
const result = filterScope(['global'], [parsedFile]);
|
|
201
|
-
|
|
202
|
-
expect((result[0].type as ClassMirror).interfaces).toHaveLength(expected);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
it('filters out inner enums tagged with @ignore', () => {
|
|
207
|
-
const properties: [string, number][] = [
|
|
208
|
-
[
|
|
209
|
-
`
|
|
210
|
-
global class MyClass {
|
|
211
|
-
/**
|
|
212
|
-
* @ignore
|
|
213
|
-
*/
|
|
214
|
-
global enum InnerEnum {}
|
|
215
|
-
}
|
|
216
|
-
`,
|
|
217
|
-
0,
|
|
218
|
-
],
|
|
219
|
-
[
|
|
220
|
-
`
|
|
221
|
-
global class MyClass {
|
|
222
|
-
global enum InnerEnum {}
|
|
223
|
-
}
|
|
224
|
-
`,
|
|
225
|
-
1,
|
|
226
|
-
],
|
|
227
|
-
];
|
|
228
|
-
|
|
229
|
-
for (const [input, expected] of properties) {
|
|
230
|
-
const parsedFile = parsedFileFromRawString(input);
|
|
231
|
-
|
|
232
|
-
const result = filterScope(['global'], [parsedFile]);
|
|
233
|
-
|
|
234
|
-
expect((result[0].type as ClassMirror).enums).toHaveLength(expected);
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
describe('when scoping an interface', () => {
|
|
240
|
-
it('filters out methods tagged with @ignore', () => {
|
|
241
|
-
const properties: [string, number][] = [
|
|
242
|
-
[
|
|
243
|
-
`
|
|
244
|
-
global interface MyInterface {
|
|
245
|
-
/**
|
|
246
|
-
* @ignore
|
|
247
|
-
*/
|
|
248
|
-
void myMethod();
|
|
249
|
-
}
|
|
250
|
-
`,
|
|
251
|
-
0,
|
|
252
|
-
],
|
|
253
|
-
[
|
|
254
|
-
`
|
|
255
|
-
global interface MyInterface {
|
|
256
|
-
void myMethod();
|
|
257
|
-
}
|
|
258
|
-
`,
|
|
259
|
-
1,
|
|
260
|
-
],
|
|
261
|
-
];
|
|
262
|
-
|
|
263
|
-
for (const [input, expected] of properties) {
|
|
264
|
-
const parsedFile = parsedFileFromRawString(input);
|
|
265
|
-
|
|
266
|
-
const result = filterScope(['global'], [parsedFile]);
|
|
267
|
-
|
|
268
|
-
expect((result[0].type as InterfaceMirror).methods).toHaveLength(expected);
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
describe('when scoping an enum', () => {
|
|
274
|
-
it('never filters out enum values, even if tagged with @ignore', () => {
|
|
275
|
-
const properties: [string, number][] = [
|
|
276
|
-
[
|
|
277
|
-
`
|
|
278
|
-
global enum MyEnum {
|
|
279
|
-
/**
|
|
280
|
-
* @ignore
|
|
281
|
-
*/
|
|
282
|
-
VALUE
|
|
283
|
-
}
|
|
284
|
-
`,
|
|
285
|
-
1,
|
|
286
|
-
],
|
|
287
|
-
[
|
|
288
|
-
`
|
|
289
|
-
global enum MyEnum {
|
|
290
|
-
VALUE
|
|
291
|
-
}
|
|
292
|
-
`,
|
|
293
|
-
1,
|
|
294
|
-
],
|
|
295
|
-
];
|
|
296
|
-
|
|
297
|
-
for (const [input, expected] of properties) {
|
|
298
|
-
const parsedFile = parsedFileFromRawString(input);
|
|
299
|
-
|
|
300
|
-
const result = filterScope(['global'], [parsedFile]);
|
|
301
|
-
|
|
302
|
-
expect((result[0].type as EnumMirror).values).toHaveLength(expected);
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ParsedFile } from '../../shared/types';
|
|
2
|
-
import Manifest from '../../manifest';
|
|
3
|
-
|
|
4
|
-
export function filterScope(scopes: string[], parsedFiles: ParsedFile[]): ParsedFile[] {
|
|
5
|
-
return parsedFiles
|
|
6
|
-
.filter(({ type }) => Manifest.shouldFilterType(type, scopes))
|
|
7
|
-
.map((parsedFile) => {
|
|
8
|
-
return {
|
|
9
|
-
...parsedFile,
|
|
10
|
-
type: Manifest.filterSingleType(parsedFile.type, scopes, false),
|
|
11
|
-
};
|
|
12
|
-
});
|
|
13
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ClassMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import { createInheritanceChain } from './inheritance-chain';
|
|
3
|
-
import { ParsedFile } from '../../shared/types';
|
|
4
|
-
import { parsedFilesToTypes } from '../utils';
|
|
5
|
-
|
|
6
|
-
export const addInheritanceChainToTypes = (parsedFiles: ParsedFile[]): ParsedFile[] =>
|
|
7
|
-
parsedFiles.map((parsedFile) => ({
|
|
8
|
-
...parsedFile,
|
|
9
|
-
type: addInheritanceChain(parsedFile.type, parsedFilesToTypes(parsedFiles)),
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
|
-
function addInheritanceChain<T extends Type>(current: T, repository: Type[]): T {
|
|
13
|
-
if (current.type_name === 'enum' || current.type_name === 'interface') {
|
|
14
|
-
return current;
|
|
15
|
-
} else {
|
|
16
|
-
const inheritanceChain = createInheritanceChain(repository, current as ClassMirror);
|
|
17
|
-
return {
|
|
18
|
-
...current,
|
|
19
|
-
inheritanceChain,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ClassMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import { pipe } from 'fp-ts/function';
|
|
3
|
-
import * as O from 'fp-ts/Option';
|
|
4
|
-
|
|
5
|
-
export function createInheritanceChain(repository: Type[], classMirror: ClassMirror): string[] {
|
|
6
|
-
return pipe(
|
|
7
|
-
O.fromNullable(classMirror.extended_class),
|
|
8
|
-
O.match(
|
|
9
|
-
() => [],
|
|
10
|
-
(extendedClassName) => inheritanceChainFromParentClassName(repository, extendedClassName),
|
|
11
|
-
),
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function inheritanceChainFromParentClassName(repository: Type[], className: string): string[] {
|
|
16
|
-
return pipe(
|
|
17
|
-
O.fromNullable(repository.find((type) => type.name.toLowerCase() === className.toLowerCase())),
|
|
18
|
-
O.match(
|
|
19
|
-
() => [className],
|
|
20
|
-
(extendedClass: Type) => [className, ...createInheritanceChain(repository, extendedClass as ClassMirror)],
|
|
21
|
-
),
|
|
22
|
-
);
|
|
23
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { ClassMirror, InterfaceMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import { ParsedFile } from '../../shared/types';
|
|
3
|
-
import { pipe } from 'fp-ts/function';
|
|
4
|
-
import { parsedFilesToTypes } from '../utils';
|
|
5
|
-
|
|
6
|
-
export const addInheritedMembersToTypes = (parsedFiles: ParsedFile[]) =>
|
|
7
|
-
parsedFiles.map((parsedFile) => addInheritedMembers(parsedFilesToTypes(parsedFiles), parsedFile));
|
|
8
|
-
|
|
9
|
-
export function addInheritedMembers(repository: Type[], parsedFile: ParsedFile): ParsedFile {
|
|
10
|
-
function addInheritedMembersToType<T extends Type>(repository: Type[], current: T): T {
|
|
11
|
-
if (current.type_name === 'enum') {
|
|
12
|
-
return current;
|
|
13
|
-
} else if (current.type_name === 'interface') {
|
|
14
|
-
return addInheritedInterfaceMethods(current as InterfaceMirror, repository) as T;
|
|
15
|
-
} else {
|
|
16
|
-
return addInheritedClassMembers(current as ClassMirror, repository) as T;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
...parsedFile,
|
|
22
|
-
type: addInheritedMembersToType(repository, parsedFile.type),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function addInheritedInterfaceMethods(interfaceMirror: InterfaceMirror, repository: Type[]): InterfaceMirror {
|
|
27
|
-
function methodAlreadyExists(memberName: string, members: { name: string }[]) {
|
|
28
|
-
return members.some((member) => member.name.toLowerCase() === memberName.toLowerCase());
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function parentExtractor(interfaceMirror: InterfaceMirror): string[] {
|
|
32
|
-
return interfaceMirror.extended_interfaces;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const parents = getParents(parentExtractor, interfaceMirror, repository);
|
|
36
|
-
return {
|
|
37
|
-
...interfaceMirror,
|
|
38
|
-
methods: parents.reduce(
|
|
39
|
-
(acc, currentValue) => [
|
|
40
|
-
...acc,
|
|
41
|
-
...currentValue.methods
|
|
42
|
-
.filter((method) => !methodAlreadyExists(method.name, acc))
|
|
43
|
-
.map((method) => ({
|
|
44
|
-
...method,
|
|
45
|
-
inherited: true,
|
|
46
|
-
})),
|
|
47
|
-
],
|
|
48
|
-
interfaceMirror.methods,
|
|
49
|
-
),
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function addInheritedClassMembers(classMirror: ClassMirror, repository: Type[]): ClassMirror {
|
|
54
|
-
function memberAlreadyExists(memberName: string, members: { name: string }[]) {
|
|
55
|
-
return members.some((member) => member.name.toLowerCase() === memberName.toLowerCase());
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function parentExtractor(classMirror: ClassMirror): string[] {
|
|
59
|
-
return classMirror.extended_class ? [classMirror.extended_class] : [];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function filterMember<T extends { name: string; access_modifier: string }>(members: T[], existing: T[]): T[] {
|
|
63
|
-
return members
|
|
64
|
-
.filter((member) => member.access_modifier.toLowerCase() !== 'private')
|
|
65
|
-
.filter((member) => !memberAlreadyExists(member.name, existing))
|
|
66
|
-
.map((member) => ({
|
|
67
|
-
...member,
|
|
68
|
-
inherited: true,
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const parents = getParents(parentExtractor, classMirror, repository);
|
|
73
|
-
return {
|
|
74
|
-
...classMirror,
|
|
75
|
-
fields: parents.reduce(
|
|
76
|
-
(acc, currentValue) => [...acc, ...filterMember(currentValue.fields, acc)],
|
|
77
|
-
classMirror.fields,
|
|
78
|
-
),
|
|
79
|
-
properties: parents.reduce(
|
|
80
|
-
(acc, currentValue) => [...acc, ...filterMember(currentValue.properties, acc)],
|
|
81
|
-
classMirror.properties,
|
|
82
|
-
),
|
|
83
|
-
methods: parents.reduce(
|
|
84
|
-
(acc, currentValue) => [...acc, ...filterMember(currentValue.methods, acc)],
|
|
85
|
-
classMirror.methods,
|
|
86
|
-
),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function getParents<T extends Type>(
|
|
91
|
-
extendedNamesExtractor: (current: T) => string[],
|
|
92
|
-
current: T,
|
|
93
|
-
repository: Type[],
|
|
94
|
-
): T[] {
|
|
95
|
-
return pipe(
|
|
96
|
-
extendedNamesExtractor(current),
|
|
97
|
-
(interfaces: string[]) => interfaces.map((interfaceName) => repository.find((type) => type.name === interfaceName)),
|
|
98
|
-
(interfaces = []) => interfaces.filter((type) => type !== undefined) as T[],
|
|
99
|
-
(interfaces) =>
|
|
100
|
-
interfaces.reduce<T[]>(
|
|
101
|
-
(acc, current) => [...acc, ...getParents(extendedNamesExtractor, current, repository)],
|
|
102
|
-
interfaces,
|
|
103
|
-
),
|
|
104
|
-
);
|
|
105
|
-
}
|