Skip to content

Commit

Permalink
Fix schema generation for mapped options
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Nov 6, 2021
1 parent 07a2d58 commit 774aa36
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .config/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"SORT_STRATEGIES",
"_ModelToObject"
],
"entryPoints": ["../src/index.ts"],
"entryPoints": ["../src"],
"entryPointStrategy": "Resolve",
"excludeExternals": true,
"excludePrivate": true,
"excludeInternal": true,
Expand Down
10 changes: 10 additions & 0 deletions scripts/generate_options_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ addTypeDocOptions({
/** @type {import("../dist").MapDeclarationOption} */ (
option
).defaultValue;
if (!data.enum.includes(data.default)) {
for (const [k, v] of map instanceof Map
? map
: Object.entries(map)) {
if (v === data.default) {
data.default = k;
break;
}
}
}
break;
}
case ParameterType.Flags: {
Expand Down

0 comments on commit 774aa36

Please sign in to comment.