@kubb/adapter-oas 5.23.2 → 5.23.3
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 +5 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -34
- package/dist/index.js.map +1 -1
- package/dist/{validateSpec-Ospj1aaB.js → validateSpec-BTbUBxQB.js} +1 -1
- package/dist/{validateSpec-Ospj1aaB.js.map → validateSpec-BTbUBxQB.js.map} +1 -1
- package/dist/{validateSpec-DCiUXkMn.cjs → validateSpec-Bxf2WZ1Y.cjs} +1 -1
- package/dist/{validateSpec-DCiUXkMn.cjs.map → validateSpec-Bxf2WZ1Y.cjs.map} +1 -1
- package/dist/validateSpec-DL7ObLHI.js +1 -0
- package/dist/validateWorker.js +1 -1
- package/package.json +4 -4
- package/dist/validateSpec-9zbtcjcA.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./rolldown-runtime-BowF1xt-.js";
|
|
2
|
-
import { defineExtension } from "@kubb/core";
|
|
2
|
+
import { defineExtension, pascalCase } from "@kubb/core";
|
|
3
3
|
import { Diagnostics, Url, ast, childName, enumPrimitive, enumPropName, macroDedupeUnion, macroDiscriminatorEnum, macroEnumName, mergeAdjacentObjectsLazy } from "@kubb/kit";
|
|
4
4
|
import { access, realpath } from "node:fs/promises";
|
|
5
5
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
@@ -15,7 +15,7 @@ var compatibility = {
|
|
|
15
15
|
"node": ">=22.22"
|
|
16
16
|
};
|
|
17
17
|
// package.json
|
|
18
|
-
var version = "5.23.
|
|
18
|
+
var version = "5.23.3";
|
|
19
19
|
// src/constants.ts
|
|
20
20
|
/**
|
|
21
21
|
* Default parser options applied when no explicit options are provided.
|
|
@@ -264,37 +264,6 @@ function createStore({ weak, max } = {}) {
|
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
266
|
memo.create = createStore;
|
|
267
|
-
// ../../internals/utils/src/casing.ts
|
|
268
|
-
/**
|
|
269
|
-
* Shared implementation for camelCase and PascalCase conversion.
|
|
270
|
-
* Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
|
|
271
|
-
* and capitalizes each word according to `pascal`.
|
|
272
|
-
*
|
|
273
|
-
* When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
|
|
274
|
-
*/
|
|
275
|
-
function convert(text, pascal) {
|
|
276
|
-
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) => {
|
|
277
|
-
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
278
|
-
return (i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()) + word.slice(1);
|
|
279
|
-
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
280
|
-
}
|
|
281
|
-
const cache = memo.create({ max: 1e5 });
|
|
282
|
-
function toCamelOrPascal(text, pascal) {
|
|
283
|
-
const key = `${pascal ? "P" : "c"}${text}`;
|
|
284
|
-
return memo(cache, key, () => convert(text, pascal));
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Converts `text` to PascalCase.
|
|
288
|
-
*
|
|
289
|
-
* @example Word boundaries
|
|
290
|
-
* `pascalCase('hello-world') // 'HelloWorld'`
|
|
291
|
-
*
|
|
292
|
-
* @example With a suffix
|
|
293
|
-
* `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`
|
|
294
|
-
*/
|
|
295
|
-
function pascalCase(text, { prefix = "", suffix = "" } = {}) {
|
|
296
|
-
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true);
|
|
297
|
-
}
|
|
298
267
|
// ../../internals/utils/src/errors.ts
|
|
299
268
|
/**
|
|
300
269
|
* Coerces an unknown thrown value to an `Error` instance.
|
|
@@ -1306,7 +1275,7 @@ async function validateDocument(document, { throwOnError = false } = {}) {
|
|
|
1306
1275
|
return;
|
|
1307
1276
|
}
|
|
1308
1277
|
if (!throwOnError) {
|
|
1309
|
-
const { validateSpec } = await import("./validateSpec-
|
|
1278
|
+
const { validateSpec } = await import("./validateSpec-DL7ObLHI.js");
|
|
1310
1279
|
return reportResult(await validateSpec(structuredClone(document)));
|
|
1311
1280
|
}
|
|
1312
1281
|
const { compileErrors, validate } = await import("@readme/openapi-parser");
|