@kubb/core 1.9.0-canary.20230913T152533 → 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 +103 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +103 -101
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -157,12 +157,9 @@ function createJSDocBlockText({ comments }) {
|
|
|
157
157
|
if (!filteredComments.length) {
|
|
158
158
|
return "";
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, "/**");
|
|
164
|
-
return `${text}
|
|
165
|
-
*/`;
|
|
160
|
+
return `/**
|
|
161
|
+
* ${filteredComments.join("\n * ")}
|
|
162
|
+
*/`;
|
|
166
163
|
}
|
|
167
164
|
|
|
168
165
|
// src/utils/getUniqueName.ts
|
|
@@ -240,11 +237,109 @@ var Queue = class {
|
|
|
240
237
|
}
|
|
241
238
|
};
|
|
242
239
|
|
|
243
|
-
// src/utils/getEncodedText.ts
|
|
240
|
+
// src/utils/transformers/getEncodedText.ts
|
|
244
241
|
function getEncodedText(text) {
|
|
245
242
|
return text ? text.replaceAll("`", "\\`") : "";
|
|
246
243
|
}
|
|
247
244
|
|
|
245
|
+
// src/utils/transformers/transformReservedWord.ts
|
|
246
|
+
var reservedWords = [
|
|
247
|
+
"abstract",
|
|
248
|
+
"arguments",
|
|
249
|
+
"boolean",
|
|
250
|
+
"break",
|
|
251
|
+
"byte",
|
|
252
|
+
"case",
|
|
253
|
+
"catch",
|
|
254
|
+
"char",
|
|
255
|
+
"class",
|
|
256
|
+
"const",
|
|
257
|
+
"continue",
|
|
258
|
+
"debugger",
|
|
259
|
+
"default",
|
|
260
|
+
"delete",
|
|
261
|
+
"do",
|
|
262
|
+
"double",
|
|
263
|
+
"else",
|
|
264
|
+
"enum",
|
|
265
|
+
"eval",
|
|
266
|
+
"export",
|
|
267
|
+
"extends",
|
|
268
|
+
"false",
|
|
269
|
+
"final",
|
|
270
|
+
"finally",
|
|
271
|
+
"float",
|
|
272
|
+
"for",
|
|
273
|
+
"function",
|
|
274
|
+
"goto",
|
|
275
|
+
"if",
|
|
276
|
+
"implements",
|
|
277
|
+
"import",
|
|
278
|
+
"in",
|
|
279
|
+
"instanceof",
|
|
280
|
+
"int",
|
|
281
|
+
"interface",
|
|
282
|
+
"let",
|
|
283
|
+
"long",
|
|
284
|
+
"native",
|
|
285
|
+
"new",
|
|
286
|
+
"null",
|
|
287
|
+
"package",
|
|
288
|
+
"private",
|
|
289
|
+
"protected",
|
|
290
|
+
"public",
|
|
291
|
+
"return",
|
|
292
|
+
"short",
|
|
293
|
+
"static",
|
|
294
|
+
"super",
|
|
295
|
+
"switch",
|
|
296
|
+
"synchronized",
|
|
297
|
+
"this",
|
|
298
|
+
"throw",
|
|
299
|
+
"throws",
|
|
300
|
+
"transient",
|
|
301
|
+
"true",
|
|
302
|
+
"try",
|
|
303
|
+
"typeof",
|
|
304
|
+
"var",
|
|
305
|
+
"void",
|
|
306
|
+
"volatile",
|
|
307
|
+
"while",
|
|
308
|
+
"with",
|
|
309
|
+
"yield",
|
|
310
|
+
"Array",
|
|
311
|
+
"Date",
|
|
312
|
+
"eval",
|
|
313
|
+
"function",
|
|
314
|
+
"hasOwnProperty",
|
|
315
|
+
"Infinity",
|
|
316
|
+
"isFinite",
|
|
317
|
+
"isNaN",
|
|
318
|
+
"isPrototypeOf",
|
|
319
|
+
"length",
|
|
320
|
+
"Math",
|
|
321
|
+
"name",
|
|
322
|
+
"NaN",
|
|
323
|
+
"Number",
|
|
324
|
+
"Object",
|
|
325
|
+
"prototype",
|
|
326
|
+
"String",
|
|
327
|
+
"toString",
|
|
328
|
+
"undefined",
|
|
329
|
+
"valueOf"
|
|
330
|
+
];
|
|
331
|
+
function transformReservedWord(word) {
|
|
332
|
+
if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
|
|
333
|
+
return `_${word}`;
|
|
334
|
+
}
|
|
335
|
+
return word;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// src/utils/transformers/combineCodes.ts
|
|
339
|
+
function combineCodes(codes) {
|
|
340
|
+
return codes.map((code) => code.replaceAll(/(^[ \t]*\n)/gm, "")).join("\n");
|
|
341
|
+
}
|
|
342
|
+
|
|
248
343
|
// src/utils/renderTemplate.ts
|
|
249
344
|
function renderTemplate(template, data = void 0) {
|
|
250
345
|
if (!data || !Object.keys(data).length) {
|
|
@@ -355,99 +450,6 @@ var TreeNode = class _TreeNode {
|
|
|
355
450
|
}
|
|
356
451
|
};
|
|
357
452
|
|
|
358
|
-
// src/utils/transformReservedWord.ts
|
|
359
|
-
var reservedWords = [
|
|
360
|
-
"abstract",
|
|
361
|
-
"arguments",
|
|
362
|
-
"boolean",
|
|
363
|
-
"break",
|
|
364
|
-
"byte",
|
|
365
|
-
"case",
|
|
366
|
-
"catch",
|
|
367
|
-
"char",
|
|
368
|
-
"class",
|
|
369
|
-
"const",
|
|
370
|
-
"continue",
|
|
371
|
-
"debugger",
|
|
372
|
-
"default",
|
|
373
|
-
"delete",
|
|
374
|
-
"do",
|
|
375
|
-
"double",
|
|
376
|
-
"else",
|
|
377
|
-
"enum",
|
|
378
|
-
"eval",
|
|
379
|
-
"export",
|
|
380
|
-
"extends",
|
|
381
|
-
"false",
|
|
382
|
-
"final",
|
|
383
|
-
"finally",
|
|
384
|
-
"float",
|
|
385
|
-
"for",
|
|
386
|
-
"function",
|
|
387
|
-
"goto",
|
|
388
|
-
"if",
|
|
389
|
-
"implements",
|
|
390
|
-
"import",
|
|
391
|
-
"in",
|
|
392
|
-
"instanceof",
|
|
393
|
-
"int",
|
|
394
|
-
"interface",
|
|
395
|
-
"let",
|
|
396
|
-
"long",
|
|
397
|
-
"native",
|
|
398
|
-
"new",
|
|
399
|
-
"null",
|
|
400
|
-
"package",
|
|
401
|
-
"private",
|
|
402
|
-
"protected",
|
|
403
|
-
"public",
|
|
404
|
-
"return",
|
|
405
|
-
"short",
|
|
406
|
-
"static",
|
|
407
|
-
"super",
|
|
408
|
-
"switch",
|
|
409
|
-
"synchronized",
|
|
410
|
-
"this",
|
|
411
|
-
"throw",
|
|
412
|
-
"throws",
|
|
413
|
-
"transient",
|
|
414
|
-
"true",
|
|
415
|
-
"try",
|
|
416
|
-
"typeof",
|
|
417
|
-
"var",
|
|
418
|
-
"void",
|
|
419
|
-
"volatile",
|
|
420
|
-
"while",
|
|
421
|
-
"with",
|
|
422
|
-
"yield",
|
|
423
|
-
"Array",
|
|
424
|
-
"Date",
|
|
425
|
-
"eval",
|
|
426
|
-
"function",
|
|
427
|
-
"hasOwnProperty",
|
|
428
|
-
"Infinity",
|
|
429
|
-
"isFinite",
|
|
430
|
-
"isNaN",
|
|
431
|
-
"isPrototypeOf",
|
|
432
|
-
"length",
|
|
433
|
-
"Math",
|
|
434
|
-
"name",
|
|
435
|
-
"NaN",
|
|
436
|
-
"Number",
|
|
437
|
-
"Object",
|
|
438
|
-
"prototype",
|
|
439
|
-
"String",
|
|
440
|
-
"toString",
|
|
441
|
-
"undefined",
|
|
442
|
-
"valueOf"
|
|
443
|
-
];
|
|
444
|
-
function transformReservedWord(word) {
|
|
445
|
-
if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
|
|
446
|
-
return `_${word}`;
|
|
447
|
-
}
|
|
448
|
-
return word;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
453
|
// src/utils/uniqueIdFactory.ts
|
|
452
454
|
var uniqueIdFactory = (counter) => (str = "") => `${str}${++counter}`;
|
|
453
455
|
var SLASHES = /* @__PURE__ */ new Set(["/", "\\"]);
|
|
@@ -1523,6 +1525,6 @@ var SchemaGenerator = class extends Generator {
|
|
|
1523
1525
|
// src/index.ts
|
|
1524
1526
|
var src_default = build;
|
|
1525
1527
|
|
|
1526
|
-
export { FileManager, Generator, LogLevel, ParallelPluginError, PluginError, PluginManager, Queue, SchemaGenerator, SummaryError, TreeNode, URLPath, ValidationPluginError, Warning, build, clean, combineFiles, createJSDocBlockText, createLogger, createPlugin, createPluginCache, src_default as default, defaultColours, defineConfig, extensions, getDependedPlugins, getEncodedText, getFileSource, getIndexes, getLocation, getPathMode, getRelativePath, getUniqueName, hooks, importModule, isExtensionAllowed, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, pluginName as name, nameSorter, normalizeDirectory, objectToParameters, pluginName, randomColour, randomPicoColour, read, renderTemplate, throttle, timeout, transformReservedWord, uniqueIdFactory, write };
|
|
1528
|
+
export { FileManager, Generator, LogLevel, ParallelPluginError, PluginError, PluginManager, Queue, SchemaGenerator, SummaryError, TreeNode, URLPath, ValidationPluginError, Warning, build, clean, combineCodes, combineFiles, createJSDocBlockText, createLogger, createPlugin, createPluginCache, src_default as default, defaultColours, defineConfig, extensions, getDependedPlugins, getEncodedText, getFileSource, getIndexes, getLocation, getPathMode, getRelativePath, getUniqueName, hooks, importModule, isExtensionAllowed, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, pluginName as name, nameSorter, normalizeDirectory, objectToParameters, pluginName, randomColour, randomPicoColour, read, renderTemplate, throttle, timeout, transformReservedWord, uniqueIdFactory, write };
|
|
1527
1529
|
//# sourceMappingURL=out.js.map
|
|
1528
1530
|
//# sourceMappingURL=index.js.map
|