Skip to content

Commit 774aa36

Browse files
committed
Fix schema generation for mapped options
1 parent 07a2d58 commit 774aa36

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.config/typedoc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"SORT_STRATEGIES",
99
"_ModelToObject"
1010
],
11-
"entryPoints": ["../src/index.ts"],
11+
"entryPoints": ["../src"],
12+
"entryPointStrategy": "Resolve",
1213
"excludeExternals": true,
1314
"excludePrivate": true,
1415
"excludeInternal": true,

scripts/generate_options_schema.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ addTypeDocOptions({
7373
/** @type {import("../dist").MapDeclarationOption} */ (
7474
option
7575
).defaultValue;
76+
if (!data.enum.includes(data.default)) {
77+
for (const [k, v] of map instanceof Map
78+
? map
79+
: Object.entries(map)) {
80+
if (v === data.default) {
81+
data.default = k;
82+
break;
83+
}
84+
}
85+
}
7686
break;
7787
}
7888
case ParameterType.Flags: {

0 commit comments

Comments
 (0)