@kubb/core 1.9.0-canary.20230913T152432 → 1.9.0-canary.20230913T205302

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -170,12 +170,9 @@ function createJSDocBlockText({ comments }) {
170
170
  if (!filteredComments.length) {
171
171
  return "";
172
172
  }
173
- const text = filteredComments.reduce((acc, comment) => {
174
- return `${acc}
175
- * ${comment}`;
176
- }, "/**");
177
- return `${text}
178
- */`;
173
+ return `/**
174
+ * ${filteredComments.join("\n * ")}
175
+ */`;
179
176
  }
180
177
 
181
178
  // src/utils/getUniqueName.ts
@@ -253,11 +250,109 @@ var Queue = class {
253
250
  }
254
251
  };
255
252
 
256
- // src/utils/getEncodedText.ts
253
+ // src/utils/transformers/getEncodedText.ts
257
254
  function getEncodedText(text) {
258
255
  return text ? text.replaceAll("`", "\\`") : "";
259
256
  }
260
257
 
258
+ // src/utils/transformers/transformReservedWord.ts
259
+ var reservedWords = [
260
+ "abstract",
261
+ "arguments",
262
+ "boolean",
263
+ "break",
264
+ "byte",
265
+ "case",
266
+ "catch",
267
+ "char",
268
+ "class",
269
+ "const",
270
+ "continue",
271
+ "debugger",
272
+ "default",
273
+ "delete",
274
+ "do",
275
+ "double",
276
+ "else",
277
+ "enum",
278
+ "eval",
279
+ "export",
280
+ "extends",
281
+ "false",
282
+ "final",
283
+ "finally",
284
+ "float",
285
+ "for",
286
+ "function",
287
+ "goto",
288
+ "if",
289
+ "implements",
290
+ "import",
291
+ "in",
292
+ "instanceof",
293
+ "int",
294
+ "interface",
295
+ "let",
296
+ "long",
297
+ "native",
298
+ "new",
299
+ "null",
300
+ "package",
301
+ "private",
302
+ "protected",
303
+ "public",
304
+ "return",
305
+ "short",
306
+ "static",
307
+ "super",
308
+ "switch",
309
+ "synchronized",
310
+ "this",
311
+ "throw",
312
+ "throws",
313
+ "transient",
314
+ "true",
315
+ "try",
316
+ "typeof",
317
+ "var",
318
+ "void",
319
+ "volatile",
320
+ "while",
321
+ "with",
322
+ "yield",
323
+ "Array",
324
+ "Date",
325
+ "eval",
326
+ "function",
327
+ "hasOwnProperty",
328
+ "Infinity",
329
+ "isFinite",
330
+ "isNaN",
331
+ "isPrototypeOf",
332
+ "length",
333
+ "Math",
334
+ "name",
335
+ "NaN",
336
+ "Number",
337
+ "Object",
338
+ "prototype",
339
+ "String",
340
+ "toString",
341
+ "undefined",
342
+ "valueOf"
343
+ ];
344
+ function transformReservedWord(word) {
345
+ if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
346
+ return `_${word}`;
347
+ }
348
+ return word;
349
+ }
350
+
351
+ // src/utils/transformers/combineCodes.ts
352
+ function combineCodes(codes) {
353
+ return codes.map((code) => code.replaceAll(/(^[ \t]*\n)/gm, "")).join("\n");
354
+ }
355
+
261
356
  // src/utils/renderTemplate.ts
262
357
  function renderTemplate(template, data = void 0) {
263
358
  if (!data || !Object.keys(data).length) {
@@ -368,99 +463,6 @@ var TreeNode = class _TreeNode {
368
463
  }
369
464
  };
370
465
 
371
- // src/utils/transformReservedWord.ts
372
- var reservedWords = [
373
- "abstract",
374
- "arguments",
375
- "boolean",
376
- "break",
377
- "byte",
378
- "case",
379
- "catch",
380
- "char",
381
- "class",
382
- "const",
383
- "continue",
384
- "debugger",
385
- "default",
386
- "delete",
387
- "do",
388
- "double",
389
- "else",
390
- "enum",
391
- "eval",
392
- "export",
393
- "extends",
394
- "false",
395
- "final",
396
- "finally",
397
- "float",
398
- "for",
399
- "function",
400
- "goto",
401
- "if",
402
- "implements",
403
- "import",
404
- "in",
405
- "instanceof",
406
- "int",
407
- "interface",
408
- "let",
409
- "long",
410
- "native",
411
- "new",
412
- "null",
413
- "package",
414
- "private",
415
- "protected",
416
- "public",
417
- "return",
418
- "short",
419
- "static",
420
- "super",
421
- "switch",
422
- "synchronized",
423
- "this",
424
- "throw",
425
- "throws",
426
- "transient",
427
- "true",
428
- "try",
429
- "typeof",
430
- "var",
431
- "void",
432
- "volatile",
433
- "while",
434
- "with",
435
- "yield",
436
- "Array",
437
- "Date",
438
- "eval",
439
- "function",
440
- "hasOwnProperty",
441
- "Infinity",
442
- "isFinite",
443
- "isNaN",
444
- "isPrototypeOf",
445
- "length",
446
- "Math",
447
- "name",
448
- "NaN",
449
- "Number",
450
- "Object",
451
- "prototype",
452
- "String",
453
- "toString",
454
- "undefined",
455
- "valueOf"
456
- ];
457
- function transformReservedWord(word) {
458
- if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
459
- return `_${word}`;
460
- }
461
- return word;
462
- }
463
-
464
466
  // src/utils/uniqueIdFactory.ts
465
467
  var uniqueIdFactory = (counter) => (str = "") => `${str}${++counter}`;
466
468
  var SLASHES = /* @__PURE__ */ new Set(["/", "\\"]);
@@ -1555,6 +1557,7 @@ exports.ValidationPluginError = ValidationPluginError;
1555
1557
  exports.Warning = Warning;
1556
1558
  exports.build = build;
1557
1559
  exports.clean = clean;
1560
+ exports.combineCodes = combineCodes;
1558
1561
  exports.combineFiles = combineFiles;
1559
1562
  exports.createJSDocBlockText = createJSDocBlockText;
1560
1563
  exports.createLogger = createLogger;