@kubb/plugin-ts 5.0.0-alpha.22 → 5.0.0-alpha.24

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.
Files changed (66) hide show
  1. package/dist/index.cjs +1680 -49
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +529 -4
  4. package/dist/index.js +1653 -52
  5. package/dist/index.js.map +1 -1
  6. package/package.json +3 -42
  7. package/src/components/Enum.tsx +2 -7
  8. package/src/components/Type.tsx +11 -5
  9. package/src/generators/typeGenerator.tsx +36 -24
  10. package/src/generators/typeGeneratorLegacy.tsx +28 -38
  11. package/src/index.ts +13 -1
  12. package/src/plugin.ts +42 -23
  13. package/src/presets.ts +16 -34
  14. package/src/printers/functionPrinter.ts +194 -0
  15. package/src/printers/printerTs.ts +23 -7
  16. package/src/resolvers/resolverTs.ts +10 -47
  17. package/src/resolvers/resolverTsLegacy.ts +4 -31
  18. package/src/types.ts +169 -254
  19. package/src/utils.ts +103 -0
  20. package/dist/Type-Bf8raoQX.cjs +0 -124
  21. package/dist/Type-Bf8raoQX.cjs.map +0 -1
  22. package/dist/Type-BpXxT4l_.js +0 -113
  23. package/dist/Type-BpXxT4l_.js.map +0 -1
  24. package/dist/builderTs-COUg3xtQ.cjs +0 -135
  25. package/dist/builderTs-COUg3xtQ.cjs.map +0 -1
  26. package/dist/builderTs-DPpkJKd1.js +0 -131
  27. package/dist/builderTs-DPpkJKd1.js.map +0 -1
  28. package/dist/builders.cjs +0 -3
  29. package/dist/builders.d.ts +0 -23
  30. package/dist/builders.js +0 -2
  31. package/dist/casing-BJHFg-zZ.js +0 -84
  32. package/dist/casing-BJHFg-zZ.js.map +0 -1
  33. package/dist/casing-DHfdqpLi.cjs +0 -107
  34. package/dist/casing-DHfdqpLi.cjs.map +0 -1
  35. package/dist/chunk-ByKO4r7w.cjs +0 -38
  36. package/dist/components.cjs +0 -4
  37. package/dist/components.d.ts +0 -71
  38. package/dist/components.js +0 -2
  39. package/dist/generators-DFDut8o-.js +0 -555
  40. package/dist/generators-DFDut8o-.js.map +0 -1
  41. package/dist/generators-DKd7MYbx.cjs +0 -567
  42. package/dist/generators-DKd7MYbx.cjs.map +0 -1
  43. package/dist/generators.cjs +0 -4
  44. package/dist/generators.d.ts +0 -12
  45. package/dist/generators.js +0 -2
  46. package/dist/printerTs-BcHudagv.cjs +0 -594
  47. package/dist/printerTs-BcHudagv.cjs.map +0 -1
  48. package/dist/printerTs-CMBCOuqd.js +0 -558
  49. package/dist/printerTs-CMBCOuqd.js.map +0 -1
  50. package/dist/printers.cjs +0 -3
  51. package/dist/printers.d.ts +0 -81
  52. package/dist/printers.js +0 -2
  53. package/dist/resolverTsLegacy-CPiqqsO6.js +0 -185
  54. package/dist/resolverTsLegacy-CPiqqsO6.js.map +0 -1
  55. package/dist/resolverTsLegacy-CuR9XbKk.cjs +0 -196
  56. package/dist/resolverTsLegacy-CuR9XbKk.cjs.map +0 -1
  57. package/dist/resolvers.cjs +0 -4
  58. package/dist/resolvers.d.ts +0 -52
  59. package/dist/resolvers.js +0 -2
  60. package/dist/types-CRtcZOCz.d.ts +0 -374
  61. package/src/builders/builderTs.ts +0 -107
  62. package/src/builders/index.ts +0 -1
  63. package/src/components/index.ts +0 -2
  64. package/src/generators/index.ts +0 -2
  65. package/src/printers/index.ts +0 -1
  66. package/src/resolvers/index.ts +0 -2
@@ -1,84 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- //#region ../../internals/utils/src/casing.ts
3
- /**
4
- * Shared implementation for camelCase and PascalCase conversion.
5
- * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
6
- * and capitalizes each word according to `pascal`.
7
- *
8
- * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
9
- */
10
- function toCamelOrPascal(text, pascal) {
11
- 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) => {
12
- if (word.length > 1 && word === word.toUpperCase()) return word;
13
- if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1);
14
- return word.charAt(0).toUpperCase() + word.slice(1);
15
- }).join("").replace(/[^a-zA-Z0-9]/g, "");
16
- }
17
- /**
18
- * Splits `text` on `.` and applies `transformPart` to each segment.
19
- * The last segment receives `isLast = true`, all earlier segments receive `false`.
20
- * Segments are joined with `/` to form a file path.
21
- *
22
- * Only splits on dots followed by a letter so that version numbers
23
- * embedded in operationIds (e.g. `v2025.0`) are kept intact.
24
- */
25
- function applyToFileParts(text, transformPart) {
26
- const parts = text.split(/\.(?=[a-zA-Z])/);
27
- return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
28
- }
29
- /**
30
- * Converts `text` to camelCase.
31
- * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.
32
- *
33
- * @example
34
- * camelCase('hello-world') // 'helloWorld'
35
- * camelCase('pet.petId', { isFile: true }) // 'pet/petId'
36
- */
37
- function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
38
- if (isFile) return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? {
39
- prefix,
40
- suffix
41
- } : {}));
42
- return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
43
- }
44
- /**
45
- * Converts `text` to PascalCase.
46
- * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.
47
- *
48
- * @example
49
- * pascalCase('hello-world') // 'HelloWorld'
50
- * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'
51
- */
52
- function pascalCase(text, { isFile, prefix = "", suffix = "" } = {}) {
53
- if (isFile) return applyToFileParts(text, (part, isLast) => isLast ? pascalCase(part, {
54
- prefix,
55
- suffix
56
- }) : camelCase(part));
57
- return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true);
58
- }
59
- /**
60
- * Converts `text` to snake_case.
61
- *
62
- * @example
63
- * snakeCase('helloWorld') // 'hello_world'
64
- * snakeCase('Hello-World') // 'hello_world'
65
- */
66
- function snakeCase(text, { prefix = "", suffix = "" } = {}) {
67
- return `${prefix} ${text} ${suffix}`.trim().replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s\-.]+/g, "_").replace(/[^a-zA-Z0-9_]/g, "").toLowerCase().split("_").filter(Boolean).join("_");
68
- }
69
- /**
70
- * Converts `text` to SCREAMING_SNAKE_CASE.
71
- *
72
- * @example
73
- * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'
74
- */
75
- function screamingSnakeCase(text, { prefix = "", suffix = "" } = {}) {
76
- return snakeCase(text, {
77
- prefix,
78
- suffix
79
- }).toUpperCase();
80
- }
81
- //#endregion
82
- export { snakeCase as i, pascalCase as n, screamingSnakeCase as r, camelCase as t };
83
-
84
- //# sourceMappingURL=casing-BJHFg-zZ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"casing-BJHFg-zZ.js","names":[],"sources":["../../../internals/utils/src/casing.ts"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAS,gBAAgB,MAAc,QAAyB;AAS9D,QARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ,gBAAgB,QAAQ,CAEV,MAAM,gBAAgB,CAAC,OAAO,QAAQ,CAG5D,KAAK,MAAM,MAAM;AAEhB,MADiB,KAAK,SAAS,KAAK,SAAS,KAAK,aAAa,CACjD,QAAO;AACrB,MAAI,MAAM,KAAK,CAAC,OAAQ,QAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;AAC3E,SAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;GACnD,CACD,KAAK,GAAG,CACR,QAAQ,iBAAiB,GAAG;;;;;;;;;;AAWjC,SAAS,iBAAiB,MAAc,eAAkE;CACxG,MAAM,QAAQ,KAAK,MAAM,iBAAiB;AAC1C,QAAO,MAAM,KAAK,MAAM,MAAM,cAAc,MAAM,MAAM,MAAM,SAAS,EAAE,CAAC,CAAC,KAAK,IAAI;;;;;;;;;;AAWtF,SAAgB,UAAU,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,OAAgB,EAAE,EAAU;AAClG,KAAI,OACF,QAAO,iBAAiB,OAAO,MAAM,WAAW,UAAU,MAAM,SAAS;EAAE;EAAQ;EAAQ,GAAG,EAAE,CAAC,CAAC;AAGpG,QAAO,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,MAAM;;;;;;;;;;AAW9D,SAAgB,WAAW,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,OAAgB,EAAE,EAAU;AACnG,KAAI,OACF,QAAO,iBAAiB,OAAO,MAAM,WAAY,SAAS,WAAW,MAAM;EAAE;EAAQ;EAAQ,CAAC,GAAG,UAAU,KAAK,CAAE;AAGpH,QAAO,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,KAAK;;;;;;;;;AAU7D,SAAgB,UAAU,MAAc,EAAE,SAAS,IAAI,SAAS,OAAgC,EAAE,EAAU;AAE1G,QADkB,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,MAAM,CAEnD,QAAQ,mBAAmB,QAAQ,CACnC,QAAQ,aAAa,IAAI,CACzB,QAAQ,kBAAkB,GAAG,CAC7B,aAAa,CACb,MAAM,IAAI,CACV,OAAO,QAAQ,CACf,KAAK,IAAI;;;;;;;;AASd,SAAgB,mBAAmB,MAAc,EAAE,SAAS,IAAI,SAAS,OAAgC,EAAE,EAAU;AACnH,QAAO,UAAU,MAAM;EAAE;EAAQ;EAAQ,CAAC,CAAC,aAAa"}
@@ -1,107 +0,0 @@
1
- require("./chunk-ByKO4r7w.cjs");
2
- //#region ../../internals/utils/src/casing.ts
3
- /**
4
- * Shared implementation for camelCase and PascalCase conversion.
5
- * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
6
- * and capitalizes each word according to `pascal`.
7
- *
8
- * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
9
- */
10
- function toCamelOrPascal(text, pascal) {
11
- 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) => {
12
- if (word.length > 1 && word === word.toUpperCase()) return word;
13
- if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1);
14
- return word.charAt(0).toUpperCase() + word.slice(1);
15
- }).join("").replace(/[^a-zA-Z0-9]/g, "");
16
- }
17
- /**
18
- * Splits `text` on `.` and applies `transformPart` to each segment.
19
- * The last segment receives `isLast = true`, all earlier segments receive `false`.
20
- * Segments are joined with `/` to form a file path.
21
- *
22
- * Only splits on dots followed by a letter so that version numbers
23
- * embedded in operationIds (e.g. `v2025.0`) are kept intact.
24
- */
25
- function applyToFileParts(text, transformPart) {
26
- const parts = text.split(/\.(?=[a-zA-Z])/);
27
- return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
28
- }
29
- /**
30
- * Converts `text` to camelCase.
31
- * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.
32
- *
33
- * @example
34
- * camelCase('hello-world') // 'helloWorld'
35
- * camelCase('pet.petId', { isFile: true }) // 'pet/petId'
36
- */
37
- function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
38
- if (isFile) return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? {
39
- prefix,
40
- suffix
41
- } : {}));
42
- return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
43
- }
44
- /**
45
- * Converts `text` to PascalCase.
46
- * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.
47
- *
48
- * @example
49
- * pascalCase('hello-world') // 'HelloWorld'
50
- * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'
51
- */
52
- function pascalCase(text, { isFile, prefix = "", suffix = "" } = {}) {
53
- if (isFile) return applyToFileParts(text, (part, isLast) => isLast ? pascalCase(part, {
54
- prefix,
55
- suffix
56
- }) : camelCase(part));
57
- return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true);
58
- }
59
- /**
60
- * Converts `text` to snake_case.
61
- *
62
- * @example
63
- * snakeCase('helloWorld') // 'hello_world'
64
- * snakeCase('Hello-World') // 'hello_world'
65
- */
66
- function snakeCase(text, { prefix = "", suffix = "" } = {}) {
67
- return `${prefix} ${text} ${suffix}`.trim().replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s\-.]+/g, "_").replace(/[^a-zA-Z0-9_]/g, "").toLowerCase().split("_").filter(Boolean).join("_");
68
- }
69
- /**
70
- * Converts `text` to SCREAMING_SNAKE_CASE.
71
- *
72
- * @example
73
- * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'
74
- */
75
- function screamingSnakeCase(text, { prefix = "", suffix = "" } = {}) {
76
- return snakeCase(text, {
77
- prefix,
78
- suffix
79
- }).toUpperCase();
80
- }
81
- //#endregion
82
- Object.defineProperty(exports, "camelCase", {
83
- enumerable: true,
84
- get: function() {
85
- return camelCase;
86
- }
87
- });
88
- Object.defineProperty(exports, "pascalCase", {
89
- enumerable: true,
90
- get: function() {
91
- return pascalCase;
92
- }
93
- });
94
- Object.defineProperty(exports, "screamingSnakeCase", {
95
- enumerable: true,
96
- get: function() {
97
- return screamingSnakeCase;
98
- }
99
- });
100
- Object.defineProperty(exports, "snakeCase", {
101
- enumerable: true,
102
- get: function() {
103
- return snakeCase;
104
- }
105
- });
106
-
107
- //# sourceMappingURL=casing-DHfdqpLi.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"casing-DHfdqpLi.cjs","names":[],"sources":["../../../internals/utils/src/casing.ts"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAS,gBAAgB,MAAc,QAAyB;AAS9D,QARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ,gBAAgB,QAAQ,CAEV,MAAM,gBAAgB,CAAC,OAAO,QAAQ,CAG5D,KAAK,MAAM,MAAM;AAEhB,MADiB,KAAK,SAAS,KAAK,SAAS,KAAK,aAAa,CACjD,QAAO;AACrB,MAAI,MAAM,KAAK,CAAC,OAAQ,QAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;AAC3E,SAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;GACnD,CACD,KAAK,GAAG,CACR,QAAQ,iBAAiB,GAAG;;;;;;;;;;AAWjC,SAAS,iBAAiB,MAAc,eAAkE;CACxG,MAAM,QAAQ,KAAK,MAAM,iBAAiB;AAC1C,QAAO,MAAM,KAAK,MAAM,MAAM,cAAc,MAAM,MAAM,MAAM,SAAS,EAAE,CAAC,CAAC,KAAK,IAAI;;;;;;;;;;AAWtF,SAAgB,UAAU,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,OAAgB,EAAE,EAAU;AAClG,KAAI,OACF,QAAO,iBAAiB,OAAO,MAAM,WAAW,UAAU,MAAM,SAAS;EAAE;EAAQ;EAAQ,GAAG,EAAE,CAAC,CAAC;AAGpG,QAAO,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,MAAM;;;;;;;;;;AAW9D,SAAgB,WAAW,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,OAAgB,EAAE,EAAU;AACnG,KAAI,OACF,QAAO,iBAAiB,OAAO,MAAM,WAAY,SAAS,WAAW,MAAM;EAAE;EAAQ;EAAQ,CAAC,GAAG,UAAU,KAAK,CAAE;AAGpH,QAAO,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,KAAK;;;;;;;;;AAU7D,SAAgB,UAAU,MAAc,EAAE,SAAS,IAAI,SAAS,OAAgC,EAAE,EAAU;AAE1G,QADkB,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,MAAM,CAEnD,QAAQ,mBAAmB,QAAQ,CACnC,QAAQ,aAAa,IAAI,CACzB,QAAQ,kBAAkB,GAAG,CAC7B,aAAa,CACb,MAAM,IAAI,CACV,OAAO,QAAQ,CACf,KAAK,IAAI;;;;;;;;AASd,SAAgB,mBAAmB,MAAc,EAAE,SAAS,IAAI,SAAS,OAAgC,EAAE,EAAU;AACnH,QAAO,UAAU,MAAM;EAAE;EAAQ;EAAQ,CAAC,CAAC,aAAa"}
@@ -1,38 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", {
5
- value,
6
- configurable: true
7
- });
8
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
- var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __getProtoOf = Object.getPrototypeOf;
11
- var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
- key = keys[i];
15
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: ((k) => from[k]).bind(null, key),
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
- //#endregion
27
- Object.defineProperty(exports, "__name", {
28
- enumerable: true,
29
- get: function() {
30
- return __name;
31
- }
32
- });
33
- Object.defineProperty(exports, "__toESM", {
34
- enumerable: true,
35
- get: function() {
36
- return __toESM;
37
- }
38
- });
@@ -1,4 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_Type = require("./Type-Bf8raoQX.cjs");
3
- exports.Enum = require_Type.Enum;
4
- exports.Type = require_Type.Type;
@@ -1,71 +0,0 @@
1
- import { t as __name } from "./chunk--u3MIqq1.js";
2
- import { i as ResolverTs, r as PluginTs } from "./types-CRtcZOCz.js";
3
- import { EnumSchemaNode, SchemaNode } from "@kubb/ast/types";
4
- import { FabricReactNode } from "@kubb/react-fabric/types";
5
-
6
- //#region src/components/Enum.d.ts
7
- type Props$1 = {
8
- node: EnumSchemaNode;
9
- enumType: PluginTs['resolvedOptions']['enumType'];
10
- enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix'];
11
- enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing'];
12
- resolver: ResolverTs;
13
- };
14
- /**
15
- * Resolves the runtime identifier name and the TypeScript type name for an enum schema node.
16
- *
17
- * The raw `node.name` may be a YAML key such as `"enumNames.Type"` which is not a
18
- * valid TypeScript identifier. The resolver normalizes it; for inline enum
19
- * properties the adapter already emits a PascalCase+suffix name so resolution is typically a no-op.
20
- */
21
- /**
22
- * Renders the enum declaration(s) for a single named `EnumSchemaNode`.
23
- *
24
- * Depending on `enumType` this may emit:
25
- * - A runtime object (`asConst` / `asPascalConst`) plus a `typeof` type alias
26
- * - A `const enum` or plain `enum` declaration (`constEnum` / `enum`)
27
- * - A union literal type alias (`literal`)
28
- *
29
- * The emitted `File.Source` nodes carry the resolved names so that the barrel
30
- * index picks up the correct export identifiers.
31
- */
32
- declare function Enum({
33
- node,
34
- enumType,
35
- enumTypeSuffix,
36
- enumKeyCasing,
37
- resolver
38
- }: Props$1): FabricReactNode;
39
- //#endregion
40
- //#region src/components/Type.d.ts
41
- type Props = {
42
- name: string;
43
- typedName: string;
44
- node: SchemaNode;
45
- optionalType: PluginTs['resolvedOptions']['optionalType'];
46
- arrayType: PluginTs['resolvedOptions']['arrayType'];
47
- enumType: PluginTs['resolvedOptions']['enumType'];
48
- enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix'];
49
- enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing'];
50
- syntaxType: PluginTs['resolvedOptions']['syntaxType'];
51
- resolver: PluginTs['resolvedOptions']['resolver'];
52
- description?: string;
53
- keysToOmit?: string[];
54
- };
55
- declare function Type({
56
- name,
57
- typedName,
58
- node,
59
- keysToOmit,
60
- optionalType,
61
- arrayType,
62
- syntaxType,
63
- enumType,
64
- enumTypeSuffix,
65
- enumKeyCasing,
66
- description,
67
- resolver
68
- }: Props): FabricReactNode;
69
- //#endregion
70
- export { Enum, Type };
71
- //# sourceMappingURL=components.d.ts.map
@@ -1,2 +0,0 @@
1
- import { n as Enum, t as Type } from "./Type-BpXxT4l_.js";
2
- export { Enum, Type };