@kubb/fabric-core 0.6.0 → 0.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 (47) hide show
  1. package/dist/{Fabric-CEVrEuYU.d.ts → Fabric-BXYWK9V4.d.cts} +11 -59
  2. package/dist/{Fabric-CVnHPMqM.d.cts → Fabric-CDFwTDyP.d.ts} +11 -59
  3. package/dist/{defineProperty-BOlj8-IY.cjs → defineProperty-B59n8a_H.cjs} +18 -18
  4. package/dist/defineProperty-B59n8a_H.cjs.map +1 -0
  5. package/dist/{defineProperty-D2uejjT1.js → defineProperty-BMAGVqB-.js} +18 -18
  6. package/dist/defineProperty-BMAGVqB-.js.map +1 -0
  7. package/dist/index.cjs +12 -21
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +12 -21
  12. package/dist/index.js.map +1 -1
  13. package/dist/parsers/typescript.cjs +92 -8
  14. package/dist/parsers/typescript.cjs.map +1 -0
  15. package/dist/parsers/typescript.d.cts +39 -3
  16. package/dist/parsers/typescript.d.ts +39 -3
  17. package/dist/parsers/typescript.js +87 -5
  18. package/dist/parsers/typescript.js.map +1 -0
  19. package/dist/parsers.cjs +3 -5
  20. package/dist/parsers.cjs.map +1 -1
  21. package/dist/parsers.d.cts +2 -2
  22. package/dist/parsers.d.ts +2 -2
  23. package/dist/parsers.js +1 -3
  24. package/dist/parsers.js.map +1 -1
  25. package/dist/plugins.cjs +12 -12
  26. package/dist/plugins.cjs.map +1 -1
  27. package/dist/plugins.d.cts +1 -1
  28. package/dist/plugins.d.ts +1 -1
  29. package/dist/plugins.js +12 -13
  30. package/dist/plugins.js.map +1 -1
  31. package/dist/types.d.cts +1 -1
  32. package/dist/types.d.ts +1 -1
  33. package/package.json +13 -13
  34. package/src/Fabric.ts +10 -34
  35. package/src/FileManager.ts +6 -6
  36. package/src/FileProcessor.ts +4 -4
  37. package/src/plugins/barrelPlugin.ts +2 -2
  38. package/src/plugins/graphPlugin.ts +1 -1
  39. package/src/plugins/loggerPlugin.ts +9 -9
  40. package/dist/defineProperty-BOlj8-IY.cjs.map +0 -1
  41. package/dist/defineProperty-D2uejjT1.js.map +0 -1
  42. package/dist/typescriptParser-9jJzfPj-.d.ts +0 -39
  43. package/dist/typescriptParser-BLX7eX2k.js +0 -88
  44. package/dist/typescriptParser-BLX7eX2k.js.map +0 -1
  45. package/dist/typescriptParser-DCFNN4BL.d.cts +0 -39
  46. package/dist/typescriptParser-OjFZ_DeI.cjs +0 -113
  47. package/dist/typescriptParser-OjFZ_DeI.cjs.map +0 -1
@@ -279,100 +279,56 @@ interface FabricEvents {
279
279
  /**
280
280
  * Emitted when Fabric starts rendering (used with reactPlugin).
281
281
  * Provides access to the Fabric instance for render-time operations.
282
- *
283
- * @property fabric - The current Fabric instance being rendered
284
282
  */
285
- 'lifecycle:render': [{
286
- fabric: Fabric;
287
- }];
283
+ 'lifecycle:render': [fabric: Fabric];
288
284
  /**
289
285
  * Emitted once before file processing begins.
290
286
  * Provides the complete list of files that will be processed.
291
287
  * Use this to prepare for batch operations or display initial file counts.
292
- *
293
- * @property files - Array of all files queued for processing
294
288
  */
295
- 'files:processing:start': [{
296
- files: ResolvedFile[];
297
- }];
289
+ 'files:processing:start': [files: Array<ResolvedFile>];
298
290
  /**
299
291
  * Emitted when files are successfully added to the FileManager's internal cache.
300
292
  * This happens after files pass through path and name resolution.
301
293
  * Use this to track which files have been registered.
302
- *
303
- * @property files - Array of files that were just added to the cache
304
294
  */
305
- 'files:added': [{
306
- files: ResolvedFile[];
307
- }];
295
+ 'files:added': [files: Array<ResolvedFile>];
308
296
  /**
309
297
  * Emitted during file path resolution, before a file is cached.
310
298
  * Listeners can modify the file's path property to customize output location.
311
299
  * This is called for each file being added via `addFile()` or `upsertFile()`.
312
- *
313
- * @property file - The file whose path is being resolved (mutable)
314
300
  */
315
- 'file:resolve:path': [{
316
- file: File;
317
- }];
301
+ 'file:resolve:path': [file: File];
318
302
  /**
319
303
  * Emitted during file name resolution, before a file is cached.
320
304
  * Listeners can modify the file's name-related properties to customize naming.
321
305
  * This is called for each file being added via `addFile()` or `upsertFile()`.
322
- *
323
- * @property file - The file whose name is being resolved (mutable)
324
306
  */
325
- 'file:resolve:name': [{
326
- file: File;
327
- }];
307
+ 'file:resolve:name': [file: File];
328
308
  /**
329
309
  * Emitted just before files are written to disk.
330
310
  * Provides all files that will be written in this batch.
331
311
  * Use this to perform pre-write operations like creating directories.
332
- *
333
- * @property files - Array of files about to be written to disk
334
312
  */
335
- 'files:writing:start': [{
336
- files: ResolvedFile[];
337
- }];
313
+ 'files:writing:start': [files: Array<ResolvedFile>];
338
314
  /**
339
315
  * Emitted after all files have been successfully written to disk.
340
316
  * Provides all files that were written in this batch.
341
317
  * Use this for post-write operations like running formatters or reporting.
342
- *
343
- * @property files - Array of files that were written to disk
344
318
  */
345
- 'files:writing:end': [{
346
- files: ResolvedFile[];
347
- }];
319
+ 'files:writing:end': [files: Array<ResolvedFile>];
348
320
  /**
349
321
  * Emitted when an individual file starts being processed.
350
322
  * This happens for each file in the queue, before parsing.
351
323
  * Use this for per-file setup or detailed logging.
352
- *
353
- * @property file - The file starting processing
354
- * @property index - Zero-based position of this file in the queue
355
- * @property total - Total number of files to process
356
324
  */
357
- 'file:processing:start': [{
358
- file: ResolvedFile;
359
- index: number;
360
- total: number;
361
- }];
325
+ 'file:processing:start': [file: ResolvedFile, index: number, total: number];
362
326
  /**
363
327
  * Emitted when an individual file completes processing.
364
328
  * This happens after the file has been parsed and handled.
365
329
  * Use this for per-file cleanup or progress tracking.
366
- *
367
- * @property file - The file that finished processing
368
- * @property index - Zero-based position of this file in the queue
369
- * @property total - Total number of files to process
370
330
  */
371
- 'file:processing:end': [{
372
- file: ResolvedFile;
373
- index: number;
374
- total: number;
375
- }];
331
+ 'file:processing:end': [file: ResolvedFile, index: number, total: number];
376
332
  /**
377
333
  * Emitted after each file is processed, providing progress metrics.
378
334
  * This is the primary event for implementing progress bars or tracking.
@@ -395,12 +351,8 @@ interface FabricEvents {
395
351
  * Emitted once all files have been successfully processed.
396
352
  * This marks the completion of the processing phase.
397
353
  * Use this to perform batch operations on all processed files.
398
- *
399
- * @property files - Array of all files that were processed
400
354
  */
401
- 'files:processing:end': [{
402
- files: ResolvedFile[];
403
- }];
355
+ 'files:processing:end': [files: Array<ResolvedFile>];
404
356
  }
405
357
  /**
406
358
  * Shared context passed to all plugins, parsers, and Fabric internals.
@@ -463,4 +415,4 @@ interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
463
415
  }
464
416
  //#endregion
465
417
  export { FabricOptions as a, FileManager as c, UserParser as d, Extname as f, ResolvedFile as h, FabricMode as i, FileProcessor as l, KubbFile_d_exports as m, FabricConfig as n, Plugin as o, File as p, FabricContext as r, UserPlugin as s, Fabric as t, Parser as u };
466
- //# sourceMappingURL=Fabric-CEVrEuYU.d.ts.map
418
+ //# sourceMappingURL=Fabric-BXYWK9V4.d.cts.map
@@ -279,100 +279,56 @@ interface FabricEvents {
279
279
  /**
280
280
  * Emitted when Fabric starts rendering (used with reactPlugin).
281
281
  * Provides access to the Fabric instance for render-time operations.
282
- *
283
- * @property fabric - The current Fabric instance being rendered
284
282
  */
285
- 'lifecycle:render': [{
286
- fabric: Fabric;
287
- }];
283
+ 'lifecycle:render': [fabric: Fabric];
288
284
  /**
289
285
  * Emitted once before file processing begins.
290
286
  * Provides the complete list of files that will be processed.
291
287
  * Use this to prepare for batch operations or display initial file counts.
292
- *
293
- * @property files - Array of all files queued for processing
294
288
  */
295
- 'files:processing:start': [{
296
- files: ResolvedFile[];
297
- }];
289
+ 'files:processing:start': [files: Array<ResolvedFile>];
298
290
  /**
299
291
  * Emitted when files are successfully added to the FileManager's internal cache.
300
292
  * This happens after files pass through path and name resolution.
301
293
  * Use this to track which files have been registered.
302
- *
303
- * @property files - Array of files that were just added to the cache
304
294
  */
305
- 'files:added': [{
306
- files: ResolvedFile[];
307
- }];
295
+ 'files:added': [files: Array<ResolvedFile>];
308
296
  /**
309
297
  * Emitted during file path resolution, before a file is cached.
310
298
  * Listeners can modify the file's path property to customize output location.
311
299
  * This is called for each file being added via `addFile()` or `upsertFile()`.
312
- *
313
- * @property file - The file whose path is being resolved (mutable)
314
300
  */
315
- 'file:resolve:path': [{
316
- file: File;
317
- }];
301
+ 'file:resolve:path': [file: File];
318
302
  /**
319
303
  * Emitted during file name resolution, before a file is cached.
320
304
  * Listeners can modify the file's name-related properties to customize naming.
321
305
  * This is called for each file being added via `addFile()` or `upsertFile()`.
322
- *
323
- * @property file - The file whose name is being resolved (mutable)
324
306
  */
325
- 'file:resolve:name': [{
326
- file: File;
327
- }];
307
+ 'file:resolve:name': [file: File];
328
308
  /**
329
309
  * Emitted just before files are written to disk.
330
310
  * Provides all files that will be written in this batch.
331
311
  * Use this to perform pre-write operations like creating directories.
332
- *
333
- * @property files - Array of files about to be written to disk
334
312
  */
335
- 'files:writing:start': [{
336
- files: ResolvedFile[];
337
- }];
313
+ 'files:writing:start': [files: Array<ResolvedFile>];
338
314
  /**
339
315
  * Emitted after all files have been successfully written to disk.
340
316
  * Provides all files that were written in this batch.
341
317
  * Use this for post-write operations like running formatters or reporting.
342
- *
343
- * @property files - Array of files that were written to disk
344
318
  */
345
- 'files:writing:end': [{
346
- files: ResolvedFile[];
347
- }];
319
+ 'files:writing:end': [files: Array<ResolvedFile>];
348
320
  /**
349
321
  * Emitted when an individual file starts being processed.
350
322
  * This happens for each file in the queue, before parsing.
351
323
  * Use this for per-file setup or detailed logging.
352
- *
353
- * @property file - The file starting processing
354
- * @property index - Zero-based position of this file in the queue
355
- * @property total - Total number of files to process
356
324
  */
357
- 'file:processing:start': [{
358
- file: ResolvedFile;
359
- index: number;
360
- total: number;
361
- }];
325
+ 'file:processing:start': [file: ResolvedFile, index: number, total: number];
362
326
  /**
363
327
  * Emitted when an individual file completes processing.
364
328
  * This happens after the file has been parsed and handled.
365
329
  * Use this for per-file cleanup or progress tracking.
366
- *
367
- * @property file - The file that finished processing
368
- * @property index - Zero-based position of this file in the queue
369
- * @property total - Total number of files to process
370
330
  */
371
- 'file:processing:end': [{
372
- file: ResolvedFile;
373
- index: number;
374
- total: number;
375
- }];
331
+ 'file:processing:end': [file: ResolvedFile, index: number, total: number];
376
332
  /**
377
333
  * Emitted after each file is processed, providing progress metrics.
378
334
  * This is the primary event for implementing progress bars or tracking.
@@ -395,12 +351,8 @@ interface FabricEvents {
395
351
  * Emitted once all files have been successfully processed.
396
352
  * This marks the completion of the processing phase.
397
353
  * Use this to perform batch operations on all processed files.
398
- *
399
- * @property files - Array of all files that were processed
400
354
  */
401
- 'files:processing:end': [{
402
- files: ResolvedFile[];
403
- }];
355
+ 'files:processing:end': [files: Array<ResolvedFile>];
404
356
  }
405
357
  /**
406
358
  * Shared context passed to all plugins, parsers, and Fabric internals.
@@ -463,4 +415,4 @@ interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
463
415
  }
464
416
  //#endregion
465
417
  export { FabricOptions as a, FileManager as c, UserParser as d, Extname as f, ResolvedFile as h, FabricMode as i, FileProcessor as l, KubbFile_d_exports as m, FabricConfig as n, Plugin as o, File as p, FabricContext as r, UserPlugin as s, Fabric as t, Parser as u };
466
- //# sourceMappingURL=Fabric-CVnHPMqM.d.cts.map
418
+ //# sourceMappingURL=Fabric-CDFwTDyP.d.ts.map
@@ -8,7 +8,7 @@ node_path = require_trimExtName.__toESM(node_path);
8
8
  const e = {
9
9
  done: !0,
10
10
  hasNext: !1
11
- }, t = {
11
+ }, t$2 = {
12
12
  done: !1,
13
13
  hasNext: !1
14
14
  }, n$2 = () => e, r$2 = (e$1) => ({
@@ -19,7 +19,7 @@ const e = {
19
19
 
20
20
  //#endregion
21
21
  //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js
22
- function t$2(e$1, ...t$3) {
22
+ function t$1(e$1, ...t$3) {
23
23
  let a = e$1, o = t$3.map((e$2) => `lazy` in e$2 ? r$1(e$2) : void 0), s = 0;
24
24
  for (; s < t$3.length;) {
25
25
  if (o[s] === void 0 || !i(a)) {
@@ -41,7 +41,7 @@ function t$2(e$1, ...t$3) {
41
41
  }
42
42
  function n$1(t$3, r$3, i$1) {
43
43
  if (i$1.length === 0) return r$3.push(t$3), !1;
44
- let a = t$3, o = t, s = !1;
44
+ let a = t$3, o = t$2, s = !1;
45
45
  for (let [e$1, t$4] of i$1.entries()) {
46
46
  let { index: c, items: l } = t$4;
47
47
  if (l.push(a), o = t$4(a, c, l), t$4.index += 1, o.hasNext) {
@@ -72,11 +72,11 @@ function i(e$1) {
72
72
 
73
73
  //#endregion
74
74
  //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js
75
- function t$1(t$3, n$3) {
75
+ function t(t$3, n$3) {
76
76
  let r$3 = n$3.length - t$3.length;
77
77
  if (r$3 === 1) {
78
78
  let [r$4, ...i$1] = n$3;
79
- return t$2(r$4, {
79
+ return t$1(r$4, {
80
80
  lazy: t$3,
81
81
  lazyArgs: i$1
82
82
  });
@@ -86,7 +86,7 @@ function t$1(t$3, n$3) {
86
86
  lazy: t$3,
87
87
  lazyArgs: n$3
88
88
  };
89
- return Object.assign((t$4) => t$2(t$4, r$4), r$4);
89
+ return Object.assign((t$4) => t$1(t$4, r$4), r$4);
90
90
  }
91
91
  throw Error(`Wrong number of arguments`);
92
92
  }
@@ -94,13 +94,13 @@ function t$1(t$3, n$3) {
94
94
  //#endregion
95
95
  //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js
96
96
  function n(...e$1) {
97
- return t$1(r, e$1);
97
+ return t(r, e$1);
98
98
  }
99
99
  function r(t$3) {
100
100
  let n$3 = t$3, r$3 = /* @__PURE__ */ new Set();
101
101
  return (t$4, i$1, a) => {
102
102
  let o = n$3(t$4, i$1, a);
103
- return r$3.has(o) ? t : (r$3.add(o), {
103
+ return r$3.has(o) ? t$2 : (r$3.add(o), {
104
104
  done: !1,
105
105
  hasNext: !0,
106
106
  next: t$4
@@ -248,38 +248,38 @@ function createFile(file) {
248
248
  }
249
249
 
250
250
  //#endregion
251
- //#region \0@oxc-project+runtime@0.99.0/helpers/checkPrivateRedeclaration.js
251
+ //#region \0@oxc-project+runtime@0.103.0/helpers/checkPrivateRedeclaration.js
252
252
  function _checkPrivateRedeclaration(e$1, t$3) {
253
253
  if (t$3.has(e$1)) throw new TypeError("Cannot initialize the same private elements twice on an object");
254
254
  }
255
255
 
256
256
  //#endregion
257
- //#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldInitSpec.js
257
+ //#region \0@oxc-project+runtime@0.103.0/helpers/classPrivateFieldInitSpec.js
258
258
  function _classPrivateFieldInitSpec(e$1, t$3, a) {
259
259
  _checkPrivateRedeclaration(e$1, t$3), t$3.set(e$1, a);
260
260
  }
261
261
 
262
262
  //#endregion
263
- //#region \0@oxc-project+runtime@0.99.0/helpers/assertClassBrand.js
263
+ //#region \0@oxc-project+runtime@0.103.0/helpers/assertClassBrand.js
264
264
  function _assertClassBrand(e$1, t$3, n$3) {
265
265
  if ("function" == typeof e$1 ? e$1 === t$3 : e$1.has(t$3)) return arguments.length < 3 ? t$3 : n$3;
266
266
  throw new TypeError("Private element is not present on this object");
267
267
  }
268
268
 
269
269
  //#endregion
270
- //#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldGet2.js
270
+ //#region \0@oxc-project+runtime@0.103.0/helpers/classPrivateFieldGet2.js
271
271
  function _classPrivateFieldGet2(s, a) {
272
272
  return s.get(_assertClassBrand(s, a));
273
273
  }
274
274
 
275
275
  //#endregion
276
- //#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldSet2.js
276
+ //#region \0@oxc-project+runtime@0.103.0/helpers/classPrivateFieldSet2.js
277
277
  function _classPrivateFieldSet2(s, a, r$3) {
278
278
  return s.set(_assertClassBrand(s, a), r$3), r$3;
279
279
  }
280
280
 
281
281
  //#endregion
282
- //#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
282
+ //#region \0@oxc-project+runtime@0.103.0/helpers/typeof.js
283
283
  function _typeof(o) {
284
284
  "@babel/helpers - typeof";
285
285
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
@@ -290,7 +290,7 @@ function _typeof(o) {
290
290
  }
291
291
 
292
292
  //#endregion
293
- //#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
293
+ //#region \0@oxc-project+runtime@0.103.0/helpers/toPrimitive.js
294
294
  function toPrimitive(t$3, r$3) {
295
295
  if ("object" != _typeof(t$3) || !t$3) return t$3;
296
296
  var e$1 = t$3[Symbol.toPrimitive];
@@ -303,14 +303,14 @@ function toPrimitive(t$3, r$3) {
303
303
  }
304
304
 
305
305
  //#endregion
306
- //#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
306
+ //#region \0@oxc-project+runtime@0.103.0/helpers/toPropertyKey.js
307
307
  function toPropertyKey(t$3) {
308
308
  var i$1 = toPrimitive(t$3, "string");
309
309
  return "symbol" == _typeof(i$1) ? i$1 : i$1 + "";
310
310
  }
311
311
 
312
312
  //#endregion
313
- //#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
313
+ //#region \0@oxc-project+runtime@0.103.0/helpers/defineProperty.js
314
314
  function _defineProperty(e$1, r$3, t$3) {
315
315
  return (r$3 = toPropertyKey(r$3)) in e$1 ? Object.defineProperty(e$1, r$3, {
316
316
  value: t$3,
@@ -363,4 +363,4 @@ Object.defineProperty(exports, 'createFile', {
363
363
  return createFile;
364
364
  }
365
365
  });
366
- //# sourceMappingURL=defineProperty-BOlj8-IY.cjs.map
366
+ //# sourceMappingURL=defineProperty-B59n8a_H.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineProperty-B59n8a_H.cjs","names":["t","n","r","e","t","e","r","n","i","r","n","t","i","e","e","n","t","r","i","uniqueBy","exports","prev: Array<KubbFile.Export>","prev: Array<KubbFile.Import>","path","trimExtName"],"sources":["../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/utilityEvaluators-DORpnx39.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js","../src/createFile.ts"],"sourcesContent":["const e={done:!0,hasNext:!1},t={done:!1,hasNext:!1},n=()=>e,r=e=>({hasNext:!0,next:e,done:!1});export{t as SKIP_ITEM,n as lazyEmptyEvaluator,r as lazyIdentityEvaluator};\n//# sourceMappingURL=utilityEvaluators-DORpnx39.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";function t(e,...t){let a=e,o=t.map(e=>`lazy`in e?r(e):void 0),s=0;for(;s<t.length;){if(o[s]===void 0||!i(a)){let e=t[s];a=e(a),s+=1;continue}let e=[];for(let n=s;n<t.length;n++){let t=o[n];if(t===void 0||(e.push(t),t.isSingle))break}let r=[];for(let t of a)if(n(t,r,e))break;let{isSingle:c}=e.at(-1);a=c?r[0]:r,s+=e.length}return a}function n(t,r,i){if(i.length===0)return r.push(t),!1;let a=t,o=e,s=!1;for(let[e,t]of i.entries()){let{index:c,items:l}=t;if(l.push(a),o=t(a,c,l),t.index+=1,o.hasNext){if(o.hasMany??!1){for(let t of o.next)if(n(t,r,i.slice(e+1)))return!0;return s}a=o.next}if(!o.hasNext)break;o.done&&(s=!0)}return o.hasNext&&r.push(a),s}function r(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function i(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}export{t as pipe};\n//# sourceMappingURL=pipe-jLehR9-P.js.map","import{pipe as e}from\"./pipe-jLehR9-P.js\";function t(t,n){let r=n.length-t.length;if(r===1){let[r,...i]=n;return e(r,{lazy:t,lazyArgs:i})}if(r===0){let r={lazy:t,lazyArgs:n};return Object.assign(t=>e(t,r),r)}throw Error(`Wrong number of arguments`)}export{t as purryFromLazy};\n//# sourceMappingURL=purryFromLazy-3oywCNIb.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";import{purryFromLazy as t}from\"./purryFromLazy-3oywCNIb.js\";function n(...e){return t(r,e)}function r(t){let n=t,r=new Set;return(t,i,a)=>{let o=n(t,i,a);return r.has(o)?e:(r.add(o),{done:!1,hasNext:!0,next:t})}}export{n as uniqueBy};\n//# sourceMappingURL=uniqueBy-C_PxkF_D.js.map","import { createHash } from 'node:crypto'\nimport path from 'node:path'\nimport { orderBy } from 'natural-orderby'\nimport { uniqueBy } from 'remeda'\nimport type * as KubbFile from './KubbFile.ts'\nimport { trimExtName } from './utils/trimExtName.ts'\n\nexport function combineSources(sources: Array<KubbFile.Source>): Array<KubbFile.Source> {\n return uniqueBy(sources, (obj) => {\n // For named sources, deduplicate by name, isExportable, and isTypeOnly\n // For unnamed sources, include the value to avoid deduplicating different code blocks\n // If both name and value are undefined, use an empty string as the unique identifier\n const uniqueId = obj.name ?? obj.value ?? ''\n const isExportable = obj.isExportable ?? false\n const isTypeOnly = obj.isTypeOnly ?? false\n return `${uniqueId}:${isExportable}:${isTypeOnly}`\n })\n}\n\nexport function combineExports(exports: Array<KubbFile.Export>): Array<KubbFile.Export> {\n const sorted = orderBy(exports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : v.name),\n ])\n\n const prev: Array<KubbFile.Export> = []\n // Map to track items by path for O(1) lookup\n const pathMap = new Map<string, KubbFile.Export>()\n // Map to track unique items by path+name+isTypeOnly+asAlias\n const uniqueMap = new Map<string, KubbFile.Export>()\n // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = new Map<string, KubbFile.Export>()\n\n for (const curr of sorted) {\n const name = curr.name\n const pathKey = curr.path\n const prevByPath = pathMap.get(pathKey)\n\n // Create unique key for path+name+isTypeOnly\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${pathKey}:${nameKey}:${curr.isTypeOnly}`\n // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${pathKey}:${nameKey}`\n const prevByPathAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathAndIsTypeOnly) {\n // we already have an export that has the same path and name but uses `isTypeOnly` (export type ...)\n continue\n }\n\n // Create unique key for path+name+isTypeOnly+asAlias\n const uniqueKey = `${pathNameTypeKey}:${curr.asAlias || ''}`\n const uniquePrev = uniqueMap.get(uniqueKey)\n\n // we already have an item that was unique enough or name field is empty or prev asAlias is set but current has no changes\n if (uniquePrev || (Array.isArray(name) && !name.length) || (prevByPath?.asAlias && !curr.asAlias)) {\n continue\n }\n\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name: Array.isArray(name) ? [...new Set(name)] : name,\n }\n prev.push(newItem)\n pathMap.set(pathKey, newItem)\n uniqueMap.set(uniqueKey, newItem)\n // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(curr.name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...curr.name])]\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(uniqueKey, curr)\n // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\n }\n\n return prev\n}\n\nexport function combineImports(imports: Array<KubbFile.Import>, exports: Array<KubbFile.Export>, source?: string): Array<KubbFile.Import> {\n const exportedNameLookup = new Set<string>()\n for (const item of exports) {\n const { name } = item\n if (!name) {\n continue\n }\n\n if (Array.isArray(name)) {\n for (const value of name) {\n if (value) {\n exportedNameLookup.add(value)\n }\n }\n continue\n }\n\n exportedNameLookup.add(name)\n }\n\n const usageCache = new Map<string, boolean>()\n const hasImportInSource = (importName: string): boolean => {\n if (!source) {\n return true\n }\n\n const cached = usageCache.get(importName)\n if (cached !== undefined) {\n return cached\n }\n\n const isUsed = source.includes(importName) || exportedNameLookup.has(importName)\n usageCache.set(importName, isUsed)\n\n return isUsed\n }\n\n const sorted = orderBy(imports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : v.name),\n ])\n\n const prev: Array<KubbFile.Import> = []\n // Map to track items by path+isTypeOnly for O(1) lookup\n const pathTypeMap = new Map<string, KubbFile.Import>()\n // Map to track unique items by path+name+isTypeOnly\n const uniqueMap = new Map<string, KubbFile.Import>()\n // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = new Map<string, KubbFile.Import>()\n\n for (const curr of sorted) {\n let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name\n\n if (curr.path === curr.root) {\n // root and path are the same file, remove the \"./\" import\n continue\n }\n\n // merge all names and check if the importName is being used in the generated source and if not filter those imports out\n if (Array.isArray(name)) {\n name = name.filter((item) => (typeof item === 'string' ? hasImportInSource(item) : hasImportInSource(item.propertyName)))\n }\n\n const pathTypeKey = `${curr.path}:${curr.isTypeOnly}`\n const prevByPath = pathTypeMap.get(pathTypeKey)\n\n // Create key for name comparison\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${curr.path}:${nameKey}:${curr.isTypeOnly}`\n const uniquePrev = uniqueMap.get(pathNameTypeKey)\n // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${curr.path}:${nameKey}`\n const prevByPathNameAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathNameAndIsTypeOnly) {\n // we already have an import that has the same path and name but uses `isTypeOnly` (import type ...)\n continue\n }\n\n // already unique enough or name is empty\n if (uniquePrev || (Array.isArray(name) && !name.length)) {\n continue\n }\n\n // new item, append name\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name,\n }\n prev.push(newItem)\n pathTypeMap.set(pathTypeKey, newItem)\n uniqueMap.set(pathNameTypeKey, newItem)\n // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...name])]\n continue\n }\n\n // no import was found in the source, ignore import\n if (!Array.isArray(name) && name && !hasImportInSource(name)) {\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(pathNameTypeKey, curr)\n // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\n }\n\n return prev\n}\n\n/**\n * Helper to create a file with name and id set\n */\nexport function createFile<TMeta extends object = object>(file: KubbFile.File<TMeta>): KubbFile.ResolvedFile<TMeta> {\n const extname = path.extname(file.baseName) as KubbFile.Extname\n if (!extname) {\n throw new Error(`No extname found for ${file.baseName}`)\n }\n\n const source = file.sources.map((item) => item.value).join('\\n\\n')\n const exports = file.exports?.length ? combineExports(file.exports) : []\n const imports = file.imports?.length && source ? combineImports(file.imports, exports, source) : []\n const sources = file.sources?.length ? combineSources(file.sources) : []\n\n return {\n ...file,\n id: createHash('sha256').update(file.path).digest('hex'),\n name: trimExtName(file.baseName),\n extname,\n imports: imports,\n exports: exports,\n sources: sources,\n meta: file.meta || ({} as TMeta),\n }\n}\n"],"x_google_ignoreList":[0,1,2,3],"mapp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AI,MAAM,QAAQ,KAAK,IAAI,WAAW,eAAe,KAAK,YAAY;AACpH,cAAW,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,WAAW,MAAM,GAAG,KAAK,CAAC,CAAC;AAC7D;;AAIF,MAAI,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,kBAAkB,KAAK,CAC1D;AAGF,OAAK,KAAK,KAAK;AACf,YAAU,IAAI,iBAAiB,KAAK;AAEpC,MAAI,KAAK,WACP,qBAAoB,IAAI,aAAa,KAAK;;AAI9C,QAAO;;;;;AAMT,SAAgB,WAA0C,MAA0D;;CAClH,MAAM,UAAUC,kBAAK,QAAQ,KAAK,SAAS;AAC3C,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,wBAAwB,KAAK,WAAW;CAG1D,MAAM,SAAS,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;CAClE,MAAMH,8BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;CACxE,MAAM,4BAAU,KAAK,uEAAS,WAAU,SAAS,eAAe,KAAK,SAASA,WAAS,OAAO,GAAG,EAAE;CACnG,MAAM,4BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;AAExE,QAAO;EACL,GAAG;EACH,gCAAe,SAAS,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,MAAM;EACxD,MAAMI,gCAAY,KAAK,SAAS;EAChC;EACS;EACT,SAASJ;EACA;EACT,MAAM,KAAK,QAAS,EAAE;EACvB"}
@@ -7,7 +7,7 @@ import path from "node:path";
7
7
  const e = {
8
8
  done: !0,
9
9
  hasNext: !1
10
- }, t = {
10
+ }, t$2 = {
11
11
  done: !1,
12
12
  hasNext: !1
13
13
  }, n$2 = () => e, r$2 = (e$1) => ({
@@ -18,7 +18,7 @@ const e = {
18
18
 
19
19
  //#endregion
20
20
  //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js
21
- function t$2(e$1, ...t$3) {
21
+ function t$1(e$1, ...t$3) {
22
22
  let a = e$1, o = t$3.map((e$2) => `lazy` in e$2 ? r$1(e$2) : void 0), s = 0;
23
23
  for (; s < t$3.length;) {
24
24
  if (o[s] === void 0 || !i(a)) {
@@ -40,7 +40,7 @@ function t$2(e$1, ...t$3) {
40
40
  }
41
41
  function n$1(t$3, r$3, i$1) {
42
42
  if (i$1.length === 0) return r$3.push(t$3), !1;
43
- let a = t$3, o = t, s = !1;
43
+ let a = t$3, o = t$2, s = !1;
44
44
  for (let [e$1, t$4] of i$1.entries()) {
45
45
  let { index: c, items: l } = t$4;
46
46
  if (l.push(a), o = t$4(a, c, l), t$4.index += 1, o.hasNext) {
@@ -71,11 +71,11 @@ function i(e$1) {
71
71
 
72
72
  //#endregion
73
73
  //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js
74
- function t$1(t$3, n$3) {
74
+ function t(t$3, n$3) {
75
75
  let r$3 = n$3.length - t$3.length;
76
76
  if (r$3 === 1) {
77
77
  let [r$4, ...i$1] = n$3;
78
- return t$2(r$4, {
78
+ return t$1(r$4, {
79
79
  lazy: t$3,
80
80
  lazyArgs: i$1
81
81
  });
@@ -85,7 +85,7 @@ function t$1(t$3, n$3) {
85
85
  lazy: t$3,
86
86
  lazyArgs: n$3
87
87
  };
88
- return Object.assign((t$4) => t$2(t$4, r$4), r$4);
88
+ return Object.assign((t$4) => t$1(t$4, r$4), r$4);
89
89
  }
90
90
  throw Error(`Wrong number of arguments`);
91
91
  }
@@ -93,13 +93,13 @@ function t$1(t$3, n$3) {
93
93
  //#endregion
94
94
  //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js
95
95
  function n(...e$1) {
96
- return t$1(r, e$1);
96
+ return t(r, e$1);
97
97
  }
98
98
  function r(t$3) {
99
99
  let n$3 = t$3, r$3 = /* @__PURE__ */ new Set();
100
100
  return (t$4, i$1, a) => {
101
101
  let o = n$3(t$4, i$1, a);
102
- return r$3.has(o) ? t : (r$3.add(o), {
102
+ return r$3.has(o) ? t$2 : (r$3.add(o), {
103
103
  done: !1,
104
104
  hasNext: !0,
105
105
  next: t$4
@@ -247,38 +247,38 @@ function createFile(file) {
247
247
  }
248
248
 
249
249
  //#endregion
250
- //#region \0@oxc-project+runtime@0.99.0/helpers/checkPrivateRedeclaration.js
250
+ //#region \0@oxc-project+runtime@0.103.0/helpers/checkPrivateRedeclaration.js
251
251
  function _checkPrivateRedeclaration(e$1, t$3) {
252
252
  if (t$3.has(e$1)) throw new TypeError("Cannot initialize the same private elements twice on an object");
253
253
  }
254
254
 
255
255
  //#endregion
256
- //#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldInitSpec.js
256
+ //#region \0@oxc-project+runtime@0.103.0/helpers/classPrivateFieldInitSpec.js
257
257
  function _classPrivateFieldInitSpec(e$1, t$3, a) {
258
258
  _checkPrivateRedeclaration(e$1, t$3), t$3.set(e$1, a);
259
259
  }
260
260
 
261
261
  //#endregion
262
- //#region \0@oxc-project+runtime@0.99.0/helpers/assertClassBrand.js
262
+ //#region \0@oxc-project+runtime@0.103.0/helpers/assertClassBrand.js
263
263
  function _assertClassBrand(e$1, t$3, n$3) {
264
264
  if ("function" == typeof e$1 ? e$1 === t$3 : e$1.has(t$3)) return arguments.length < 3 ? t$3 : n$3;
265
265
  throw new TypeError("Private element is not present on this object");
266
266
  }
267
267
 
268
268
  //#endregion
269
- //#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldGet2.js
269
+ //#region \0@oxc-project+runtime@0.103.0/helpers/classPrivateFieldGet2.js
270
270
  function _classPrivateFieldGet2(s, a) {
271
271
  return s.get(_assertClassBrand(s, a));
272
272
  }
273
273
 
274
274
  //#endregion
275
- //#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldSet2.js
275
+ //#region \0@oxc-project+runtime@0.103.0/helpers/classPrivateFieldSet2.js
276
276
  function _classPrivateFieldSet2(s, a, r$3) {
277
277
  return s.set(_assertClassBrand(s, a), r$3), r$3;
278
278
  }
279
279
 
280
280
  //#endregion
281
- //#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
281
+ //#region \0@oxc-project+runtime@0.103.0/helpers/typeof.js
282
282
  function _typeof(o) {
283
283
  "@babel/helpers - typeof";
284
284
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
@@ -289,7 +289,7 @@ function _typeof(o) {
289
289
  }
290
290
 
291
291
  //#endregion
292
- //#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
292
+ //#region \0@oxc-project+runtime@0.103.0/helpers/toPrimitive.js
293
293
  function toPrimitive(t$3, r$3) {
294
294
  if ("object" != _typeof(t$3) || !t$3) return t$3;
295
295
  var e$1 = t$3[Symbol.toPrimitive];
@@ -302,14 +302,14 @@ function toPrimitive(t$3, r$3) {
302
302
  }
303
303
 
304
304
  //#endregion
305
- //#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
305
+ //#region \0@oxc-project+runtime@0.103.0/helpers/toPropertyKey.js
306
306
  function toPropertyKey(t$3) {
307
307
  var i$1 = toPrimitive(t$3, "string");
308
308
  return "symbol" == _typeof(i$1) ? i$1 : i$1 + "";
309
309
  }
310
310
 
311
311
  //#endregion
312
- //#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
312
+ //#region \0@oxc-project+runtime@0.103.0/helpers/defineProperty.js
313
313
  function _defineProperty(e$1, r$3, t$3) {
314
314
  return (r$3 = toPropertyKey(r$3)) in e$1 ? Object.defineProperty(e$1, r$3, {
315
315
  value: t$3,
@@ -321,4 +321,4 @@ function _defineProperty(e$1, r$3, t$3) {
321
321
 
322
322
  //#endregion
323
323
  export { _classPrivateFieldInitSpec as a, _assertClassBrand as i, _classPrivateFieldSet2 as n, _checkPrivateRedeclaration as o, _classPrivateFieldGet2 as r, createFile as s, _defineProperty as t };
324
- //# sourceMappingURL=defineProperty-D2uejjT1.js.map
324
+ //# sourceMappingURL=defineProperty-BMAGVqB-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineProperty-BMAGVqB-.js","names":["t","n","r","e","t","e","r","n","i","r","n","t","i","e","e","n","t","r","i","uniqueBy","prev: Array<KubbFile.Export>","prev: Array<KubbFile.Import>"],"sources":["../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/utilityEvaluators-DORpnx39.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js","../src/createFile.ts"],"sourcesContent":["const e={done:!0,hasNext:!1},t={done:!1,hasNext:!1},n=()=>e,r=e=>({hasNext:!0,next:e,done:!1});export{t as SKIP_ITEM,n as lazyEmptyEvaluator,r as lazyIdentityEvaluator};\n//# sourceMappingURL=utilityEvaluators-DORpnx39.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";function t(e,...t){let a=e,o=t.map(e=>`lazy`in e?r(e):void 0),s=0;for(;s<t.length;){if(o[s]===void 0||!i(a)){let e=t[s];a=e(a),s+=1;continue}let e=[];for(let n=s;n<t.length;n++){let t=o[n];if(t===void 0||(e.push(t),t.isSingle))break}let r=[];for(let t of a)if(n(t,r,e))break;let{isSingle:c}=e.at(-1);a=c?r[0]:r,s+=e.length}return a}function n(t,r,i){if(i.length===0)return r.push(t),!1;let a=t,o=e,s=!1;for(let[e,t]of i.entries()){let{index:c,items:l}=t;if(l.push(a),o=t(a,c,l),t.index+=1,o.hasNext){if(o.hasMany??!1){for(let t of o.next)if(n(t,r,i.slice(e+1)))return!0;return s}a=o.next}if(!o.hasNext)break;o.done&&(s=!0)}return o.hasNext&&r.push(a),s}function r(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function i(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}export{t as pipe};\n//# sourceMappingURL=pipe-jLehR9-P.js.map","import{pipe as e}from\"./pipe-jLehR9-P.js\";function t(t,n){let r=n.length-t.length;if(r===1){let[r,...i]=n;return e(r,{lazy:t,lazyArgs:i})}if(r===0){let r={lazy:t,lazyArgs:n};return Object.assign(t=>e(t,r),r)}throw Error(`Wrong number of arguments`)}export{t as purryFromLazy};\n//# sourceMappingURL=purryFromLazy-3oywCNIb.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";import{purryFromLazy as t}from\"./purryFromLazy-3oywCNIb.js\";function n(...e){return t(r,e)}function r(t){let n=t,r=new Set;return(t,i,a)=>{let o=n(t,i,a);return r.has(o)?e:(r.add(o),{done:!1,hasNext:!0,next:t})}}export{n as uniqueBy};\n//# sourceMappingURL=uniqueBy-C_PxkF_D.js.map","import { createHash } from 'node:crypto'\nimport path from 'node:path'\nimport { orderBy } from 'natural-orderby'\nimport { uniqueBy } from 'remeda'\nimport type * as KubbFile from './KubbFile.ts'\nimport { trimExtName } from './utils/trimExtName.ts'\n\nexport function combineSources(sources: Array<KubbFile.Source>): Array<KubbFile.Source> {\n return uniqueBy(sources, (obj) => {\n // For named sources, deduplicate by name, isExportable, and isTypeOnly\n // For unnamed sources, include the value to avoid deduplicating different code blocks\n // If both name and value are undefined, use an empty string as the unique identifier\n const uniqueId = obj.name ?? obj.value ?? ''\n const isExportable = obj.isExportable ?? false\n const isTypeOnly = obj.isTypeOnly ?? false\n return `${uniqueId}:${isExportable}:${isTypeOnly}`\n })\n}\n\nexport function combineExports(exports: Array<KubbFile.Export>): Array<KubbFile.Export> {\n const sorted = orderBy(exports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : v.name),\n ])\n\n const prev: Array<KubbFile.Export> = []\n // Map to track items by path for O(1) lookup\n const pathMap = new Map<string, KubbFile.Export>()\n // Map to track unique items by path+name+isTypeOnly+asAlias\n const uniqueMap = new Map<string, KubbFile.Export>()\n // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = new Map<string, KubbFile.Export>()\n\n for (const curr of sorted) {\n const name = curr.name\n const pathKey = curr.path\n const prevByPath = pathMap.get(pathKey)\n\n // Create unique key for path+name+isTypeOnly\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${pathKey}:${nameKey}:${curr.isTypeOnly}`\n // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${pathKey}:${nameKey}`\n const prevByPathAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathAndIsTypeOnly) {\n // we already have an export that has the same path and name but uses `isTypeOnly` (export type ...)\n continue\n }\n\n // Create unique key for path+name+isTypeOnly+asAlias\n const uniqueKey = `${pathNameTypeKey}:${curr.asAlias || ''}`\n const uniquePrev = uniqueMap.get(uniqueKey)\n\n // we already have an item that was unique enough or name field is empty or prev asAlias is set but current has no changes\n if (uniquePrev || (Array.isArray(name) && !name.length) || (prevByPath?.asAlias && !curr.asAlias)) {\n continue\n }\n\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name: Array.isArray(name) ? [...new Set(name)] : name,\n }\n prev.push(newItem)\n pathMap.set(pathKey, newItem)\n uniqueMap.set(uniqueKey, newItem)\n // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(curr.name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...curr.name])]\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(uniqueKey, curr)\n // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\n }\n\n return prev\n}\n\nexport function combineImports(imports: Array<KubbFile.Import>, exports: Array<KubbFile.Export>, source?: string): Array<KubbFile.Import> {\n const exportedNameLookup = new Set<string>()\n for (const item of exports) {\n const { name } = item\n if (!name) {\n continue\n }\n\n if (Array.isArray(name)) {\n for (const value of name) {\n if (value) {\n exportedNameLookup.add(value)\n }\n }\n continue\n }\n\n exportedNameLookup.add(name)\n }\n\n const usageCache = new Map<string, boolean>()\n const hasImportInSource = (importName: string): boolean => {\n if (!source) {\n return true\n }\n\n const cached = usageCache.get(importName)\n if (cached !== undefined) {\n return cached\n }\n\n const isUsed = source.includes(importName) || exportedNameLookup.has(importName)\n usageCache.set(importName, isUsed)\n\n return isUsed\n }\n\n const sorted = orderBy(imports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : v.name),\n ])\n\n const prev: Array<KubbFile.Import> = []\n // Map to track items by path+isTypeOnly for O(1) lookup\n const pathTypeMap = new Map<string, KubbFile.Import>()\n // Map to track unique items by path+name+isTypeOnly\n const uniqueMap = new Map<string, KubbFile.Import>()\n // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = new Map<string, KubbFile.Import>()\n\n for (const curr of sorted) {\n let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name\n\n if (curr.path === curr.root) {\n // root and path are the same file, remove the \"./\" import\n continue\n }\n\n // merge all names and check if the importName is being used in the generated source and if not filter those imports out\n if (Array.isArray(name)) {\n name = name.filter((item) => (typeof item === 'string' ? hasImportInSource(item) : hasImportInSource(item.propertyName)))\n }\n\n const pathTypeKey = `${curr.path}:${curr.isTypeOnly}`\n const prevByPath = pathTypeMap.get(pathTypeKey)\n\n // Create key for name comparison\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${curr.path}:${nameKey}:${curr.isTypeOnly}`\n const uniquePrev = uniqueMap.get(pathNameTypeKey)\n // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${curr.path}:${nameKey}`\n const prevByPathNameAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathNameAndIsTypeOnly) {\n // we already have an import that has the same path and name but uses `isTypeOnly` (import type ...)\n continue\n }\n\n // already unique enough or name is empty\n if (uniquePrev || (Array.isArray(name) && !name.length)) {\n continue\n }\n\n // new item, append name\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name,\n }\n prev.push(newItem)\n pathTypeMap.set(pathTypeKey, newItem)\n uniqueMap.set(pathNameTypeKey, newItem)\n // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...name])]\n continue\n }\n\n // no import was found in the source, ignore import\n if (!Array.isArray(name) && name && !hasImportInSource(name)) {\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(pathNameTypeKey, curr)\n // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\n }\n\n return prev\n}\n\n/**\n * Helper to create a file with name and id set\n */\nexport function createFile<TMeta extends object = object>(file: KubbFile.File<TMeta>): KubbFile.ResolvedFile<TMeta> {\n const extname = path.extname(file.baseName) as KubbFile.Extname\n if (!extname) {\n throw new Error(`No extname found for ${file.baseName}`)\n }\n\n const source = file.sources.map((item) => item.value).join('\\n\\n')\n const exports = file.exports?.length ? combineExports(file.exports) : []\n const imports = file.imports?.length && source ? combineImports(file.imports, exports, source) : []\n const sources = file.sources?.length ? combineSources(file.sources) : []\n\n return {\n ...file,\n id: createHash('sha256').update(file.path).digest('hex'),\n name: trimExtName(file.baseName),\n extname,\n imports: imports,\n exports: exports,\n sources: sources,\n meta: file.meta || ({} as TMeta),\n }\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;AAAA,MAAM,IAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAACA,MAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAACC,YAAM,GAAEC,OAAE,SAAI;CAAC,SAAQ,CAAC;CAAE,MAAKC;CAAE,MAAK,CAAC;CAAE;;;;ACAjC,SAASC,IAAE,KAAE,GAAGA,KAAE;CAAC,IAAI,IAAEC,KAAE,IAAED,IAAE,KAAI,QAAG,UAASC,MAAEC,IAAED,IAAE,GAAC,KAAK,EAAE,EAAC,IAAE;AAAE,QAAK,IAAED,IAAE,SAAQ;AAAC,MAAG,EAAE,OAAK,KAAK,KAAG,CAAC,EAAE,EAAE,EAAC;GAAC,IAAIC,MAAED,IAAE;AAAG,OAAEC,IAAE,EAAE,EAAC,KAAG;AAAE;;EAAS,IAAIA,MAAE,EAAE;AAAC,OAAI,IAAIE,MAAE,GAAEA,MAAEH,IAAE,QAAO,OAAI;GAAC,IAAIA,MAAE,EAAEG;AAAG,OAAGH,QAAI,KAAK,MAAIC,IAAE,KAAKD,IAAE,EAACA,IAAE,UAAU;;EAAM,IAAIE,MAAE,EAAE;AAAC,OAAI,IAAIF,OAAK,EAAE,KAAGG,IAAEH,KAAEE,KAAED,IAAE,CAAC;EAAM,IAAG,EAAC,UAAS,MAAGA,IAAE,GAAG,GAAG;AAAC,MAAE,IAAEC,IAAE,KAAGA,KAAE,KAAGD,IAAE;;AAAO,QAAO;;AAAE,SAASE,IAAE,KAAE,KAAE,KAAE;AAAC,KAAGC,IAAE,WAAS,EAAE,QAAOF,IAAE,KAAKF,IAAE,EAAC,CAAC;CAAE,IAAI,IAAEA,KAAE,IAAEC,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