@kubb/core 2.6.7 → 2.7.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.
Files changed (75) hide show
  1. package/dist/{chunk-6453B5D6.js → chunk-77TYOFGF.js} +13 -5
  2. package/dist/chunk-77TYOFGF.js.map +1 -0
  3. package/dist/{chunk-VCS7BATE.js → chunk-AHK6WOW6.js} +10 -5
  4. package/dist/chunk-AHK6WOW6.js.map +1 -0
  5. package/dist/{chunk-AMVMOCJ4.cjs → chunk-AWUFUNOJ.cjs} +23 -22
  6. package/dist/{chunk-Q5OJPP57.js → chunk-BHNAGXM3.js} +59 -23
  7. package/dist/chunk-BHNAGXM3.js.map +1 -0
  8. package/dist/{chunk-M5H5RXTY.cjs → chunk-CUO3T7RA.cjs} +12 -9
  9. package/dist/{chunk-2JNTDAI2.cjs → chunk-DJLNT4KC.cjs} +17 -17
  10. package/dist/{chunk-2JNTDAI2.cjs.map → chunk-DJLNT4KC.cjs.map} +1 -1
  11. package/dist/chunk-EXBYWEC2.cjs +19 -0
  12. package/dist/{chunk-LVTR4JV4.cjs → chunk-FNHECX2X.cjs} +303 -298
  13. package/dist/chunk-FNHECX2X.cjs.map +1 -0
  14. package/dist/{chunk-WCUXF325.cjs → chunk-GNWOOGXA.cjs} +8 -7
  15. package/dist/{chunk-WDKUUZXN.cjs → chunk-IXCRUQPC.cjs} +21 -17
  16. package/dist/{chunk-HTCJOTLL.js → chunk-J2ES4PYI.js} +11 -7
  17. package/dist/chunk-J2ES4PYI.js.map +1 -0
  18. package/dist/{chunk-QDUQWRFO.js → chunk-JPSCPXBD.js} +8 -4
  19. package/dist/chunk-JPSCPXBD.js.map +1 -0
  20. package/dist/{chunk-YNFGR7GL.js → chunk-L3XMZMJ5.js} +10 -4
  21. package/dist/chunk-L3XMZMJ5.js.map +1 -0
  22. package/dist/chunk-SEATGNQM.js +15 -0
  23. package/dist/chunk-SEATGNQM.js.map +1 -0
  24. package/dist/{chunk-DUZFWQUE.js → chunk-SV7GUBBD.js} +13 -8
  25. package/dist/chunk-SV7GUBBD.js.map +1 -0
  26. package/dist/{chunk-E4QOZYOP.js → chunk-WRGVBPK2.js} +24 -10
  27. package/dist/chunk-WRGVBPK2.js.map +1 -0
  28. package/dist/{chunk-PHI4BK5K.cjs → chunk-X2JM3GAC.cjs} +162 -124
  29. package/dist/{chunk-7LKI2367.js → chunk-XDO5ZSKZ.js} +12 -7
  30. package/dist/chunk-XDO5ZSKZ.js.map +1 -0
  31. package/dist/{chunk-JWYPCGK5.cjs → chunk-XXN4BH6X.cjs} +14 -13
  32. package/dist/{chunk-KRX65PCH.cjs → chunk-ZJ6GI35A.cjs} +32 -29
  33. package/dist/fs.cjs +21 -28
  34. package/dist/fs.js +21 -5
  35. package/dist/fs.js.map +1 -1
  36. package/dist/index.cjs +189 -189
  37. package/dist/index.d.cts +5 -1
  38. package/dist/index.d.ts +5 -1
  39. package/dist/index.js +61 -19
  40. package/dist/index.js.map +1 -1
  41. package/dist/logger.cjs +14 -25
  42. package/dist/logger.js +14 -4
  43. package/dist/logger.js.map +1 -1
  44. package/dist/mocks.cjs +14 -12
  45. package/dist/mocks.js +15 -11
  46. package/dist/mocks.js.map +1 -1
  47. package/dist/transformers.cjs +40 -54
  48. package/dist/transformers.js +30 -8
  49. package/dist/transformers.js.map +1 -1
  50. package/dist/utils.cjs +34 -36
  51. package/dist/utils.js +25 -8
  52. package/dist/utils.js.map +1 -1
  53. package/package.json +5 -5
  54. package/src/FileManager.ts +14 -4
  55. package/dist/chunk-6453B5D6.js.map +0 -1
  56. package/dist/chunk-7LKI2367.js.map +0 -1
  57. package/dist/chunk-DUZFWQUE.js.map +0 -1
  58. package/dist/chunk-EFAVSUDO.cjs +0 -15
  59. package/dist/chunk-HTCJOTLL.js.map +0 -1
  60. package/dist/chunk-KRX65PCH.cjs.map +0 -1
  61. package/dist/chunk-LVTR4JV4.cjs.map +0 -1
  62. package/dist/chunk-Q5OJPP57.js.map +0 -1
  63. package/dist/chunk-VCS7BATE.js.map +0 -1
  64. package/dist/chunk-WCUXF325.cjs.map +0 -1
  65. package/dist/chunk-YFNYSIDY.js +0 -12
  66. package/dist/chunk-YFNYSIDY.js.map +0 -1
  67. package/dist/chunk-YNFGR7GL.js.map +0 -1
  68. /package/dist/{chunk-AMVMOCJ4.cjs.map → chunk-AWUFUNOJ.cjs.map} +0 -0
  69. /package/dist/{chunk-M5H5RXTY.cjs.map → chunk-CUO3T7RA.cjs.map} +0 -0
  70. /package/dist/{chunk-EFAVSUDO.cjs.map → chunk-EXBYWEC2.cjs.map} +0 -0
  71. /package/dist/{chunk-QDUQWRFO.js.map → chunk-GNWOOGXA.cjs.map} +0 -0
  72. /package/dist/{chunk-WDKUUZXN.cjs.map → chunk-IXCRUQPC.cjs.map} +0 -0
  73. /package/dist/{chunk-PHI4BK5K.cjs.map → chunk-X2JM3GAC.cjs.map} +0 -0
  74. /package/dist/{chunk-JWYPCGK5.cjs.map → chunk-XXN4BH6X.cjs.map} +0 -0
  75. /package/dist/{chunk-E4QOZYOP.js.map → chunk-ZJ6GI35A.cjs.map} +0 -0
@@ -49,12 +49,20 @@ var __privateMethod = (obj, member, method) => {
49
49
  return method;
50
50
  };
51
51
 
52
- // ../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.42.3_ts-node@10.9.2_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js
52
+ // ../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.42.3_ts-node@10.9.2_typescript@5.4.2/node_modules/tsup/assets/esm_shims.js
53
53
  var init_esm_shims = __esm({
54
- "../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.42.3_ts-node@10.9.2_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js"() {
54
+ "../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.42.3_ts-node@10.9.2_typescript@5.4.2/node_modules/tsup/assets/esm_shims.js"() {
55
+ "use strict";
55
56
  }
56
57
  });
57
58
 
58
- export { __commonJS, __privateAdd, __privateGet, __privateMethod, __privateSet, __toESM, init_esm_shims };
59
- //# sourceMappingURL=out.js.map
60
- //# sourceMappingURL=chunk-6453B5D6.js.map
59
+ export {
60
+ __commonJS,
61
+ __toESM,
62
+ __privateGet,
63
+ __privateAdd,
64
+ __privateSet,
65
+ __privateMethod,
66
+ init_esm_shims
67
+ };
68
+ //# sourceMappingURL=chunk-77TYOFGF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.42.3_ts-node@10.9.2_typescript@5.4.2/node_modules/tsup/assets/esm_shims.js"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
@@ -1,5 +1,9 @@
1
- import { camelCase } from './chunk-DUZFWQUE.js';
2
- import { init_esm_shims } from './chunk-6453B5D6.js';
1
+ import {
2
+ camelCase
3
+ } from "./chunk-SV7GUBBD.js";
4
+ import {
5
+ init_esm_shims
6
+ } from "./chunk-77TYOFGF.js";
3
7
 
4
8
  // src/utils/URLPath.ts
5
9
  init_esm_shims();
@@ -99,6 +103,7 @@ var URLPath = class {
99
103
  }
100
104
  };
101
105
 
102
- export { URLPath };
103
- //# sourceMappingURL=out.js.map
104
- //# sourceMappingURL=chunk-VCS7BATE.js.map
106
+ export {
107
+ URLPath
108
+ };
109
+ //# sourceMappingURL=chunk-AHK6WOW6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/URLPath.ts"],"sourcesContent":["import { camelCase } from '../transformers/casing.ts'\n\nexport type URLObject = {\n url: string\n params?: Record<string, string>\n}\n\ntype ObjectOptions = {\n type?: 'path' | 'template'\n replacer?: (pathParam: string) => string\n stringify?: boolean\n}\n\nexport class URLPath {\n path: string\n\n constructor(path: string) {\n this.path = path\n\n return this\n }\n\n /**\n * Convert Swagger path to URLPath(syntax of Express)\n * @example /pet/{petId} => /pet/:petId\n */\n get URL(): string {\n return this.toURLPath()\n }\n get isURL(): boolean {\n try {\n const url = new URL(this.path)\n if (url?.href) {\n return true\n }\n } catch (error) {\n return false\n }\n return false\n }\n\n /**\n * Convert Swagger path to template literals/ template strings(camelcase)\n * @example /pet/{petId} => `/pet/${petId}`\n * @example /account/monetary-accountID => `/account/${monetaryAccountId}`\n * @example /account/userID => `/account/${userId}`\n */\n get template(): string {\n return this.toTemplateString()\n }\n get object(): URLObject | string {\n return this.toObject()\n }\n get params(): Record<string, string> | undefined {\n return this.getParams()\n }\n\n toObject({ type = 'path', replacer, stringify }: ObjectOptions = {}): URLObject | string {\n const object = {\n url: type === 'path' ? this.toURLPath() : this.toTemplateString(replacer),\n params: this.getParams(),\n }\n\n if (stringify) {\n if (type === 'template') {\n return JSON.stringify(object).replaceAll(\"'\", '').replaceAll(`\"`, '')\n }\n\n if (object.params) {\n return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll(\"'\", '').replaceAll(`\"`, '')} }`\n }\n\n return `{ url: '${object.url}' }`\n }\n\n return object\n }\n\n /**\n * Convert Swagger path to template literals/ template strings(camelcase)\n * @example /pet/{petId} => `/pet/${petId}`\n * @example /account/monetary-accountID => `/account/${monetaryAccountId}`\n * @example /account/userID => `/account/${userId}`\n */\n toTemplateString(replacer?: (pathParam: string) => string): string {\n const regex = /{(\\w|-)*}/g\n const found = this.path.match(regex)\n let newPath = this.path.replaceAll('{', '${')\n\n if (found) {\n newPath = found.reduce((prev, curr) => {\n const pathParam = replacer\n ? replacer(camelCase(curr))\n : camelCase(curr)\n const replacement = `\\${${pathParam}}`\n\n return prev.replace(curr, replacement)\n }, this.path)\n }\n\n return `\\`${newPath}\\``\n }\n\n getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined {\n const regex = /{(\\w|-)*}/g\n const found = this.path.match(regex)\n\n if (!found) {\n return undefined\n }\n\n const params: Record<string, string> = {}\n found.forEach((item) => {\n item = item.replaceAll('{', '').replaceAll('}', '')\n\n const pathParam = replacer\n ? replacer(camelCase(item))\n : camelCase(item)\n\n params[pathParam] = pathParam\n }, this.path)\n\n return params\n }\n\n /**\n * Convert Swagger path to URLPath(syntax of Express)\n * @example /pet/{petId} => /pet/:petId\n */\n toURLPath(): string {\n return this.path.replaceAll('{', ':').replaceAll('}', '')\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAaO,IAAM,UAAN,MAAc;AAAA,EAGnB,YAAY,MAAc;AACxB,SAAK,OAAO;AAEZ,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,MAAc;AAChB,WAAO,KAAK,UAAU;AAAA,EACxB;AAAA,EACA,IAAI,QAAiB;AACnB,QAAI;AACF,YAAM,MAAM,IAAI,IAAI,KAAK,IAAI;AAC7B,UAAI,KAAK,MAAM;AACb,eAAO;AAAA,MACT;AAAA,IACF,SAAS,OAAO;AACd,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAI,WAAmB;AACrB,WAAO,KAAK,iBAAiB;AAAA,EAC/B;AAAA,EACA,IAAI,SAA6B;AAC/B,WAAO,KAAK,SAAS;AAAA,EACvB;AAAA,EACA,IAAI,SAA6C;AAC/C,WAAO,KAAK,UAAU;AAAA,EACxB;AAAA,EAEA,SAAS,EAAE,OAAO,QAAQ,UAAU,UAAU,IAAmB,CAAC,GAAuB;AACvF,UAAM,SAAS;AAAA,MACb,KAAK,SAAS,SAAS,KAAK,UAAU,IAAI,KAAK,iBAAiB,QAAQ;AAAA,MACxE,QAAQ,KAAK,UAAU;AAAA,IACzB;AAEA,QAAI,WAAW;AACb,UAAI,SAAS,YAAY;AACvB,eAAO,KAAK,UAAU,MAAM,EAAE,WAAW,KAAK,EAAE,EAAE,WAAW,KAAK,EAAE;AAAA,MACtE;AAEA,UAAI,OAAO,QAAQ;AACjB,eAAO,WAAW,OAAO,GAAG,cAAc,KAAK,UAAU,OAAO,MAAM,EAAE,WAAW,KAAK,EAAE,EAAE,WAAW,KAAK,EAAE,CAAC;AAAA,MACjH;AAEA,aAAO,WAAW,OAAO,GAAG;AAAA,IAC9B;AAEA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,iBAAiB,UAAkD;AACjE,UAAM,QAAQ;AACd,UAAM,QAAQ,KAAK,KAAK,MAAM,KAAK;AACnC,QAAI,UAAU,KAAK,KAAK,WAAW,KAAK,IAAI;AAE5C,QAAI,OAAO;AACT,gBAAU,MAAM,OAAO,CAAC,MAAM,SAAS;AACrC,cAAM,YAAY,WACd,SAAS,UAAU,IAAI,CAAC,IACxB,UAAU,IAAI;AAClB,cAAM,cAAc,MAAM,SAAS;AAEnC,eAAO,KAAK,QAAQ,MAAM,WAAW;AAAA,MACvC,GAAG,KAAK,IAAI;AAAA,IACd;AAEA,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAEA,UAAU,UAA8E;AACtF,UAAM,QAAQ;AACd,UAAM,QAAQ,KAAK,KAAK,MAAM,KAAK;AAEnC,QAAI,CAAC,OAAO;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAiC,CAAC;AACxC,UAAM,QAAQ,CAAC,SAAS;AACtB,aAAO,KAAK,WAAW,KAAK,EAAE,EAAE,WAAW,KAAK,EAAE;AAElD,YAAM,YAAY,WACd,SAAS,UAAU,IAAI,CAAC,IACxB,UAAU,IAAI;AAElB,aAAO,SAAS,IAAI;AAAA,IACtB,GAAG,KAAK,IAAI;AAEZ,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAoB;AAClB,WAAO,KAAK,KAAK,WAAW,KAAK,GAAG,EAAE,WAAW,KAAK,EAAE;AAAA,EAC1D;AACF;","names":[]}
@@ -1,12 +1,12 @@
1
- 'use strict';
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var chunk2JNTDAI2_cjs = require('./chunk-2JNTDAI2.cjs');
3
+ var _chunkDJLNT4KCcjs = require('./chunk-DJLNT4KC.cjs');
4
4
 
5
5
  // src/transformers/casing.ts
6
- chunk2JNTDAI2_cjs.init_cjs_shims();
6
+ _chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
7
7
 
8
8
  // ../../node_modules/.pnpm/change-case@5.4.3/node_modules/change-case/dist/index.js
9
- chunk2JNTDAI2_cjs.init_cjs_shims();
9
+ _chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
10
10
  var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
11
11
  var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
12
12
  var SPLIT_SEPARATE_NUMBER_RE = /(\d)\p{Ll}|(\p{L})\d/u;
@@ -33,7 +33,7 @@ function splitSeparateNumbers(value) {
33
33
  const word = words[i];
34
34
  const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);
35
35
  if (match) {
36
- const offset = match.index + (match[1] ?? match[2]).length;
36
+ const offset = match.index + (_nullishCoalesce(match[1], () => ( match[2]))).length;
37
37
  words.splice(i, 1, word.slice(0, offset), word.slice(offset));
38
38
  }
39
39
  }
@@ -41,25 +41,25 @@ function splitSeparateNumbers(value) {
41
41
  }
42
42
  function noCase(input, options) {
43
43
  const [prefix, words, suffix] = splitPrefixSuffix(input, options);
44
- return prefix + words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? " ") + suffix;
44
+ return prefix + words.map(lowerFactory(_optionalChain([options, 'optionalAccess', _ => _.locale]))).join(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _2 => _2.delimiter]), () => ( " "))) + suffix;
45
45
  }
46
46
  function camelCase(input, options) {
47
47
  const [prefix, words, suffix] = splitPrefixSuffix(input, options);
48
- const lower = lowerFactory(options?.locale);
49
- const upper = upperFactory(options?.locale);
50
- const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
48
+ const lower = lowerFactory(_optionalChain([options, 'optionalAccess', _3 => _3.locale]));
49
+ const upper = upperFactory(_optionalChain([options, 'optionalAccess', _4 => _4.locale]));
50
+ const transform = _optionalChain([options, 'optionalAccess', _5 => _5.mergeAmbiguousCharacters]) ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
51
51
  return prefix + words.map((word, index) => {
52
52
  if (index === 0)
53
53
  return lower(word);
54
54
  return transform(word, index);
55
- }).join(options?.delimiter ?? "") + suffix;
55
+ }).join(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _6 => _6.delimiter]), () => ( ""))) + suffix;
56
56
  }
57
57
  function pascalCase(input, options) {
58
58
  const [prefix, words, suffix] = splitPrefixSuffix(input, options);
59
- const lower = lowerFactory(options?.locale);
60
- const upper = upperFactory(options?.locale);
61
- const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
62
- return prefix + words.map(transform).join(options?.delimiter ?? "") + suffix;
59
+ const lower = lowerFactory(_optionalChain([options, 'optionalAccess', _7 => _7.locale]));
60
+ const upper = upperFactory(_optionalChain([options, 'optionalAccess', _8 => _8.locale]));
61
+ const transform = _optionalChain([options, 'optionalAccess', _9 => _9.mergeAmbiguousCharacters]) ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
62
+ return prefix + words.map(transform).join(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _10 => _10.delimiter]), () => ( ""))) + suffix;
63
63
  }
64
64
  function pathCase(input, options) {
65
65
  return noCase(input, { delimiter: "/", ...options });
@@ -81,9 +81,9 @@ function pascalCaseTransformFactory(lower, upper) {
81
81
  };
82
82
  }
83
83
  function splitPrefixSuffix(input, options = {}) {
84
- const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);
85
- const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
86
- const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
84
+ const splitFn = _nullishCoalesce(options.split, () => ( (options.separateNumbers ? splitSeparateNumbers : split)));
85
+ const prefixCharacters = _nullishCoalesce(options.prefixCharacters, () => ( DEFAULT_PREFIX_SUFFIX_CHARACTERS));
86
+ const suffixCharacters = _nullishCoalesce(options.suffixCharacters, () => ( DEFAULT_PREFIX_SUFFIX_CHARACTERS));
87
87
  let prefixIndex = 0;
88
88
  let suffixIndex = input.length;
89
89
  while (prefixIndex < input.length) {
@@ -129,8 +129,9 @@ function pathCase2(text, { isFile, prefix = "", suffix = "" } = {}) {
129
129
  return pathCase(`${prefix} ${text} ${suffix}`, { delimiter: "" });
130
130
  }
131
131
 
132
- exports.camelCase = camelCase2;
133
- exports.pascalCase = pascalCase2;
134
- exports.pathCase = pathCase2;
135
- //# sourceMappingURL=out.js.map
136
- //# sourceMappingURL=chunk-AMVMOCJ4.cjs.map
132
+
133
+
134
+
135
+
136
+ exports.camelCase = camelCase2; exports.pascalCase = pascalCase2; exports.pathCase = pathCase2;
137
+ //# sourceMappingURL=chunk-AWUFUNOJ.cjs.map
@@ -1,20 +1,36 @@
1
- import { transformReservedWord, trimExtName, searchAndReplace } from './chunk-YNFGR7GL.js';
2
- import { setUniqueName } from './chunk-QDUQWRFO.js';
3
- import { EventEmitter, LogLevel } from './chunk-E4QOZYOP.js';
4
- import { read, getRelativePath } from './chunk-7LKI2367.js';
5
- import { write } from './chunk-HTCJOTLL.js';
6
- import { __commonJS, init_esm_shims, __toESM, __privateAdd, __privateSet, __privateGet, __privateMethod } from './chunk-6453B5D6.js';
7
- import crypto from 'crypto';
8
- import path, { resolve, extname } from 'path';
9
- import { print, getExports } from '@kubb/parser';
10
- import * as factory from '@kubb/parser/factory';
11
- import { orderBy } from 'natural-orderby';
12
- import PQueue from 'p-queue';
13
- import dirTree from 'directory-tree';
1
+ import {
2
+ searchAndReplace,
3
+ transformReservedWord,
4
+ trimExtName
5
+ } from "./chunk-L3XMZMJ5.js";
6
+ import {
7
+ setUniqueName
8
+ } from "./chunk-JPSCPXBD.js";
9
+ import {
10
+ EventEmitter,
11
+ LogLevel
12
+ } from "./chunk-WRGVBPK2.js";
13
+ import {
14
+ getRelativePath,
15
+ read
16
+ } from "./chunk-XDO5ZSKZ.js";
17
+ import {
18
+ write
19
+ } from "./chunk-J2ES4PYI.js";
20
+ import {
21
+ __commonJS,
22
+ __privateAdd,
23
+ __privateGet,
24
+ __privateMethod,
25
+ __privateSet,
26
+ __toESM,
27
+ init_esm_shims
28
+ } from "./chunk-77TYOFGF.js";
14
29
 
15
30
  // ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
16
31
  var require_lodash = __commonJS({
17
32
  "../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
33
+ "use strict";
18
34
  init_esm_shims();
19
35
  var LARGE_ARRAY_SIZE = 200;
20
36
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
@@ -717,12 +733,21 @@ var require_lodash = __commonJS({
717
733
  // src/FileManager.ts
718
734
  init_esm_shims();
719
735
  var import_lodash = __toESM(require_lodash(), 1);
736
+ import crypto from "crypto";
737
+ import { extname, resolve } from "path";
738
+ import { print } from "@kubb/parser";
739
+ import * as factory from "@kubb/parser/factory";
740
+ import { orderBy } from "natural-orderby";
741
+ import PQueue from "p-queue";
720
742
 
721
743
  // src/BarrelManager.ts
722
744
  init_esm_shims();
745
+ import { getExports } from "@kubb/parser";
746
+ import path from "path";
723
747
 
724
748
  // src/utils/TreeNode.ts
725
749
  init_esm_shims();
750
+ import dirTree from "directory-tree";
726
751
  var TreeNode = class _TreeNode {
727
752
  constructor(data, parent) {
728
753
  this.children = [];
@@ -1037,7 +1062,7 @@ var _FileManager = class _FileManager {
1037
1062
  static get extensions() {
1038
1063
  return [".js", ".ts", ".tsx"];
1039
1064
  }
1040
- static isExtensionAllowed(baseName) {
1065
+ static isJavascript(baseName) {
1041
1066
  return _FileManager.extensions.some((extension) => baseName.endsWith(extension));
1042
1067
  }
1043
1068
  };
@@ -1104,11 +1129,11 @@ ${file.source}` : "",
1104
1129
  }, []);
1105
1130
  }
1106
1131
  function getSource(file) {
1107
- if (!FileManager.isExtensionAllowed(file.baseName)) {
1132
+ if (file.language ? !["typescript", "javascript"].includes(file.language) : !FileManager.isJavascript(file.baseName)) {
1108
1133
  return file.source;
1109
1134
  }
1110
1135
  const exports = file.exports ? combineExports(file.exports) : [];
1111
- const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
1136
+ const imports = file.imports && file.source ? combineImports(file.imports, exports, file.source) : [];
1112
1137
  const importNodes = imports.filter((item) => {
1113
1138
  return item.path !== trimExtName(file.path);
1114
1139
  }).map((item) => {
@@ -1126,7 +1151,8 @@ function getSource(file) {
1126
1151
  asAlias: item.asAlias
1127
1152
  })
1128
1153
  );
1129
- return [print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
1154
+ const source = [print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
1155
+ return print([], { source, noEmitHelpers: false });
1130
1156
  }
1131
1157
  function combineExports(exports) {
1132
1158
  const combinedExports = orderBy(exports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
@@ -1237,6 +1263,7 @@ var ValidationPluginError = class extends Error {
1237
1263
 
1238
1264
  // src/plugin.ts
1239
1265
  init_esm_shims();
1266
+ import path2 from "path";
1240
1267
 
1241
1268
  // src/utils/cache.ts
1242
1269
  init_esm_shims();
@@ -1307,8 +1334,8 @@ var definePlugin = createPlugin((options) => {
1307
1334
  };
1308
1335
  },
1309
1336
  resolvePath(baseName) {
1310
- const root = path.resolve(this.config.root, this.config.output.path);
1311
- return path.resolve(root, baseName);
1337
+ const root = path2.resolve(this.config.root, this.config.output.path);
1338
+ return path2.resolve(root, baseName);
1312
1339
  },
1313
1340
  resolveName(name) {
1314
1341
  return name;
@@ -1385,6 +1412,7 @@ function isPromiseRejectedResult(result) {
1385
1412
 
1386
1413
  // src/PluginManager.ts
1387
1414
  init_esm_shims();
1415
+ import PQueue2 from "p-queue";
1388
1416
  var _core, _usedPluginNames, _promiseManager, _getSortedPlugins, getSortedPlugins_fn, _addExecutedToCallStack, addExecutedToCallStack_fn, _execute, execute_fn, _executeSync, executeSync_fn, _catcher, catcher_fn, _parse, parse_fn;
1389
1417
  var PluginManager = class {
1390
1418
  constructor(config, options) {
@@ -1464,7 +1492,7 @@ Falling back on the first item.
1464
1492
  };
1465
1493
  this.config = config;
1466
1494
  this.logger = options.logger;
1467
- this.queue = new PQueue({ concurrency: 1 });
1495
+ this.queue = new PQueue2({ concurrency: 1 });
1468
1496
  this.fileManager = new FileManager({ task: options.task, queue: this.queue });
1469
1497
  __privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
1470
1498
  const plugins = config.plugins || [];
@@ -1825,6 +1853,14 @@ parse_fn = function(plugin, pluginManager, context) {
1825
1853
  };
1826
1854
  };
1827
1855
 
1828
- export { FileManager, KubbFile, PluginManager, PromiseManager, Warning, createPlugin, isPromise, pluginName };
1829
- //# sourceMappingURL=out.js.map
1830
- //# sourceMappingURL=chunk-Q5OJPP57.js.map
1856
+ export {
1857
+ KubbFile,
1858
+ FileManager,
1859
+ Warning,
1860
+ createPlugin,
1861
+ pluginName,
1862
+ PromiseManager,
1863
+ isPromise,
1864
+ PluginManager
1865
+ };
1866
+ //# sourceMappingURL=chunk-BHNAGXM3.js.map