@kubb/ast 5.9.4 → 5.9.6
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/dist/index.cjs +12 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +37 -3
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -96,6 +96,8 @@ const schemaTypes = {
|
|
|
96
96
|
* "All of" multiple schema members.
|
|
97
97
|
*/
|
|
98
98
|
intersection: "intersection",
|
|
99
|
+
/** "Not" a single schema member. */
|
|
100
|
+
not: "not",
|
|
99
101
|
/**
|
|
100
102
|
* Enum schema.
|
|
101
103
|
*/
|
|
@@ -1121,16 +1123,17 @@ function mergeByPath(result) {
|
|
|
1121
1123
|
}
|
|
1122
1124
|
/**
|
|
1123
1125
|
* Deduplicates `SourceNode` objects by `name + isExportable + isTypeOnly`, keeping the first of each
|
|
1124
|
-
* key.
|
|
1125
|
-
* the deduplicated array in original order.
|
|
1126
|
+
* key. An unnamed source only drops when the same node appears twice, so markdown can repeat a
|
|
1127
|
+
* paragraph or a table. Returns the deduplicated array in original order.
|
|
1126
1128
|
*/
|
|
1127
1129
|
function combineSources(sources) {
|
|
1128
|
-
const seen = /* @__PURE__ */ new
|
|
1129
|
-
|
|
1130
|
-
const key =
|
|
1131
|
-
if (
|
|
1132
|
-
|
|
1133
|
-
|
|
1130
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1131
|
+
return sources.filter((source) => {
|
|
1132
|
+
const key = source.name != null ? `${source.name}:${source.isExportable ?? false}:${source.isTypeOnly ?? false}` : source;
|
|
1133
|
+
if (seen.has(key)) return false;
|
|
1134
|
+
seen.add(key);
|
|
1135
|
+
return true;
|
|
1136
|
+
});
|
|
1134
1137
|
}
|
|
1135
1138
|
/**
|
|
1136
1139
|
* Deduplicates and merges `ExportNode` objects by path and type.
|
|
@@ -1435,7 +1438,7 @@ function createResponse(props) {
|
|
|
1435
1438
|
/**
|
|
1436
1439
|
* Maps schema `type` to its underlying `primitive`.
|
|
1437
1440
|
* Primitive types map to themselves and special string formats map to `'string'`.
|
|
1438
|
-
* Any type not listed here (such as `ref`, `enum`, `union`, `intersection`, `tuple`, `ipv4`, `ipv6`, `blob`) has no `primitive`.
|
|
1441
|
+
* Any type not listed here (such as `ref`, `enum`, `union`, `intersection`, `not`, `tuple`, `ipv4`, `ipv6`, `blob`) has no `primitive`.
|
|
1439
1442
|
*/
|
|
1440
1443
|
const TYPE_TO_PRIMITIVE = {
|
|
1441
1444
|
string: "string",
|