@kubb/core 2.12.3 → 2.12.4
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/{chunk-IP732R22.js → chunk-2Y4CDLGB.js} +2 -2
- package/dist/{chunk-NKAOH4VT.js → chunk-34EEUDMU.js} +3 -3
- package/dist/{chunk-5I2ALFAS.js → chunk-4ZVQSQBZ.js} +2 -2
- package/dist/{chunk-F4TSJHGA.cjs → chunk-B74BR46M.cjs} +5 -5
- package/dist/chunk-BOZP7LG7.cjs +19 -0
- package/dist/{chunk-ZS3YTJ2L.cjs → chunk-CIEHBU2S.cjs} +3 -3
- package/dist/{chunk-EAM5RXNI.js → chunk-FBJJW6ME.js} +3 -3
- package/dist/{chunk-EAM5RXNI.js.map → chunk-FBJJW6ME.js.map} +1 -1
- package/dist/{chunk-FOWWV3PP.js → chunk-HCCIKTCT.js} +2 -2
- package/dist/{chunk-LHNV7GQH.cjs → chunk-HKRFUPZL.cjs} +7 -7
- package/dist/{chunk-YYCT7ZB7.cjs → chunk-I6E2RETY.cjs} +5 -5
- package/dist/{chunk-L2OHRGUS.js → chunk-KHDN54K7.js} +2 -2
- package/dist/{chunk-VPKB6WED.js → chunk-O7B2DCFM.js} +4 -4
- package/dist/{chunk-KXDRK6DY.js → chunk-P5JZAH44.js} +2 -2
- package/dist/{chunk-OVLOS3IJ.cjs → chunk-S7MSMKRT.cjs} +88 -88
- package/dist/{chunk-OPTGFWPQ.cjs → chunk-TDN4N77Q.cjs} +25 -25
- package/dist/{chunk-KPXUT3DG.cjs → chunk-VEW4PGF3.cjs} +5 -5
- package/dist/{chunk-KPXUT3DG.cjs.map → chunk-VEW4PGF3.cjs.map} +1 -1
- package/dist/{chunk-TTAE4JRW.cjs → chunk-WBPIU73P.cjs} +14 -14
- package/dist/{chunk-XHJKKPCO.js → chunk-WUHRZLUP.js} +3 -3
- package/dist/{chunk-4TB6NGOC.cjs → chunk-Y4IJPEUV.cjs} +3 -3
- package/dist/{chunk-4TB6NGOC.cjs.map → chunk-Y4IJPEUV.cjs.map} +1 -1
- package/dist/fs.cjs +7 -7
- package/dist/fs.js +4 -4
- package/dist/index.cjs +296 -296
- package/dist/index.js +9 -9
- package/dist/logger.cjs +5 -5
- package/dist/logger.js +3 -3
- package/dist/mocks.cjs +7 -7
- package/dist/mocks.js +3 -3
- package/dist/transformers.cjs +6 -6
- package/dist/transformers.js +4 -4
- package/dist/utils.cjs +26 -26
- package/dist/utils.js +4 -4
- package/package.json +6 -6
- package/dist/chunk-IBUMXAET.cjs +0 -19
- /package/dist/{chunk-IP732R22.js.map → chunk-2Y4CDLGB.js.map} +0 -0
- /package/dist/{chunk-NKAOH4VT.js.map → chunk-34EEUDMU.js.map} +0 -0
- /package/dist/{chunk-5I2ALFAS.js.map → chunk-4ZVQSQBZ.js.map} +0 -0
- /package/dist/{chunk-F4TSJHGA.cjs.map → chunk-B74BR46M.cjs.map} +0 -0
- /package/dist/{chunk-IBUMXAET.cjs.map → chunk-BOZP7LG7.cjs.map} +0 -0
- /package/dist/{chunk-ZS3YTJ2L.cjs.map → chunk-CIEHBU2S.cjs.map} +0 -0
- /package/dist/{chunk-FOWWV3PP.js.map → chunk-HCCIKTCT.js.map} +0 -0
- /package/dist/{chunk-LHNV7GQH.cjs.map → chunk-HKRFUPZL.cjs.map} +0 -0
- /package/dist/{chunk-YYCT7ZB7.cjs.map → chunk-I6E2RETY.cjs.map} +0 -0
- /package/dist/{chunk-L2OHRGUS.js.map → chunk-KHDN54K7.js.map} +0 -0
- /package/dist/{chunk-VPKB6WED.js.map → chunk-O7B2DCFM.js.map} +0 -0
- /package/dist/{chunk-KXDRK6DY.js.map → chunk-P5JZAH44.js.map} +0 -0
- /package/dist/{chunk-OVLOS3IJ.cjs.map → chunk-S7MSMKRT.cjs.map} +0 -0
- /package/dist/{chunk-OPTGFWPQ.cjs.map → chunk-TDN4N77Q.cjs.map} +0 -0
- /package/dist/{chunk-TTAE4JRW.cjs.map → chunk-WBPIU73P.cjs.map} +0 -0
- /package/dist/{chunk-XHJKKPCO.js.map → chunk-WUHRZLUP.js.map} +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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
|
|
3
|
+
var _chunkCIEHBU2Scjs = require('./chunk-CIEHBU2S.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkVEW4PGF3cjs = require('./chunk-VEW4PGF3.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkY4IJPEUVcjs = require('./chunk-Y4IJPEUV.cjs');
|
|
14
14
|
|
|
15
15
|
// ../../node_modules/.pnpm/lodash.tonumber@4.0.3/node_modules/lodash.tonumber/index.js
|
|
16
|
-
var require_lodash =
|
|
16
|
+
var require_lodash = _chunkY4IJPEUVcjs.__commonJS.call(void 0, {
|
|
17
17
|
"../../node_modules/.pnpm/lodash.tonumber@4.0.3/node_modules/lodash.tonumber/index.js"(exports, module) {
|
|
18
18
|
"use strict";
|
|
19
|
-
|
|
19
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
20
20
|
var NAN = 0 / 0;
|
|
21
21
|
var symbolTag = "[object Symbol]";
|
|
22
22
|
var reTrim = /^\s+|\s+$/g;
|
|
@@ -59,18 +59,18 @@ var require_lodash = _chunk4TB6NGOCcjs.__commonJS.call(void 0, {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// src/transformers/index.ts
|
|
62
|
-
|
|
63
|
-
var import_lodash3 =
|
|
62
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
63
|
+
var import_lodash3 = _chunkY4IJPEUVcjs.__toESM.call(void 0, require_lodash(), 1);
|
|
64
64
|
var _lodashmerge = require('lodash.merge'); var _lodashmerge2 = _interopRequireDefault(_lodashmerge);
|
|
65
65
|
|
|
66
66
|
// src/transformers/combineCodes.ts
|
|
67
|
-
|
|
67
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
68
68
|
function combineCodes(codes) {
|
|
69
69
|
return codes.join("\n");
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
// src/transformers/createJSDocBlockText.ts
|
|
73
|
-
|
|
73
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
74
74
|
function createJSDocBlockText({ comments }) {
|
|
75
75
|
const filteredComments = comments.filter(Boolean);
|
|
76
76
|
if (!filteredComments.length) {
|
|
@@ -82,7 +82,7 @@ function createJSDocBlockText({ comments }) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
// src/transformers/escape.ts
|
|
85
|
-
|
|
85
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
86
86
|
function escape(text) {
|
|
87
87
|
return text ? text.replaceAll("`", "\\`") : "";
|
|
88
88
|
}
|
|
@@ -108,13 +108,13 @@ function jsStringEscape(input) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
// src/transformers/indent.ts
|
|
111
|
-
|
|
111
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
112
112
|
function createIndent(size) {
|
|
113
113
|
return Array.from({ length: size + 1 }).join(" ");
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
// src/transformers/nameSorter.ts
|
|
117
|
-
|
|
117
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
118
118
|
function nameSorter(a, b) {
|
|
119
119
|
if (a.name < b.name) {
|
|
120
120
|
return -1;
|
|
@@ -126,7 +126,7 @@ function nameSorter(a, b) {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
// src/transformers/searchAndReplace.ts
|
|
129
|
-
|
|
129
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
130
130
|
function searchAndReplace(options) {
|
|
131
131
|
const { text, replaceBy, prefix = "", key } = options;
|
|
132
132
|
const searchValues = _optionalChain([options, 'access', _ => _.searchValues, 'optionalCall', _2 => _2(prefix, key)]) || [
|
|
@@ -144,10 +144,10 @@ function searchAndReplace(options) {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
// src/transformers/stringify.ts
|
|
147
|
-
|
|
147
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
148
148
|
|
|
149
149
|
// src/transformers/trim.ts
|
|
150
|
-
|
|
150
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
151
151
|
function trim(text) {
|
|
152
152
|
return text.replaceAll(/\n/g, "").trim();
|
|
153
153
|
}
|
|
@@ -187,8 +187,8 @@ function stringifyObject(value) {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
// src/transformers/toNumber.ts
|
|
190
|
-
|
|
191
|
-
var import_lodash =
|
|
190
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
191
|
+
var import_lodash = _chunkY4IJPEUVcjs.__toESM.call(void 0, require_lodash(), 1);
|
|
192
192
|
function isNumber(value) {
|
|
193
193
|
if (typeof value === "string") {
|
|
194
194
|
if (value === "") {
|
|
@@ -200,7 +200,7 @@ function isNumber(value) {
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
// src/transformers/toRegExp.ts
|
|
203
|
-
|
|
203
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
204
204
|
function stringToRegex(text) {
|
|
205
205
|
const isStartWithSlash = text.startsWith("/");
|
|
206
206
|
const isEndWithSlash = text.endsWith("/");
|
|
@@ -221,7 +221,7 @@ function toRegExpString(text) {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
// src/transformers/transformReservedWord.ts
|
|
224
|
-
|
|
224
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
225
225
|
var reservedWords = [
|
|
226
226
|
"abstract",
|
|
227
227
|
"arguments",
|
|
@@ -315,7 +315,7 @@ function transformReservedWord(word) {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
// src/transformers/index.ts
|
|
318
|
-
var import_lodash5 =
|
|
318
|
+
var import_lodash5 = _chunkY4IJPEUVcjs.__toESM.call(void 0, require_lodash(), 1);
|
|
319
319
|
|
|
320
320
|
var transformers_default = {
|
|
321
321
|
combineCodes,
|
|
@@ -337,11 +337,11 @@ var transformers_default = {
|
|
|
337
337
|
JSDoc: {
|
|
338
338
|
createJSDocBlockText
|
|
339
339
|
},
|
|
340
|
-
orderBy:
|
|
340
|
+
orderBy: _chunkCIEHBU2Scjs.orderBy,
|
|
341
341
|
merge: _lodashmerge2.default,
|
|
342
|
-
camelCase:
|
|
343
|
-
pascalCase:
|
|
344
|
-
pathCase:
|
|
342
|
+
camelCase: _chunkVEW4PGF3cjs.camelCase,
|
|
343
|
+
pascalCase: _chunkVEW4PGF3cjs.pascalCase,
|
|
344
|
+
pathCase: _chunkVEW4PGF3cjs.pathCase
|
|
345
345
|
};
|
|
346
346
|
|
|
347
347
|
|
|
@@ -365,4 +365,4 @@ var transformers_default = {
|
|
|
365
365
|
|
|
366
366
|
|
|
367
367
|
exports.trim = trim; exports.trimQuotes = trimQuotes; exports.trimExtName = trimExtName; exports.searchAndReplace = searchAndReplace; exports.combineCodes = combineCodes; exports.createJSDocBlockText = createJSDocBlockText; exports.escape = escape; exports.jsStringEscape = jsStringEscape; exports.createIndent = createIndent; exports.nameSorter = nameSorter; exports.stringify = stringify; exports.stringifyObject = stringifyObject; exports.isNumber = isNumber; exports.toRegExp = toRegExp; exports.toRegExpString = toRegExpString; exports.transformReservedWord = transformReservedWord; exports.transformers_default = transformers_default; exports.default = _lodashmerge2.default; exports.import_lodash = import_lodash5;
|
|
368
|
-
//# sourceMappingURL=chunk-
|
|
368
|
+
//# sourceMappingURL=chunk-TDN4N77Q.cjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
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
|
|
3
|
+
var _chunkY4IJPEUVcjs = require('./chunk-Y4IJPEUV.cjs');
|
|
4
4
|
|
|
5
5
|
// src/transformers/casing.ts
|
|
6
|
-
|
|
6
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/change-case@5.4.
|
|
9
|
-
|
|
8
|
+
// ../../node_modules/.pnpm/change-case@5.4.4/node_modules/change-case/dist/index.js
|
|
9
|
+
_chunkY4IJPEUVcjs.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;
|
|
@@ -140,4 +140,4 @@ function pathCase2(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
exports.camelCase = camelCase2; exports.pascalCase = pascalCase2; exports.pathCase = pathCase2;
|
|
143
|
-
//# sourceMappingURL=chunk-
|
|
143
|
+
//# sourceMappingURL=chunk-VEW4PGF3.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/transformers/casing.ts","../../../node_modules/.pnpm/change-case@5.4.3/node_modules/change-case/src/index.ts"],"names":["camelCase","pascalCase","pathCase"],"mappings":";;;;;AAAA;;;ACAA;AACA,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAG7B,IAAM,2BAA2B;AAGjC,IAAM,uBAAuB;AAG7B,IAAM,sBAAsB;AAG5B,IAAM,mCAAmC;AA+BnC,SAAU,MAAM,OAAa;AACjC,MAAI,SAAS,MAAM,KAAI;AAEvB,WAAS,OACN,QAAQ,sBAAsB,mBAAmB,EACjD,QAAQ,sBAAsB,mBAAmB;AAEpD,WAAS,OAAO,QAAQ,sBAAsB,IAAI;AAElD,MAAI,QAAQ;AACZ,MAAI,MAAM,OAAO;AAGjB,SAAO,OAAO,OAAO,KAAK,MAAM;AAAM;AACtC,MAAI,UAAU;AAAK,WAAO,CAAA;AAC1B,SAAO,OAAO,OAAO,MAAM,CAAC,MAAM;AAAM;AAExC,SAAO,OAAO,MAAM,OAAO,GAAG,EAAE,MAAM,KAAK;AAC7C;AAKM,SAAU,qBAAqB,OAAa;AAChD,QAAM,QAAQ,MAAM,KAAK;AACzB,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,OAAO,MAAM,CAAC;AACpB,UAAM,QAAQ,yBAAyB,KAAK,IAAI;AAChD,QAAI,OAAO;AACT,YAAM,SAAS,MAAM,SAAS,MAAM,CAAC,KAAK,MAAM,CAAC,G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ACV,UAAM,aAAa,KAAK,MAAM,GAAG;AACjC,WAAO,WAAW,IAAI,CAAC,MAAM,MAAO,MAAM,WAAW,SAAS,IAAIA,WAAU,MAAM,EAAE,QAAQ,OAAO,CAAC,IAAIA,WAAU,IAAI,CAAE,EAAE,KAAK,GAAG;AAAA,EACpI;AAEA,SAAO,UAAgB,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI;AAAA,IACpD,WAAW;AAAA,IACX,0BAA0B;AAAA,EAC5B,CAAC;AACH;AAEO,SAASC,YAAW,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,GAAG,IAAa,CAAC,GAAW;AACnG,MAAI,QAAQ;AACV,UAAM,aAAa,KAAK,MAAM,GAAG;AACjC,WAAO,WAAW,IAAI,CAAC,MAAM,MAAO,MAAM,WAAW,SAAS,IAAIA,YAAW,MAAM,EAAE,QAAQ,OAAO,CAAC,IAAID,WAAU,IAAI,CAAE,EAAE,KAAK,GAAG;AAAA,EACrI;AAEA,SAAO,WAAiB,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI;AAAA,IACrD,WAAW;AAAA,IACX,0BAA0B;AAAA,EAC5B,CAAC;AACH;AAEO,SAASE,UAAS,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,GAAG,IAAa,CAAC,GAAW;AACjG,MAAI,QAAQ;AACV,UAAM,aAAa,KAAK,MAAM,GAAG;AACjC,WAAO,WAAW,IAAI,CAAC,MAAM,MAAO,MAAM,WAAW,SAAS,IAAIA,UAAS,MAAM,EAAE,QAAQ,OAAO,CAAC,IAAIF,WAAU,IAAI,CAAE,EAAE,KAAK,GAAG;AAAA,EACnI;AAEA,SAAO,SAAe,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,EAAE,WAAW,GAAG,CAAC;AACxE","sourcesContent":["import { camelCase as changeCamelCase, pascalCase as changePascalCase, pathCase as changePathCase } from 'change-case'\n\ntype Options = {\n /**\n * When set it will replace all `.` with `/`.\n */\n isFile?: boolean\n prefix?: string\n suffix?: string\n}\n\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? camelCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return changeCamelCase(`${prefix} ${text} ${suffix}`, {\n delimiter: '',\n mergeAmbiguousCharacters: true,\n })\n}\n\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? pascalCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return changePascalCase(`${prefix} ${text} ${suffix}`, {\n delimiter: '',\n mergeAmbiguousCharacters: true,\n })\n}\n\nexport function pathCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? pathCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return changePathCase(`${prefix} ${text} ${suffix}`, { delimiter: '' })\n}\n","// Regexps involved with splitting words in various case formats.\nconst SPLIT_LOWER_UPPER_RE = /([\\p{Ll}\\d])(\\p{Lu})/gu;\nconst SPLIT_UPPER_UPPER_RE = /(\\p{Lu})([\\p{Lu}][\\p{Ll}])/gu;\n\n// Used to iterate over the initial split result and separate numbers.\nconst SPLIT_SEPARATE_NUMBER_RE = /(\\d)\\p{Ll}|(\\p{L})\\d/u;\n\n// Regexp involved with stripping non-word characters from the result.\nconst DEFAULT_STRIP_REGEXP = /[^\\p{L}\\d]+/giu;\n\n// The replacement value for splits.\nconst SPLIT_REPLACE_VALUE = \"$1\\0$2\";\n\n// The default characters to keep after transforming case.\nconst DEFAULT_PREFIX_SUFFIX_CHARACTERS = \"\";\n\n/**\n * Supported locale values. Use `false` to ignore locale.\n * Defaults to `undefined`, which uses the host environment.\n */\nexport type Locale = string[] | string | false | undefined;\n\n/**\n * Options used for converting strings to pascal/camel case.\n */\nexport interface PascalCaseOptions extends Options {\n mergeAmbiguousCharacters?: boolean;\n}\n\n/**\n * Options used for converting strings to any case.\n */\nexport interface Options {\n locale?: Locale;\n split?: (value: string) => string[];\n /** @deprecated Pass `split: splitSeparateNumbers` instead. */\n separateNumbers?: boolean;\n delimiter?: string;\n prefixCharacters?: string;\n suffixCharacters?: string;\n}\n\n/**\n * Split any cased input strings into an array of words.\n */\nexport function split(value: string) {\n let result = value.trim();\n\n result = result\n .replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE)\n .replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);\n\n result = result.replace(DEFAULT_STRIP_REGEXP, \"\\0\");\n\n let start = 0;\n let end = result.length;\n\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\") start++;\n if (start === end) return [];\n while (result.charAt(end - 1) === \"\\0\") end--;\n\n return result.slice(start, end).split(/\\0/g);\n}\n\n/**\n * Split the input string into an array of words, separating numbers.\n */\nexport function splitSeparateNumbers(value: string) {\n const words = split(value);\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);\n if (match) {\n const offset = match.index + (match[1] ?? match[2]).length;\n words.splice(i, 1, word.slice(0, offset), word.slice(offset));\n }\n }\n return words;\n}\n\n/**\n * Convert a string to space separated lower case (`foo bar`).\n */\nexport function noCase(input: string, options?: Options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (\n prefix +\n words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? \" \") +\n suffix\n );\n}\n\n/**\n * Convert a string to camel case (`fooBar`).\n */\nexport function camelCase(input: string, options?: PascalCaseOptions) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return (\n prefix +\n words\n .map((word, index) => {\n if (index === 0) return lower(word);\n return transform(word, index);\n })\n .join(options?.delimiter ?? \"\") +\n suffix\n );\n}\n\n/**\n * Convert a string to pascal case (`FooBar`).\n */\nexport function pascalCase(input: string, options?: PascalCaseOptions) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return prefix + words.map(transform).join(options?.delimiter ?? \"\") + suffix;\n}\n\n/**\n * Convert a string to pascal snake case (`Foo_Bar`).\n */\nexport function pascalSnakeCase(input: string, options?: Options) {\n return capitalCase(input, { delimiter: \"_\", ...options });\n}\n\n/**\n * Convert a string to capital case (`Foo Bar`).\n */\nexport function capitalCase(input: string, options?: Options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n return (\n prefix +\n words\n .map(capitalCaseTransformFactory(lower, upper))\n .join(options?.delimiter ?? \" \") +\n suffix\n );\n}\n\n/**\n * Convert a string to constant case (`FOO_BAR`).\n */\nexport function constantCase(input: string, options?: Options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (\n prefix +\n words.map(upperFactory(options?.locale)).join(options?.delimiter ?? \"_\") +\n suffix\n );\n}\n\n/**\n * Convert a string to dot case (`foo.bar`).\n */\nexport function dotCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \".\", ...options });\n}\n\n/**\n * Convert a string to kebab case (`foo-bar`).\n */\nexport function kebabCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \"-\", ...options });\n}\n\n/**\n * Convert a string to path case (`foo/bar`).\n */\nexport function pathCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \"/\", ...options });\n}\n\n/**\n * Convert a string to path case (`Foo bar`).\n */\nexport function sentenceCase(input: string, options?: Options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = capitalCaseTransformFactory(lower, upper);\n return (\n prefix +\n words\n .map((word, index) => {\n if (index === 0) return transform(word);\n return lower(word);\n })\n .join(options?.delimiter ?? \" \") +\n suffix\n );\n}\n\n/**\n * Convert a string to snake case (`foo_bar`).\n */\nexport function snakeCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \"_\", ...options });\n}\n\n/**\n * Convert a string to header case (`Foo-Bar`).\n */\nexport function trainCase(input: string, options?: Options) {\n return capitalCase(input, { delimiter: \"-\", ...options });\n}\n\nfunction lowerFactory(locale: Locale): (input: string) => string {\n return locale === false\n ? (input: string) => input.toLowerCase()\n : (input: string) => input.toLocaleLowerCase(locale);\n}\n\nfunction upperFactory(locale: Locale): (input: string) => string {\n return locale === false\n ? (input: string) => input.toUpperCase()\n : (input: string) => input.toLocaleUpperCase(locale);\n}\n\nfunction capitalCaseTransformFactory(\n lower: (input: string) => string,\n upper: (input: string) => string,\n) {\n return (word: string) => `${upper(word[0])}${lower(word.slice(1))}`;\n}\n\nfunction pascalCaseTransformFactory(\n lower: (input: string) => string,\n upper: (input: string) => string,\n) {\n return (word: string, index: number) => {\n const char0 = word[0];\n const initial =\n index > 0 && char0 >= \"0\" && char0 <= \"9\" ? \"_\" + char0 : upper(char0);\n return initial + lower(word.slice(1));\n };\n}\n\nfunction splitPrefixSuffix(\n input: string,\n options: Options = {},\n): [string, string[], string] {\n const splitFn =\n options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);\n const prefixCharacters =\n options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n const suffixCharacters =\n options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n let prefixIndex = 0;\n let suffixIndex = input.length;\n\n while (prefixIndex < input.length) {\n const char = input.charAt(prefixIndex);\n if (!prefixCharacters.includes(char)) break;\n prefixIndex++;\n }\n\n while (suffixIndex > prefixIndex) {\n const index = suffixIndex - 1;\n const char = input.charAt(index);\n if (!suffixCharacters.includes(char)) break;\n suffixIndex = index;\n }\n\n return [\n input.slice(0, prefixIndex),\n splitFn(input.slice(prefixIndex, suffixIndex)),\n input.slice(suffixIndex),\n ];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/transformers/casing.ts","../../../node_modules/.pnpm/change-case@5.4.4/node_modules/change-case/src/index.ts"],"names":["camelCase","pascalCase","pathCase"],"mappings":";;;;;AAAA;;;ACAA;AACA,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAG7B,IAAM,2BAA2B;AAGjC,IAAM,uBAAuB;AAG7B,IAAM,sBAAsB;AAG5B,IAAM,mCAAmC;AA+BnC,SAAU,MAAM,OAAa;AACjC,MAAI,SAAS,MAAM,KAAI;AAEvB,WAAS,OACN,QAAQ,sBAAsB,mBAAmB,EACjD,QAAQ,sBAAsB,mBAAmB;AAEpD,WAAS,OAAO,QAAQ,sBAAsB,IAAI;AAElD,MAAI,QAAQ;AACZ,MAAI,MAAM,OAAO;AAGjB,SAAO,OAAO,OAAO,KAAK,MAAM;AAAM;AACtC,MAAI,UAAU;AAAK,WAAO,CAAA;AAC1B,SAAO,OAAO,OAAO,MAAM,CAAC,MAAM;AAAM;AAExC,SAAO,OAAO,MAAM,OAAO,GAAG,EAAE,MAAM,KAAK;AAC7C;AAKM,SAAU,qBAAqB,OAAa;AAChD,QAAM,QAAQ,MAAM,KAAK;AACzB,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,OAAO,MAAM,CAAC;AACpB,UAAM,QAAQ,yBAAyB,KAAK,IAAI;AAChD,QAAI,OAAO;AACT,YAAM,SAAS,MAAM,SAAS,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG;AACpD,YAAM,OAAO,GAAG,GAAG,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,MAAM,MAAM,CAAC;;;AAGhE,SAAO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AU,MAAM,EAAE,QAAQ,OAAO,CAAC,IAAIA,WAAU,IAAI,CAAE,EAAE,KAAK,GAAG;AAAA,EACpI;AAEA,SAAO,UAAgB,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI;AAAA,IACpD,WAAW;AAAA,IACX,0BAA0B;AAAA,EAC5B,CAAC;AACH;AAEO,SAASC,YAAW,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,GAAG,IAAa,CAAC,GAAW;AACnG,MAAI,QAAQ;AACV,UAAM,aAAa,KAAK,MAAM,GAAG;AACjC,WAAO,WAAW,IAAI,CAAC,MAAM,MAAO,MAAM,WAAW,SAAS,IAAIA,YAAW,MAAM,EAAE,QAAQ,OAAO,CAAC,IAAID,WAAU,IAAI,CAAE,EAAE,KAAK,GAAG;AAAA,EACrI;AAEA,SAAO,WAAiB,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI;AAAA,IACrD,WAAW;AAAA,IACX,0BAA0B;AAAA,EAC5B,CAAC;AACH;AAEO,SAASE,UAAS,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,GAAG,IAAa,CAAC,GAAW;AACjG,MAAI,QAAQ;AACV,UAAM,aAAa,KAAK,MAAM,GAAG;AACjC,WAAO,WAAW,IAAI,CAAC,MAAM,MAAO,MAAM,WAAW,SAAS,IAAIA,UAAS,MAAM,EAAE,QAAQ,OAAO,CAAC,IAAIF,WAAU,IAAI,CAAE,EAAE,KAAK,GAAG;AAAA,EACnI;AAEA,SAAO,SAAe,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,EAAE,WAAW,GAAG,CAAC;AACxE","sourcesContent":["import { camelCase as changeCamelCase, pascalCase as changePascalCase, pathCase as changePathCase } from 'change-case'\n\ntype Options = {\n /**\n * When set it will replace all `.` with `/`.\n */\n isFile?: boolean\n prefix?: string\n suffix?: string\n}\n\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? camelCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return changeCamelCase(`${prefix} ${text} ${suffix}`, {\n delimiter: '',\n mergeAmbiguousCharacters: true,\n })\n}\n\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? pascalCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return changePascalCase(`${prefix} ${text} ${suffix}`, {\n delimiter: '',\n mergeAmbiguousCharacters: true,\n })\n}\n\nexport function pathCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? pathCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return changePathCase(`${prefix} ${text} ${suffix}`, { delimiter: '' })\n}\n","// Regexps involved with splitting words in various case formats.\nconst SPLIT_LOWER_UPPER_RE = /([\\p{Ll}\\d])(\\p{Lu})/gu;\nconst SPLIT_UPPER_UPPER_RE = /(\\p{Lu})([\\p{Lu}][\\p{Ll}])/gu;\n\n// Used to iterate over the initial split result and separate numbers.\nconst SPLIT_SEPARATE_NUMBER_RE = /(\\d)\\p{Ll}|(\\p{L})\\d/u;\n\n// Regexp involved with stripping non-word characters from the result.\nconst DEFAULT_STRIP_REGEXP = /[^\\p{L}\\d]+/giu;\n\n// The replacement value for splits.\nconst SPLIT_REPLACE_VALUE = \"$1\\0$2\";\n\n// The default characters to keep after transforming case.\nconst DEFAULT_PREFIX_SUFFIX_CHARACTERS = \"\";\n\n/**\n * Supported locale values. Use `false` to ignore locale.\n * Defaults to `undefined`, which uses the host environment.\n */\nexport type Locale = string[] | string | false | undefined;\n\n/**\n * Options used for converting strings to pascal/camel case.\n */\nexport interface PascalCaseOptions extends Options {\n mergeAmbiguousCharacters?: boolean;\n}\n\n/**\n * Options used for converting strings to any case.\n */\nexport interface Options {\n locale?: Locale;\n split?: (value: string) => string[];\n /** @deprecated Pass `split: splitSeparateNumbers` instead. */\n separateNumbers?: boolean;\n delimiter?: string;\n prefixCharacters?: string;\n suffixCharacters?: string;\n}\n\n/**\n * Split any cased input strings into an array of words.\n */\nexport function split(value: string) {\n let result = value.trim();\n\n result = result\n .replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE)\n .replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);\n\n result = result.replace(DEFAULT_STRIP_REGEXP, \"\\0\");\n\n let start = 0;\n let end = result.length;\n\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\") start++;\n if (start === end) return [];\n while (result.charAt(end - 1) === \"\\0\") end--;\n\n return result.slice(start, end).split(/\\0/g);\n}\n\n/**\n * Split the input string into an array of words, separating numbers.\n */\nexport function splitSeparateNumbers(value: string) {\n const words = split(value);\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);\n if (match) {\n const offset = match.index + (match[1] ?? match[2]).length;\n words.splice(i, 1, word.slice(0, offset), word.slice(offset));\n }\n }\n return words;\n}\n\n/**\n * Convert a string to space separated lower case (`foo bar`).\n */\nexport function noCase(input: string, options?: Options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (\n prefix +\n words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? \" \") +\n suffix\n );\n}\n\n/**\n * Convert a string to camel case (`fooBar`).\n */\nexport function camelCase(input: string, options?: PascalCaseOptions) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return (\n prefix +\n words\n .map((word, index) => {\n if (index === 0) return lower(word);\n return transform(word, index);\n })\n .join(options?.delimiter ?? \"\") +\n suffix\n );\n}\n\n/**\n * Convert a string to pascal case (`FooBar`).\n */\nexport function pascalCase(input: string, options?: PascalCaseOptions) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return prefix + words.map(transform).join(options?.delimiter ?? \"\") + suffix;\n}\n\n/**\n * Convert a string to pascal snake case (`Foo_Bar`).\n */\nexport function pascalSnakeCase(input: string, options?: Options) {\n return capitalCase(input, { delimiter: \"_\", ...options });\n}\n\n/**\n * Convert a string to capital case (`Foo Bar`).\n */\nexport function capitalCase(input: string, options?: Options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n return (\n prefix +\n words\n .map(capitalCaseTransformFactory(lower, upper))\n .join(options?.delimiter ?? \" \") +\n suffix\n );\n}\n\n/**\n * Convert a string to constant case (`FOO_BAR`).\n */\nexport function constantCase(input: string, options?: Options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (\n prefix +\n words.map(upperFactory(options?.locale)).join(options?.delimiter ?? \"_\") +\n suffix\n );\n}\n\n/**\n * Convert a string to dot case (`foo.bar`).\n */\nexport function dotCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \".\", ...options });\n}\n\n/**\n * Convert a string to kebab case (`foo-bar`).\n */\nexport function kebabCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \"-\", ...options });\n}\n\n/**\n * Convert a string to path case (`foo/bar`).\n */\nexport function pathCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \"/\", ...options });\n}\n\n/**\n * Convert a string to path case (`Foo bar`).\n */\nexport function sentenceCase(input: string, options?: Options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = capitalCaseTransformFactory(lower, upper);\n return (\n prefix +\n words\n .map((word, index) => {\n if (index === 0) return transform(word);\n return lower(word);\n })\n .join(options?.delimiter ?? \" \") +\n suffix\n );\n}\n\n/**\n * Convert a string to snake case (`foo_bar`).\n */\nexport function snakeCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \"_\", ...options });\n}\n\n/**\n * Convert a string to header case (`Foo-Bar`).\n */\nexport function trainCase(input: string, options?: Options) {\n return capitalCase(input, { delimiter: \"-\", ...options });\n}\n\nfunction lowerFactory(locale: Locale): (input: string) => string {\n return locale === false\n ? (input: string) => input.toLowerCase()\n : (input: string) => input.toLocaleLowerCase(locale);\n}\n\nfunction upperFactory(locale: Locale): (input: string) => string {\n return locale === false\n ? (input: string) => input.toUpperCase()\n : (input: string) => input.toLocaleUpperCase(locale);\n}\n\nfunction capitalCaseTransformFactory(\n lower: (input: string) => string,\n upper: (input: string) => string,\n) {\n return (word: string) => `${upper(word[0])}${lower(word.slice(1))}`;\n}\n\nfunction pascalCaseTransformFactory(\n lower: (input: string) => string,\n upper: (input: string) => string,\n) {\n return (word: string, index: number) => {\n const char0 = word[0];\n const initial =\n index > 0 && char0 >= \"0\" && char0 <= \"9\" ? \"_\" + char0 : upper(char0);\n return initial + lower(word.slice(1));\n };\n}\n\nfunction splitPrefixSuffix(\n input: string,\n options: Options = {},\n): [string, string[], string] {\n const splitFn =\n options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);\n const prefixCharacters =\n options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n const suffixCharacters =\n options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n let prefixIndex = 0;\n let suffixIndex = input.length;\n\n while (prefixIndex < input.length) {\n const char = input.charAt(prefixIndex);\n if (!prefixCharacters.includes(char)) break;\n prefixIndex++;\n }\n\n while (suffixIndex > prefixIndex) {\n const index = suffixIndex - 1;\n const char = input.charAt(index);\n if (!suffixCharacters.includes(char)) break;\n suffixIndex = index;\n }\n\n return [\n input.slice(0, prefixIndex),\n splitFn(input.slice(prefixIndex, suffixIndex)),\n input.slice(suffixIndex),\n ];\n}\n"]}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkI6E2RETYcjs = require('./chunk-I6E2RETY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkY4IJPEUVcjs = require('./chunk-Y4IJPEUV.cjs');
|
|
9
9
|
|
|
10
10
|
// src/logger.ts
|
|
11
|
-
|
|
11
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
12
12
|
var _seedrandom = require('seedrandom'); var _seedrandom2 = _interopRequireDefault(_seedrandom);
|
|
13
13
|
|
|
14
14
|
// ../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/node.js
|
|
15
|
-
|
|
15
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
16
16
|
|
|
17
17
|
// ../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/chunk-5WCZOS7T.js
|
|
18
|
-
|
|
18
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
19
19
|
var b = {
|
|
20
20
|
reset: [0, 0],
|
|
21
21
|
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
@@ -80,25 +80,25 @@ var _tty = require('tty');
|
|
|
80
80
|
var p2 = w(_tty.isatty.call(void 0, 1));
|
|
81
81
|
|
|
82
82
|
// src/utils/EventEmitter.ts
|
|
83
|
-
|
|
83
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
84
84
|
var _events = require('events');
|
|
85
85
|
var _emitter;
|
|
86
86
|
var EventEmitter = class {
|
|
87
87
|
constructor() {
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
_chunkY4IJPEUVcjs.__privateAdd.call(void 0, this, _emitter, new (0, _events.EventEmitter)());
|
|
89
|
+
_chunkY4IJPEUVcjs.__privateGet.call(void 0, this, _emitter).setMaxListeners(100);
|
|
90
90
|
}
|
|
91
91
|
emit(eventName, ...eventArg) {
|
|
92
|
-
|
|
92
|
+
_chunkY4IJPEUVcjs.__privateGet.call(void 0, this, _emitter).emit(eventName, ...eventArg);
|
|
93
93
|
}
|
|
94
94
|
on(eventName, handler) {
|
|
95
|
-
|
|
95
|
+
_chunkY4IJPEUVcjs.__privateGet.call(void 0, this, _emitter).on(eventName, handler);
|
|
96
96
|
}
|
|
97
97
|
off(eventName, handler) {
|
|
98
|
-
|
|
98
|
+
_chunkY4IJPEUVcjs.__privateGet.call(void 0, this, _emitter).off(eventName, handler);
|
|
99
99
|
}
|
|
100
100
|
removeAll() {
|
|
101
|
-
|
|
101
|
+
_chunkY4IJPEUVcjs.__privateGet.call(void 0, this, _emitter).removeAllListeners();
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
_emitter = new WeakMap();
|
|
@@ -134,7 +134,7 @@ function createLogger({ logLevel, name, spinner }) {
|
|
|
134
134
|
});
|
|
135
135
|
events.on("debug", async (messages) => {
|
|
136
136
|
if (logLevel === LogLevel.debug) {
|
|
137
|
-
await
|
|
137
|
+
await _chunkI6E2RETYcjs.writeLog.call(void 0, messages.join("\n"));
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
const logger = {
|
|
@@ -185,4 +185,4 @@ function randomCliColour(text, colors = defaultColours) {
|
|
|
185
185
|
|
|
186
186
|
|
|
187
187
|
exports.p = p2; exports.EventEmitter = EventEmitter; exports.LogLevel = LogLevel; exports.createLogger = createLogger; exports.randomColour = randomColour; exports.randomCliColour = randomCliColour;
|
|
188
|
-
//# sourceMappingURL=chunk-
|
|
188
|
+
//# sourceMappingURL=chunk-WBPIU73P.cjs.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writeLog
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KHDN54K7.js";
|
|
4
4
|
import {
|
|
5
5
|
__privateAdd,
|
|
6
6
|
__privateGet,
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FBJJW6ME.js";
|
|
9
9
|
|
|
10
10
|
// src/logger.ts
|
|
11
11
|
init_esm_shims();
|
|
@@ -185,4 +185,4 @@ export {
|
|
|
185
185
|
randomColour,
|
|
186
186
|
randomCliColour
|
|
187
187
|
};
|
|
188
|
-
//# sourceMappingURL=chunk-
|
|
188
|
+
//# sourceMappingURL=chunk-WUHRZLUP.js.map
|
|
@@ -69,9 +69,9 @@ var __privateMethod = (obj, member, method) => {
|
|
|
69
69
|
return method;
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
// ../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.0_ts-node@10.9.2_typescript@5.4.
|
|
72
|
+
// ../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.0_ts-node@10.9.2_typescript@5.4.4/node_modules/tsup/assets/cjs_shims.js
|
|
73
73
|
var init_cjs_shims = __esm({
|
|
74
|
-
"../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.0_ts-node@10.9.2_typescript@5.4.
|
|
74
|
+
"../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.0_ts-node@10.9.2_typescript@5.4.4/node_modules/tsup/assets/cjs_shims.js"() {
|
|
75
75
|
"use strict";
|
|
76
76
|
}
|
|
77
77
|
});
|
|
@@ -88,4 +88,4 @@ var init_cjs_shims = __esm({
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
exports.__require = __require; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__publicField = __publicField; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateWrapper = __privateWrapper; exports.__privateMethod = __privateMethod; exports.init_cjs_shims = init_cjs_shims;
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
91
|
+
//# sourceMappingURL=chunk-Y4IJPEUV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.0_ts-node@10.9.2_typescript@5.4.
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.0_ts-node@10.9.2_typescript@5.4.4/node_modules/tsup/assets/cjs_shims.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL('file:' + __filename).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n"]}
|
package/dist/fs.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBOZP7LG7cjs = require('./chunk-BOZP7LG7.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkI6E2RETYcjs = require('./chunk-I6E2RETY.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
11
|
+
var _chunkB74BR46Mcjs = require('./chunk-B74BR46M.cjs');
|
|
12
|
+
require('./chunk-S7MSMKRT.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkY4IJPEUVcjs = require('./chunk-Y4IJPEUV.cjs');
|
|
16
16
|
|
|
17
17
|
// src/fs/index.ts
|
|
18
|
-
|
|
18
|
+
_chunkY4IJPEUVcjs.init_cjs_shims.call(void 0, );
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.clean =
|
|
25
|
+
exports.clean = _chunkBOZP7LG7cjs.clean; exports.getRelativePath = _chunkB74BR46Mcjs.getRelativePath; exports.read = _chunkB74BR46Mcjs.read; exports.readSync = _chunkB74BR46Mcjs.readSync; exports.write = _chunkI6E2RETYcjs.write;
|
|
26
26
|
//# sourceMappingURL=fs.cjs.map
|
package/dist/fs.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clean
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P5JZAH44.js";
|
|
4
4
|
import {
|
|
5
5
|
write
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KHDN54K7.js";
|
|
7
7
|
import {
|
|
8
8
|
getRelativePath,
|
|
9
9
|
read,
|
|
10
10
|
readSync
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4ZVQSQBZ.js";
|
|
12
12
|
import {
|
|
13
13
|
init_esm_shims
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FBJJW6ME.js";
|
|
15
15
|
|
|
16
16
|
// src/fs/index.ts
|
|
17
17
|
init_esm_shims();
|