@kubb/core 1.11.0-canary.20231011T142449 → 1.11.0-canary.20231011T172124
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 +14 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -16
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/index.d.cts +0 -767
package/dist/index.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { createRequire } from 'module';
|
|
1
|
+
import mod, { createRequire } from 'module';
|
|
2
2
|
import pc3 from 'picocolors';
|
|
3
3
|
export { default as pc } from 'picocolors';
|
|
4
|
-
import crypto from '
|
|
5
|
-
import pathParser2 from '
|
|
4
|
+
import crypto from 'crypto';
|
|
5
|
+
import pathParser2 from 'path';
|
|
6
6
|
import fs, { remove } from 'fs-extra';
|
|
7
7
|
import { switcher } from 'js-runtime';
|
|
8
8
|
import { camelCase, camelCaseTransformMerge } from 'change-case';
|
|
9
9
|
import { orderBy } from 'natural-orderby';
|
|
10
|
-
import { performance } from '
|
|
10
|
+
import { performance } from 'perf_hooks';
|
|
11
11
|
import dirTree from 'directory-tree';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { pathToFileURL } from 'node:url';
|
|
12
|
+
import os from 'os';
|
|
13
|
+
import { pathToFileURL } from 'url';
|
|
15
14
|
import seedrandom from 'seedrandom';
|
|
16
15
|
import { createImportDeclaration, print, createExportDeclaration } from '@kubb/ts-codegen';
|
|
17
16
|
import isEqual from 'lodash.isequal';
|
|
18
|
-
import { EventEmitter as EventEmitter$1 } from '
|
|
17
|
+
import { EventEmitter as EventEmitter$1 } from 'events';
|
|
19
18
|
|
|
20
19
|
createRequire(import.meta.url);
|
|
21
20
|
|
|
@@ -379,7 +378,11 @@ function renderTemplate(template, data = void 0) {
|
|
|
379
378
|
}
|
|
380
379
|
const matches = template.match(/{{(.*?)}}/g);
|
|
381
380
|
return matches?.reduce((prev, curr) => {
|
|
382
|
-
const
|
|
381
|
+
const index = curr.split(/{{|}}/).filter(Boolean)[0]?.trim();
|
|
382
|
+
if (index === void 0) {
|
|
383
|
+
return prev;
|
|
384
|
+
}
|
|
385
|
+
const value = data[index];
|
|
383
386
|
if (value === void 0) {
|
|
384
387
|
return prev;
|
|
385
388
|
}
|
|
@@ -783,14 +786,16 @@ function combineFiles(files) {
|
|
|
783
786
|
const prevIndex = acc.findIndex((item) => item.path === curr.path);
|
|
784
787
|
if (prevIndex !== -1) {
|
|
785
788
|
const prev = acc[prevIndex];
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
+
if (prev) {
|
|
790
|
+
acc[prevIndex] = {
|
|
791
|
+
...curr,
|
|
792
|
+
source: prev.source && curr.source ? `${prev.source}
|
|
789
793
|
${curr.source}` : "",
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
+
imports: [...prev.imports || [], ...curr.imports || []],
|
|
795
|
+
exports: [...prev.exports || [], ...curr.exports || []],
|
|
796
|
+
env: { ...prev.env || {}, ...curr.env || {} }
|
|
797
|
+
};
|
|
798
|
+
}
|
|
794
799
|
} else {
|
|
795
800
|
acc.push(curr);
|
|
796
801
|
}
|