@kubb/core 5.18.0 → 5.18.1
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 +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2399,6 +2399,12 @@ type ResolveImportsOptions = {
|
|
|
2399
2399
|
* point enum refs at a suffixed type name. Defaults to the resolver's top-level `name`.
|
|
2400
2400
|
*/
|
|
2401
2401
|
name?: (schemaName: string) => string;
|
|
2402
|
+
/**
|
|
2403
|
+
* Also import the refs inside `conditionals`, `contains` and a string's `content`, for a plugin that prints those checks.
|
|
2404
|
+
*
|
|
2405
|
+
* @default false
|
|
2406
|
+
*/
|
|
2407
|
+
checks?: boolean;
|
|
2402
2408
|
};
|
|
2403
2409
|
/**
|
|
2404
2410
|
* The `file` field of a resolver: decides what a generated file is called and, optionally, where
|
package/dist/index.d.ts
CHANGED
|
@@ -2399,6 +2399,12 @@ type ResolveImportsOptions = {
|
|
|
2399
2399
|
* point enum refs at a suffixed type name. Defaults to the resolver's top-level `name`.
|
|
2400
2400
|
*/
|
|
2401
2401
|
name?: (schemaName: string) => string;
|
|
2402
|
+
/**
|
|
2403
|
+
* Also import the refs inside `conditionals`, `contains` and a string's `content`, for a plugin that prints those checks.
|
|
2404
|
+
*
|
|
2405
|
+
* @default false
|
|
2406
|
+
*/
|
|
2407
|
+
checks?: boolean;
|
|
2402
2408
|
};
|
|
2403
2409
|
/**
|
|
2404
2410
|
* The `file` field of a resolver: decides what a generated file is called and, optionally, where
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var __name = (target, value) => __defProp(target, "name", {
|
|
|
21
21
|
configurable: true
|
|
22
22
|
});
|
|
23
23
|
// package.json
|
|
24
|
-
var version = "5.18.
|
|
24
|
+
var version = "5.18.1";
|
|
25
25
|
// ../../internals/utils/src/casing.ts
|
|
26
26
|
/**
|
|
27
27
|
* Shared implementation for camelCase and PascalCase conversion.
|
|
@@ -31,7 +31,7 @@ var version = "5.18.0";
|
|
|
31
31
|
* When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
|
|
32
32
|
*/
|
|
33
33
|
function convert(text, pascal) {
|
|
34
|
-
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
34
|
+
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)(?!xx(?![a-z]))([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
35
35
|
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
36
36
|
return (i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()) + word.slice(1);
|
|
37
37
|
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
@@ -1938,9 +1938,9 @@ var Resolver = class Resolver {
|
|
|
1938
1938
|
* reads the same ref set instead of re-scanning it per plugin.
|
|
1939
1939
|
*/
|
|
1940
1940
|
imports(options) {
|
|
1941
|
-
const { node, root, output, group, extname = ".ts", name } = options;
|
|
1941
|
+
const { node, root, output, group, extname = ".ts", name, checks } = options;
|
|
1942
1942
|
const resolveName = name ?? ((schemaName) => this.name(schemaName));
|
|
1943
|
-
return collectImportedRefNames(node).map((schemaName) => ast.factory.createImport({
|
|
1943
|
+
return collectImportedRefNames(node, { checks }).map((schemaName) => ast.factory.createImport({
|
|
1944
1944
|
name: [resolveName(schemaName)],
|
|
1945
1945
|
path: this.#resolveFilePath({
|
|
1946
1946
|
name: schemaName,
|