@kubb/core 2.9.0 → 2.10.0
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-CUO3T7RA.cjs → chunk-4GE2JRAA.cjs} +6 -6
- package/dist/{chunk-DJLNT4KC.cjs → chunk-4TB6NGOC.cjs} +3 -3
- package/dist/{chunk-DJLNT4KC.cjs.map → chunk-4TB6NGOC.cjs.map} +1 -1
- package/dist/{chunk-XDO5ZSKZ.js → chunk-5I2ALFAS.js} +2 -2
- package/dist/{chunk-WRGVBPK2.js → chunk-5OFHZEYU.js} +3 -3
- package/dist/{chunk-JPSCPXBD.js → chunk-B7DTFNR4.js} +2 -2
- package/dist/{chunk-AXZ52CY2.cjs → chunk-BIRURRYX.cjs} +222 -220
- package/dist/chunk-BIRURRYX.cjs.map +1 -0
- package/dist/chunk-DOELQNBO.cjs +455 -0
- package/dist/chunk-DOELQNBO.cjs.map +1 -0
- package/dist/{chunk-77TYOFGF.js → chunk-EAM5RXNI.js} +3 -3
- package/dist/{chunk-77TYOFGF.js.map → chunk-EAM5RXNI.js.map} +1 -1
- package/dist/{chunk-6KNLOEZF.js → chunk-EW6JZF2J.js} +10 -8
- package/dist/{chunk-6KNLOEZF.js.map → chunk-EW6JZF2J.js.map} +1 -1
- package/dist/{chunk-ZJ6GI35A.cjs → chunk-EWN2JRW3.cjs} +14 -14
- package/dist/{chunk-AHK6WOW6.js → chunk-G7EQ47A4.js} +3 -3
- package/dist/{chunk-L3XMZMJ5.js → chunk-H7U5WQ3I.js} +15 -2
- package/dist/chunk-H7U5WQ3I.js.map +1 -0
- package/dist/{chunk-XXN4BH6X.cjs → chunk-KOQSM5X7.cjs} +19 -6
- package/dist/chunk-KOQSM5X7.cjs.map +1 -0
- package/dist/{chunk-SEATGNQM.js → chunk-KXDRK6DY.js} +2 -2
- package/dist/{chunk-X2JM3GAC.cjs → chunk-TJHTFTXA.cjs} +90 -90
- package/dist/{chunk-GNWOOGXA.cjs → chunk-UUBXTHJG.cjs} +3 -3
- package/dist/{chunk-J2ES4PYI.js → chunk-UYADU5OY.js} +2 -2
- package/dist/{chunk-IXCRUQPC.cjs → chunk-WAIHMG76.cjs} +5 -5
- package/dist/chunk-WXV3UNEP.js +353 -0
- package/dist/chunk-WXV3UNEP.js.map +1 -0
- package/dist/chunk-XZZ2F3LK.cjs +19 -0
- package/dist/fs.cjs +6 -6
- package/dist/fs.js +4 -4
- package/dist/index.cjs +96 -96
- package/dist/index.js +10 -10
- package/dist/logger.cjs +4 -4
- package/dist/logger.js +3 -3
- package/dist/mocks.cjs +11 -11
- package/dist/mocks.js +8 -8
- package/dist/transformers.cjs +134 -18
- package/dist/transformers.cjs.map +1 -1
- package/dist/transformers.d.cts +31 -1
- package/dist/transformers.d.ts +31 -1
- package/dist/transformers.js +121 -5
- package/dist/transformers.js.map +1 -1
- package/dist/utils.cjs +27 -27
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +6 -6
- package/dist/utils.js.map +1 -1
- package/package.json +10 -5
- package/src/transformers/escape.ts +12 -0
- package/src/transformers/index.ts +23 -2
- package/src/transformers/stringify.ts +8 -0
- package/src/transformers/toNumber.ts +12 -0
- package/src/transformers/toRegExp.ts +35 -0
- package/src/transformers/trim.ts +15 -0
- package/dist/chunk-AWUFUNOJ.cjs +0 -137
- package/dist/chunk-AWUFUNOJ.cjs.map +0 -1
- package/dist/chunk-AXZ52CY2.cjs.map +0 -1
- package/dist/chunk-EXBYWEC2.cjs +0 -19
- package/dist/chunk-L3XMZMJ5.js.map +0 -1
- package/dist/chunk-SV7GUBBD.js +0 -35
- package/dist/chunk-SV7GUBBD.js.map +0 -1
- package/dist/chunk-XXN4BH6X.cjs.map +0 -1
- /package/dist/{chunk-CUO3T7RA.cjs.map → chunk-4GE2JRAA.cjs.map} +0 -0
- /package/dist/{chunk-XDO5ZSKZ.js.map → chunk-5I2ALFAS.js.map} +0 -0
- /package/dist/{chunk-WRGVBPK2.js.map → chunk-5OFHZEYU.js.map} +0 -0
- /package/dist/{chunk-JPSCPXBD.js.map → chunk-B7DTFNR4.js.map} +0 -0
- /package/dist/{chunk-ZJ6GI35A.cjs.map → chunk-EWN2JRW3.cjs.map} +0 -0
- /package/dist/{chunk-AHK6WOW6.js.map → chunk-G7EQ47A4.js.map} +0 -0
- /package/dist/{chunk-SEATGNQM.js.map → chunk-KXDRK6DY.js.map} +0 -0
- /package/dist/{chunk-X2JM3GAC.cjs.map → chunk-TJHTFTXA.cjs.map} +0 -0
- /package/dist/{chunk-GNWOOGXA.cjs.map → chunk-UUBXTHJG.cjs.map} +0 -0
- /package/dist/{chunk-J2ES4PYI.js.map → chunk-UYADU5OY.js.map} +0 -0
- /package/dist/{chunk-IXCRUQPC.cjs.map → chunk-WAIHMG76.cjs.map} +0 -0
- /package/dist/{chunk-EXBYWEC2.cjs.map → chunk-XZZ2F3LK.cjs.map} +0 -0
package/dist/utils.cjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
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 _chunk4GE2JRAAcjs = require('./chunk-4GE2JRAA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkUUBXTHJGcjs = require('./chunk-UUBXTHJG.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var _chunkAWUFUNOJcjs = require('./chunk-AWUFUNOJ.cjs');
|
|
11
10
|
|
|
11
|
+
var _chunkDOELQNBOcjs = require('./chunk-DOELQNBO.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
var _chunk4TB6NGOCcjs = require('./chunk-4TB6NGOC.cjs');
|
|
17
18
|
|
|
18
19
|
// src/utils/index.ts
|
|
19
|
-
|
|
20
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
20
21
|
|
|
21
22
|
// src/utils/FunctionParams.ts
|
|
22
|
-
|
|
23
|
-
var _naturalorderby = require('natural-orderby');
|
|
23
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
24
24
|
var _items, _orderItems, orderItems_fn, _addParams, addParams_fn;
|
|
25
25
|
var _FunctionParams = class _FunctionParams {
|
|
26
26
|
constructor(type) {
|
|
27
|
-
|
|
27
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _items, []);
|
|
28
28
|
this.type = type;
|
|
29
29
|
return this;
|
|
30
30
|
}
|
|
31
31
|
get items() {
|
|
32
|
-
return
|
|
32
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _items).flat();
|
|
33
33
|
}
|
|
34
34
|
add(item) {
|
|
35
35
|
if (!item) {
|
|
36
36
|
return this;
|
|
37
37
|
}
|
|
38
38
|
if (Array.isArray(item)) {
|
|
39
|
-
item.filter(Boolean).forEach((it) =>
|
|
39
|
+
item.filter(Boolean).forEach((it) => _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _items).push(it));
|
|
40
40
|
return this;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _items).push(item);
|
|
43
43
|
return this;
|
|
44
44
|
}
|
|
45
45
|
static toObject(items) {
|
|
@@ -49,9 +49,9 @@ var _FunctionParams = class _FunctionParams {
|
|
|
49
49
|
const required = _nullishCoalesce(items.every((item) => item.required), () => ( true));
|
|
50
50
|
items.forEach((item) => {
|
|
51
51
|
var _a, _b;
|
|
52
|
-
name =
|
|
52
|
+
name = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, _a = _FunctionParams, _addParams, addParams_fn).call(_a, name, { ...item, type: void 0 });
|
|
53
53
|
if (items.some((item2) => item2.type)) {
|
|
54
|
-
type =
|
|
54
|
+
type = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, _b = _FunctionParams, _addParams, addParams_fn).call(_b, type, item);
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
return {
|
|
@@ -62,32 +62,32 @@ var _FunctionParams = class _FunctionParams {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
static toString(items) {
|
|
65
|
-
const sortedData =
|
|
65
|
+
const sortedData = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _orderItems, orderItems_fn).call(this, items);
|
|
66
66
|
return sortedData.reduce((acc, item) => {
|
|
67
67
|
var _a, _b;
|
|
68
68
|
if (Array.isArray(item)) {
|
|
69
|
-
const subItems =
|
|
69
|
+
const subItems = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _orderItems, orderItems_fn).call(this, item);
|
|
70
70
|
const objectItem = _FunctionParams.toObject(subItems);
|
|
71
|
-
return
|
|
71
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, _a = _FunctionParams, _addParams, addParams_fn).call(_a, acc, objectItem);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, _b = _FunctionParams, _addParams, addParams_fn).call(_b, acc, item);
|
|
74
74
|
}, []).join(", ");
|
|
75
75
|
}
|
|
76
76
|
toObject() {
|
|
77
77
|
var _a;
|
|
78
|
-
const items =
|
|
78
|
+
const items = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, _a = _FunctionParams, _orderItems, orderItems_fn).call(_a, _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _items)).flat();
|
|
79
79
|
return _FunctionParams.toObject(items);
|
|
80
80
|
}
|
|
81
81
|
toString() {
|
|
82
82
|
var _a;
|
|
83
|
-
const items =
|
|
83
|
+
const items = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, _a = _FunctionParams, _orderItems, orderItems_fn).call(_a, _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _items));
|
|
84
84
|
return _FunctionParams.toString(items);
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
_items = new WeakMap();
|
|
88
88
|
_orderItems = new WeakSet();
|
|
89
89
|
orderItems_fn = function(items) {
|
|
90
|
-
return
|
|
90
|
+
return _chunkDOELQNBOcjs.orderBy.call(void 0, items.filter(Boolean), [
|
|
91
91
|
(v) => {
|
|
92
92
|
if (Array.isArray(v)) {
|
|
93
93
|
return void 0;
|
|
@@ -115,7 +115,7 @@ addParams_fn = function(acc, item) {
|
|
|
115
115
|
acc.push(`${type}${rest.default ? ` = ${rest.default}` : ""}`);
|
|
116
116
|
return acc;
|
|
117
117
|
}
|
|
118
|
-
const parameterName = name.startsWith("{") ? name :
|
|
118
|
+
const parameterName = name.startsWith("{") ? name : _chunkDOELQNBOcjs.camelCase.call(void 0, name);
|
|
119
119
|
if (type) {
|
|
120
120
|
if (required) {
|
|
121
121
|
acc.push(`${parameterName}: ${type}${rest.default ? ` = ${rest.default}` : ""}`);
|
|
@@ -127,12 +127,12 @@ addParams_fn = function(acc, item) {
|
|
|
127
127
|
}
|
|
128
128
|
return acc;
|
|
129
129
|
};
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, _FunctionParams, _orderItems);
|
|
131
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, _FunctionParams, _addParams);
|
|
132
132
|
var FunctionParams = _FunctionParams;
|
|
133
133
|
|
|
134
134
|
// src/utils/promise.ts
|
|
135
|
-
|
|
135
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
136
136
|
function isPromise(result) {
|
|
137
137
|
return !!result && typeof _optionalChain([result, 'optionalAccess', _4 => _4.then]) === "function";
|
|
138
138
|
}
|
|
@@ -144,7 +144,7 @@ function isPromiseRejectedResult(result) {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
// src/utils/renderTemplate.ts
|
|
147
|
-
|
|
147
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
148
148
|
function renderTemplate(template, data = void 0) {
|
|
149
149
|
if (!data || !Object.keys(data).length) {
|
|
150
150
|
return template.replace(/{{(.*?)}}/g, "");
|
|
@@ -169,7 +169,7 @@ function renderTemplate(template, data = void 0) {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
// src/utils/timeout.ts
|
|
172
|
-
|
|
172
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
173
173
|
async function timeout(ms) {
|
|
174
174
|
return new Promise((resolve) => {
|
|
175
175
|
setTimeout(() => {
|
|
@@ -187,5 +187,5 @@ async function timeout(ms) {
|
|
|
187
187
|
|
|
188
188
|
|
|
189
189
|
|
|
190
|
-
exports.FunctionParams = FunctionParams; exports.URLPath =
|
|
190
|
+
exports.FunctionParams = FunctionParams; exports.URLPath = _chunk4GE2JRAAcjs.URLPath; exports.getUniqueName = _chunkUUBXTHJGcjs.getUniqueName; exports.isPromise = isPromise; exports.isPromiseFulfilledResult = isPromiseFulfilledResult; exports.isPromiseRejectedResult = isPromiseRejectedResult; exports.renderTemplate = renderTemplate; exports.setUniqueName = _chunkUUBXTHJGcjs.setUniqueName; exports.timeout = timeout;
|
|
191
191
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/index.ts","../src/utils/FunctionParams.ts","../src/utils/promise.ts","../src/utils/renderTemplate.ts","../src/utils/timeout.ts"],"names":["item"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/utils/index.ts","../src/utils/FunctionParams.ts","../src/utils/promise.ts","../src/utils/renderTemplate.ts","../src/utils/timeout.ts"],"names":["item"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;AAAA;AAiCO,IAAM,kBAAN,MAAM,gBAAe;AAAA,EAG1B,YAAY,MAA6B;AADzC,+BAAyD,CAAC;AAExD,SAAK,OAAO;AAEZ,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,QAA6B;AAC/B,WAAO,mBAAK,QAAO,KAAK;AAAA,EAC1B;AAAA,EAEA,IAAI,MAAkH;AACpH,QAAI,CAAC,MAAM;AACT,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,WAAK,OAAO,OAAO,EAAE,QAAQ,CAAC,OAAO,mBAAK,QAAO,KAAK,EAAE,CAAC;AACzD,aAAO;AAAA,IACT;AACA,uBAAK,QAAO,KAAK,IAAI;AAErB,WAAO;AAAA,EACT;AAAA,EAkDA,OAAO,SAAS,OAA+C;AAC7D,QAAI,OAAiB,CAAC;AACtB,QAAI,OAAiB,CAAC;AAEtB,UAAM,UAAU,MAAM,MAAM,UAAQ,KAAK,OAAO,IAAI,MAAM,GAAG,CAAC,GAAG,UAAU;AAC3E,UAAM,WAAW,MAAM,MAAM,UAAQ,KAAK,QAAQ,KAAK;AAEvD,UAAM,QAAQ,UAAQ;AAnH1B;AAoHM,aAAO,sCAAe,0BAAf,SAA0B,MAAM,EAAE,GAAG,MAAM,MAAM,OAAU;AAClE,UAAI,MAAM,KAAK,CAAAA,UAAQA,MAAK,IAAI,GAAG;AACjC,eAAO,sCAAe,0BAAf,SAA0B,MAAM;AAAA,MACzC;AAAA,IACF,CAAC;AAED,WAAO;AAAA,MACL,MAAM,KAAK,KAAK,KAAK,IAAI,CAAC;AAAA,MAC1B,MAAM,KAAK,SAAS,KAAK,KAAK,KAAK,IAAI,CAAC,OAAO;AAAA,MAC/C;AAAA,MACA;AA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,UAAI,OAAO,UAAU,WAAW;AAC9B,eAAO,GAAG,MAAM,SAAS,CAAC,MAAM;AAAA,MAClC;AAEA,aAAQ,SAAoB;AAAA,IAC9B,CAAC,EACA,KAAK;AAAA,EACV,GAAG,QAAQ,KAAK;AAEpB;;;AC9BA;AAAA,eAAsB,QAAQ,IAA8B;AAC1D,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,eAAW,MAAM;AACf,cAAQ,IAAI;AAAA,IACd,GAAG,EAAE;AAAA,EACP,CAAC;AACH","sourcesContent":["export type { FunctionParamsAST } from './FunctionParams.ts'\nexport { FunctionParams } from './FunctionParams.ts'\nexport { isPromise, isPromiseFulfilledResult, isPromiseRejectedResult } from './promise.ts'\nexport { renderTemplate } from './renderTemplate.ts'\nexport { timeout } from './timeout.ts'\nexport { getUniqueName, setUniqueName } from './uniqueName.ts'\nexport type { URLObject } from './URLPath.ts'\nexport { URLPath } from './URLPath.ts'\n","import { orderBy } from 'natural-orderby'\n\nimport { camelCase } from '../transformers/casing.ts'\n\ntype FunctionParamsASTWithoutType = {\n name?: string\n type?: string\n /**\n * @default true\n */\n required?: boolean\n /**\n * @default true\n */\n enabled?: boolean\n default?: string\n}\n\ntype FunctionParamsASTWithType = {\n name?: never\n type: string\n /**\n * @default true\n */\n required?: boolean\n /**\n * @default true\n */\n enabled?: boolean\n default?: string\n}\n\nexport type FunctionParamsAST = FunctionParamsASTWithoutType | FunctionParamsASTWithType\nexport class FunctionParams {\n type?: 'generics' | 'typed'\n #items: Array<FunctionParamsAST | FunctionParamsAST[]> = []\n constructor(type?: 'generics' | 'typed') {\n this.type = type\n\n return this\n }\n\n get items(): FunctionParamsAST[] {\n return this.#items.flat()\n }\n\n add(item: FunctionParamsAST | Array<FunctionParamsAST | FunctionParamsAST[] | undefined> | undefined): FunctionParams {\n if (!item) {\n return this\n }\n\n if (Array.isArray(item)) {\n item.filter(Boolean).forEach((it) => this.#items.push(it))\n return this\n }\n this.#items.push(item)\n\n return this\n }\n static #orderItems(items: Array<FunctionParamsAST | FunctionParamsAST[]>) {\n return orderBy(items.filter(Boolean), [\n (v) => {\n if (Array.isArray(v)) {\n return undefined\n }\n return !v.default\n },\n (v) => {\n if (Array.isArray(v)) {\n return undefined\n }\n return v.required ?? true\n },\n ], [\n 'desc',\n 'desc',\n ])\n }\n\n static #addParams(acc: string[], item: FunctionParamsAST) {\n const { enabled = true, name, type, required = true, ...rest } = item\n\n if (!enabled) {\n return acc\n }\n\n if (!name) {\n // when name is not se we will use TypeScript generics\n acc.push(`${type}${rest.default ? ` = ${rest.default}` : ''}`)\n\n return acc\n }\n // TODO check whey we still need the camelcase here\n const parameterName = name.startsWith('{') ? name : camelCase(name)\n\n if (type) {\n if (required) {\n acc.push(`${parameterName}: ${type}${rest.default ? ` = ${rest.default}` : ''}`)\n } else {\n acc.push(`${parameterName}?: ${type}`)\n }\n } else {\n acc.push(`${parameterName}`)\n }\n\n return acc\n }\n\n static toObject(items: FunctionParamsAST[]): FunctionParamsAST {\n let type: string[] = []\n let name: string[] = []\n\n const enabled = items.every(item => item.enabled) ? items.at(0)?.enabled : true\n const required = items.every(item => item.required) ?? true\n\n items.forEach(item => {\n name = FunctionParams.#addParams(name, { ...item, type: undefined })\n if (items.some(item => item.type)) {\n type = FunctionParams.#addParams(type, item)\n }\n })\n\n return {\n name: `{ ${name.join(', ')} }`,\n type: type.length ? `{ ${type.join(', ')} }` : undefined,\n enabled,\n required,\n }\n }\n\n static toString(items: (FunctionParamsAST | FunctionParamsAST[])[]): string {\n const sortedData = this.#orderItems(items)\n\n return sortedData\n .reduce((acc, item) => {\n if (Array.isArray(item)) {\n const subItems = this.#orderItems(item) as FunctionParamsAST[]\n const objectItem = FunctionParams.toObject(subItems)\n\n return FunctionParams.#addParams(acc, objectItem)\n }\n\n return FunctionParams.#addParams(acc, item)\n }, [] as string[])\n .join(', ')\n }\n\n toObject(): FunctionParamsAST {\n const items = FunctionParams.#orderItems(this.#items).flat()\n\n return FunctionParams.toObject(items)\n }\n\n toString(): string {\n const items = FunctionParams.#orderItems(this.#items)\n\n return FunctionParams.toString(items)\n }\n}\n","import type { PossiblePromise } from '@kubb/types'\n\nexport function isPromise<T>(result: PossiblePromise<T>): result is Promise<T> {\n return !!result && typeof (result as Promise<unknown>)?.then === 'function'\n}\n\nexport function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T> {\n return result.status === 'fulfilled'\n}\n\nexport function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } {\n return result.status === 'rejected'\n}\n","export function renderTemplate<TData extends Record<string, unknown> = Record<string, unknown>>(template: string, data: TData | undefined = undefined): string {\n if (!data || !Object.keys(data).length) {\n return template.replace(/{{(.*?)}}/g, '')\n }\n\n const matches = template.match(/{{(.*?)}}/g)\n\n return (\n matches?.reduce((prev, curr) => {\n const index = curr.split(/{{|}}/).filter(Boolean)[0]?.trim()\n if (index === undefined) {\n return prev\n }\n const value = data[index]\n\n if (value === undefined) {\n return prev\n }\n\n return prev\n .replace(curr, () => {\n if (typeof value === 'boolean') {\n return `${value.toString()}` || 'false'\n }\n\n return (value as string) || ''\n })\n .trim()\n }, template) || ''\n )\n}\n","export async function timeout(ms: number): Promise<unknown> {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(true)\n }, ms)\n })\n}\n"]}
|
package/dist/utils.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
URLPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G7EQ47A4.js";
|
|
4
4
|
import {
|
|
5
5
|
getUniqueName,
|
|
6
6
|
setUniqueName
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-B7DTFNR4.js";
|
|
8
8
|
import {
|
|
9
|
-
camelCase
|
|
10
|
-
|
|
9
|
+
camelCase,
|
|
10
|
+
orderBy
|
|
11
|
+
} from "./chunk-WXV3UNEP.js";
|
|
11
12
|
import {
|
|
12
13
|
__privateAdd,
|
|
13
14
|
__privateGet,
|
|
14
15
|
__privateMethod,
|
|
15
16
|
init_esm_shims
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EAM5RXNI.js";
|
|
17
18
|
|
|
18
19
|
// src/utils/index.ts
|
|
19
20
|
init_esm_shims();
|
|
20
21
|
|
|
21
22
|
// src/utils/FunctionParams.ts
|
|
22
23
|
init_esm_shims();
|
|
23
|
-
import { orderBy } from "natural-orderby";
|
|
24
24
|
var _items, _orderItems, orderItems_fn, _addParams, addParams_fn;
|
|
25
25
|
var _FunctionParams = class _FunctionParams {
|
|
26
26
|
constructor(type) {
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/index.ts","../src/utils/FunctionParams.ts","../src/utils/promise.ts","../src/utils/renderTemplate.ts","../src/utils/timeout.ts"],"sourcesContent":["export type { FunctionParamsAST } from './FunctionParams.ts'\nexport { FunctionParams } from './FunctionParams.ts'\nexport { isPromise, isPromiseFulfilledResult, isPromiseRejectedResult } from './promise.ts'\nexport { renderTemplate } from './renderTemplate.ts'\nexport { timeout } from './timeout.ts'\nexport { getUniqueName, setUniqueName } from './uniqueName.ts'\nexport type { URLObject } from './URLPath.ts'\nexport { URLPath } from './URLPath.ts'\n","import { orderBy } from 'natural-orderby'\n\nimport { camelCase } from '../transformers/casing.ts'\n\ntype FunctionParamsASTWithoutType = {\n name?: string\n type?: string\n /**\n * @default true\n */\n required?: boolean\n /**\n * @default true\n */\n enabled?: boolean\n default?: string\n}\n\ntype FunctionParamsASTWithType = {\n name?: never\n type: string\n /**\n * @default true\n */\n required?: boolean\n /**\n * @default true\n */\n enabled?: boolean\n default?: string\n}\n\nexport type FunctionParamsAST = FunctionParamsASTWithoutType | FunctionParamsASTWithType\nexport class FunctionParams {\n type?: 'generics' | 'typed'\n #items: Array<FunctionParamsAST | FunctionParamsAST[]> = []\n constructor(type?: 'generics' | 'typed') {\n this.type = type\n\n return this\n }\n\n get items(): FunctionParamsAST[] {\n return this.#items.flat()\n }\n\n add(item: FunctionParamsAST | Array<FunctionParamsAST | FunctionParamsAST[] | undefined> | undefined): FunctionParams {\n if (!item) {\n return this\n }\n\n if (Array.isArray(item)) {\n item.filter(Boolean).forEach((it) => this.#items.push(it))\n return this\n }\n this.#items.push(item)\n\n return this\n }\n static #orderItems(items: Array<FunctionParamsAST | FunctionParamsAST[]>) {\n return orderBy(items.filter(Boolean), [\n (v) => {\n if (Array.isArray(v)) {\n return undefined\n }\n return !v.default\n },\n (v) => {\n if (Array.isArray(v)) {\n return undefined\n }\n return v.required ?? true\n },\n ], [\n 'desc',\n 'desc',\n ])\n }\n\n static #addParams(acc: string[], item: FunctionParamsAST) {\n const { enabled = true, name, type, required = true, ...rest } = item\n\n if (!enabled) {\n return acc\n }\n\n if (!name) {\n // when name is not se we will use TypeScript generics\n acc.push(`${type}${rest.default ? ` = ${rest.default}` : ''}`)\n\n return acc\n }\n // TODO check whey we still need the camelcase here\n const parameterName = name.startsWith('{') ? name : camelCase(name)\n\n if (type) {\n if (required) {\n acc.push(`${parameterName}: ${type}${rest.default ? ` = ${rest.default}` : ''}`)\n } else {\n acc.push(`${parameterName}?: ${type}`)\n }\n } else {\n acc.push(`${parameterName}`)\n }\n\n return acc\n }\n\n static toObject(items: FunctionParamsAST[]): FunctionParamsAST {\n let type: string[] = []\n let name: string[] = []\n\n const enabled = items.every(item => item.enabled) ? items.at(0)?.enabled : true\n const required = items.every(item => item.required) ?? true\n\n items.forEach(item => {\n name = FunctionParams.#addParams(name, { ...item, type: undefined })\n if (items.some(item => item.type)) {\n type = FunctionParams.#addParams(type, item)\n }\n })\n\n return {\n name: `{ ${name.join(', ')} }`,\n type: type.length ? `{ ${type.join(', ')} }` : undefined,\n enabled,\n required,\n }\n }\n\n static toString(items: (FunctionParamsAST | FunctionParamsAST[])[]): string {\n const sortedData = this.#orderItems(items)\n\n return sortedData\n .reduce((acc, item) => {\n if (Array.isArray(item)) {\n const subItems = this.#orderItems(item) as FunctionParamsAST[]\n const objectItem = FunctionParams.toObject(subItems)\n\n return FunctionParams.#addParams(acc, objectItem)\n }\n\n return FunctionParams.#addParams(acc, item)\n }, [] as string[])\n .join(', ')\n }\n\n toObject(): FunctionParamsAST {\n const items = FunctionParams.#orderItems(this.#items).flat()\n\n return FunctionParams.toObject(items)\n }\n\n toString(): string {\n const items = FunctionParams.#orderItems(this.#items)\n\n return FunctionParams.toString(items)\n }\n}\n","import type { PossiblePromise } from '@kubb/types'\n\nexport function isPromise<T>(result: PossiblePromise<T>): result is Promise<T> {\n return !!result && typeof (result as Promise<unknown>)?.then === 'function'\n}\n\nexport function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T> {\n return result.status === 'fulfilled'\n}\n\nexport function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } {\n return result.status === 'rejected'\n}\n","export function renderTemplate<TData extends Record<string, unknown> = Record<string, unknown>>(template: string, data: TData | undefined = undefined): string {\n if (!data || !Object.keys(data).length) {\n return template.replace(/{{(.*?)}}/g, '')\n }\n\n const matches = template.match(/{{(.*?)}}/g)\n\n return (\n matches?.reduce((prev, curr) => {\n const index = curr.split(/{{|}}/).filter(Boolean)[0]?.trim()\n if (index === undefined) {\n return prev\n }\n const value = data[index]\n\n if (value === undefined) {\n return prev\n }\n\n return prev\n .replace(curr, () => {\n if (typeof value === 'boolean') {\n return `${value.toString()}` || 'false'\n }\n\n return (value as string) || ''\n })\n .trim()\n }, template) || ''\n )\n}\n","export async function timeout(ms: number): Promise<unknown> {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(true)\n }, ms)\n })\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/utils/index.ts","../src/utils/FunctionParams.ts","../src/utils/promise.ts","../src/utils/renderTemplate.ts","../src/utils/timeout.ts"],"sourcesContent":["export type { FunctionParamsAST } from './FunctionParams.ts'\nexport { FunctionParams } from './FunctionParams.ts'\nexport { isPromise, isPromiseFulfilledResult, isPromiseRejectedResult } from './promise.ts'\nexport { renderTemplate } from './renderTemplate.ts'\nexport { timeout } from './timeout.ts'\nexport { getUniqueName, setUniqueName } from './uniqueName.ts'\nexport type { URLObject } from './URLPath.ts'\nexport { URLPath } from './URLPath.ts'\n","import { orderBy } from 'natural-orderby'\n\nimport { camelCase } from '../transformers/casing.ts'\n\ntype FunctionParamsASTWithoutType = {\n name?: string\n type?: string\n /**\n * @default true\n */\n required?: boolean\n /**\n * @default true\n */\n enabled?: boolean\n default?: string\n}\n\ntype FunctionParamsASTWithType = {\n name?: never\n type: string\n /**\n * @default true\n */\n required?: boolean\n /**\n * @default true\n */\n enabled?: boolean\n default?: string\n}\n\nexport type FunctionParamsAST = FunctionParamsASTWithoutType | FunctionParamsASTWithType\nexport class FunctionParams {\n type?: 'generics' | 'typed'\n #items: Array<FunctionParamsAST | FunctionParamsAST[]> = []\n constructor(type?: 'generics' | 'typed') {\n this.type = type\n\n return this\n }\n\n get items(): FunctionParamsAST[] {\n return this.#items.flat()\n }\n\n add(item: FunctionParamsAST | Array<FunctionParamsAST | FunctionParamsAST[] | undefined> | undefined): FunctionParams {\n if (!item) {\n return this\n }\n\n if (Array.isArray(item)) {\n item.filter(Boolean).forEach((it) => this.#items.push(it))\n return this\n }\n this.#items.push(item)\n\n return this\n }\n static #orderItems(items: Array<FunctionParamsAST | FunctionParamsAST[]>) {\n return orderBy(items.filter(Boolean), [\n (v) => {\n if (Array.isArray(v)) {\n return undefined\n }\n return !v.default\n },\n (v) => {\n if (Array.isArray(v)) {\n return undefined\n }\n return v.required ?? true\n },\n ], [\n 'desc',\n 'desc',\n ])\n }\n\n static #addParams(acc: string[], item: FunctionParamsAST) {\n const { enabled = true, name, type, required = true, ...rest } = item\n\n if (!enabled) {\n return acc\n }\n\n if (!name) {\n // when name is not se we will use TypeScript generics\n acc.push(`${type}${rest.default ? ` = ${rest.default}` : ''}`)\n\n return acc\n }\n // TODO check whey we still need the camelcase here\n const parameterName = name.startsWith('{') ? name : camelCase(name)\n\n if (type) {\n if (required) {\n acc.push(`${parameterName}: ${type}${rest.default ? ` = ${rest.default}` : ''}`)\n } else {\n acc.push(`${parameterName}?: ${type}`)\n }\n } else {\n acc.push(`${parameterName}`)\n }\n\n return acc\n }\n\n static toObject(items: FunctionParamsAST[]): FunctionParamsAST {\n let type: string[] = []\n let name: string[] = []\n\n const enabled = items.every(item => item.enabled) ? items.at(0)?.enabled : true\n const required = items.every(item => item.required) ?? true\n\n items.forEach(item => {\n name = FunctionParams.#addParams(name, { ...item, type: undefined })\n if (items.some(item => item.type)) {\n type = FunctionParams.#addParams(type, item)\n }\n })\n\n return {\n name: `{ ${name.join(', ')} }`,\n type: type.length ? `{ ${type.join(', ')} }` : undefined,\n enabled,\n required,\n }\n }\n\n static toString(items: (FunctionParamsAST | FunctionParamsAST[])[]): string {\n const sortedData = this.#orderItems(items)\n\n return sortedData\n .reduce((acc, item) => {\n if (Array.isArray(item)) {\n const subItems = this.#orderItems(item) as FunctionParamsAST[]\n const objectItem = FunctionParams.toObject(subItems)\n\n return FunctionParams.#addParams(acc, objectItem)\n }\n\n return FunctionParams.#addParams(acc, item)\n }, [] as string[])\n .join(', ')\n }\n\n toObject(): FunctionParamsAST {\n const items = FunctionParams.#orderItems(this.#items).flat()\n\n return FunctionParams.toObject(items)\n }\n\n toString(): string {\n const items = FunctionParams.#orderItems(this.#items)\n\n return FunctionParams.toString(items)\n }\n}\n","import type { PossiblePromise } from '@kubb/types'\n\nexport function isPromise<T>(result: PossiblePromise<T>): result is Promise<T> {\n return !!result && typeof (result as Promise<unknown>)?.then === 'function'\n}\n\nexport function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T> {\n return result.status === 'fulfilled'\n}\n\nexport function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } {\n return result.status === 'rejected'\n}\n","export function renderTemplate<TData extends Record<string, unknown> = Record<string, unknown>>(template: string, data: TData | undefined = undefined): string {\n if (!data || !Object.keys(data).length) {\n return template.replace(/{{(.*?)}}/g, '')\n }\n\n const matches = template.match(/{{(.*?)}}/g)\n\n return (\n matches?.reduce((prev, curr) => {\n const index = curr.split(/{{|}}/).filter(Boolean)[0]?.trim()\n if (index === undefined) {\n return prev\n }\n const value = data[index]\n\n if (value === undefined) {\n return prev\n }\n\n return prev\n .replace(curr, () => {\n if (typeof value === 'boolean') {\n return `${value.toString()}` || 'false'\n }\n\n return (value as string) || ''\n })\n .trim()\n }, template) || ''\n )\n}\n","export async function timeout(ms: number): Promise<unknown> {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(true)\n }, ms)\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;AAAA;AAiCO,IAAM,kBAAN,MAAM,gBAAe;AAAA,EAG1B,YAAY,MAA6B;AADzC,+BAAyD,CAAC;AAExD,SAAK,OAAO;AAEZ,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,QAA6B;AAC/B,WAAO,mBAAK,QAAO,KAAK;AAAA,EAC1B;AAAA,EAEA,IAAI,MAAkH;AACpH,QAAI,CAAC,MAAM;AACT,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,WAAK,OAAO,OAAO,EAAE,QAAQ,CAAC,OAAO,mBAAK,QAAO,KAAK,EAAE,CAAC;AACzD,aAAO;AAAA,IACT;AACA,uBAAK,QAAO,KAAK,IAAI;AAErB,WAAO;AAAA,EACT;AAAA,EAkDA,OAAO,SAAS,OAA+C;AAC7D,QAAI,OAAiB,CAAC;AACtB,QAAI,OAAiB,CAAC;AAEtB,UAAM,UAAU,MAAM,MAAM,UAAQ,KAAK,OAAO,IAAI,MAAM,GAAG,CAAC,GAAG,UAAU;AAC3E,UAAM,WAA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AC,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE,QAAQ;AACtC,WAAO,SAAS,QAAQ,cAAc,EAAE;AAAA,EAC1C;AAEA,QAAM,UAAU,SAAS,MAAM,YAAY;AAE3C,SACE,SAAS,OAAO,CAAC,MAAM,SAAS;AAC9B,UAAM,QAAQ,KAAK,MAAM,OAAO,EAAE,OAAO,OAAO,EAAE,CAAC,GAAG,KAAK;AAC3D,QAAI,UAAU,QAAW;AACvB,aAAO;AAAA,IACT;AACA,UAAM,QAAQ,KAAK,KAAK;AAExB,QAAI,UAAU,QAAW;AACvB,aAAO;AAAA,IACT;AAEA,WAAO,KACJ,QAAQ,MAAM,MAAM;AACnB,UAAI,OAAO,UAAU,WAAW;AAC9B,eAAO,GAAG,MAAM,SAAS,CAAC,MAAM;AAAA,MAClC;AAEA,aAAQ,SAAoB;AAAA,IAC9B,CAAC,EACA,KAAK;AAAA,EACV,GAAG,QAAQ,KAAK;AAEpB;;;AC9BA;AAAA,eAAsB,QAAQ,IAA8B;AAC1D,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,eAAW,MAAM;AACf,cAAQ,IAAI;AAAA,IACd,GAAG,EAAE;AAAA,EACP,CAAC;AACH;","names":["item"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Generator core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -91,25 +91,30 @@
|
|
|
91
91
|
"find-up": "^7.0.0",
|
|
92
92
|
"fs-extra": "^11.2.0",
|
|
93
93
|
"js-runtime": "^0.0.7",
|
|
94
|
+
"lodash.merge": "^4.6.2",
|
|
94
95
|
"natural-orderby": "^3.0.2",
|
|
95
96
|
"p-queue": "^8.0.1",
|
|
96
97
|
"seedrandom": "^3.0.5",
|
|
97
98
|
"semver": "^7.6.0",
|
|
98
|
-
"
|
|
99
|
-
"@kubb/
|
|
99
|
+
"unraw": "^3.0.0",
|
|
100
|
+
"@kubb/parser": "2.10.0",
|
|
101
|
+
"@kubb/types": "2.10.0"
|
|
100
102
|
},
|
|
101
103
|
"devDependencies": {
|
|
102
104
|
"@types/fs-extra": "^11.0.4",
|
|
103
105
|
"@types/lodash.isequal": "^4.5.8",
|
|
104
|
-
"@types/
|
|
106
|
+
"@types/lodash.merge": "^4.6.9",
|
|
107
|
+
"@types/lodash.tonumber": "^4.0.9",
|
|
108
|
+
"@types/react": "^18.2.69",
|
|
105
109
|
"@types/seedrandom": "^3.0.8",
|
|
106
110
|
"@types/semver": "^7.5.8",
|
|
107
111
|
"eslint": "^8.57.0",
|
|
108
112
|
"lodash.isequal": "^4.5.0",
|
|
113
|
+
"lodash.tonumber": "^4.0.3",
|
|
109
114
|
"ora": "^8.0.1",
|
|
110
115
|
"tinyrainbow": "^1.1.1",
|
|
111
116
|
"tsup": "^8.0.2",
|
|
112
|
-
"typescript": "^5.4.
|
|
117
|
+
"typescript": "^5.4.3",
|
|
113
118
|
"@kubb/eslint-config": "1.1.8",
|
|
114
119
|
"@kubb/ts-config": "0.1.0",
|
|
115
120
|
"@kubb/tsup-config": "1.1.8"
|
|
@@ -29,3 +29,15 @@ export function jsStringEscape(input: any): string {
|
|
|
29
29
|
}
|
|
30
30
|
})
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
export function escapeStringRegexp(string: string) {
|
|
34
|
+
if (typeof string !== 'string') {
|
|
35
|
+
throw new TypeError('Expected a string')
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Escape characters with special meaning either inside or outside character sets.
|
|
39
|
+
// Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
|
|
40
|
+
return string
|
|
41
|
+
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
|
|
42
|
+
.replace(/-/g, '\\x2d')
|
|
43
|
+
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import merge from 'lodash.merge'
|
|
2
|
+
import toNumber from 'lodash.tonumber'
|
|
3
|
+
import { orderBy } from 'natural-orderby'
|
|
4
|
+
|
|
1
5
|
import { camelCase, pascalCase, pathCase } from './casing.ts'
|
|
2
6
|
import { combineCodes } from './combineCodes.ts'
|
|
3
7
|
import { createJSDocBlockText } from './createJSDocBlockText.ts'
|
|
@@ -5,8 +9,11 @@ import { escape, jsStringEscape } from './escape.ts'
|
|
|
5
9
|
import { createIndent } from './indent.ts'
|
|
6
10
|
import { nameSorter } from './nameSorter.ts'
|
|
7
11
|
import { searchAndReplace } from './searchAndReplace.ts'
|
|
12
|
+
import { stringify } from './stringify.ts'
|
|
13
|
+
import { isNumber } from './toNumber.ts'
|
|
14
|
+
import { toRegExp, toRegExpString } from './toRegExp.ts'
|
|
8
15
|
import { transformReservedWord } from './transformReservedWord.ts'
|
|
9
|
-
import { trim, trimExtName } from './trim.ts'
|
|
16
|
+
import { trim, trimExtName, trimQuotes } from './trim.ts'
|
|
10
17
|
|
|
11
18
|
export { camelCase, pascalCase, pathCase } from './casing.ts'
|
|
12
19
|
export { combineCodes } from './combineCodes.ts'
|
|
@@ -15,8 +22,14 @@ export { escape, jsStringEscape } from './escape.ts'
|
|
|
15
22
|
export { createIndent } from './indent.ts'
|
|
16
23
|
export { nameSorter } from './nameSorter.ts'
|
|
17
24
|
export { searchAndReplace } from './searchAndReplace.ts'
|
|
25
|
+
export { stringify } from './stringify.ts'
|
|
26
|
+
export { isNumber } from './toNumber.ts'
|
|
27
|
+
export { toRegExp, toRegExpString } from './toRegExp.ts'
|
|
18
28
|
export { transformReservedWord } from './transformReservedWord.ts'
|
|
19
|
-
export { trim, trimExtName } from './trim.ts'
|
|
29
|
+
export { trim, trimExtName, trimQuotes } from './trim.ts'
|
|
30
|
+
export { default as merge } from 'lodash.merge'
|
|
31
|
+
export { default as toNumber } from 'lodash.tonumber'
|
|
32
|
+
export { orderBy } from 'natural-orderby'
|
|
20
33
|
|
|
21
34
|
export default {
|
|
22
35
|
combineCodes,
|
|
@@ -26,11 +39,19 @@ export default {
|
|
|
26
39
|
transformReservedWord,
|
|
27
40
|
nameSorter,
|
|
28
41
|
searchAndReplace,
|
|
42
|
+
toNumber,
|
|
43
|
+
isNumber,
|
|
44
|
+
stringify,
|
|
45
|
+
toRegExp,
|
|
46
|
+
toRegExpString,
|
|
29
47
|
trim,
|
|
48
|
+
trimQuotes,
|
|
30
49
|
trimExtName,
|
|
31
50
|
JSDoc: {
|
|
32
51
|
createJSDocBlockText,
|
|
33
52
|
},
|
|
53
|
+
orderBy,
|
|
54
|
+
merge,
|
|
34
55
|
camelCase,
|
|
35
56
|
pascalCase,
|
|
36
57
|
pathCase,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import toNumber from 'lodash.tonumber'
|
|
2
|
+
|
|
3
|
+
export function isNumber(value: unknown): value is number {
|
|
4
|
+
if (typeof value === 'string') {
|
|
5
|
+
if (value === '') {
|
|
6
|
+
return false
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return !isNaN(toNumber(value))
|
|
10
|
+
}
|
|
11
|
+
return typeof value === 'number'
|
|
12
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsStringEscape } from './escape'
|
|
2
|
+
import { trimQuotes } from './trim'
|
|
3
|
+
|
|
4
|
+
function stringToRegex(text: string) {
|
|
5
|
+
const isStartWithSlash = text.startsWith('/')
|
|
6
|
+
const isEndWithSlash = text.endsWith('/')
|
|
7
|
+
|
|
8
|
+
return new RegExp(text.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : undefined))
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @experimental
|
|
13
|
+
*/
|
|
14
|
+
export function toRegExp(text: string | RegExp): RegExp {
|
|
15
|
+
if (typeof text === 'string') {
|
|
16
|
+
const source = trimQuotes(text)
|
|
17
|
+
|
|
18
|
+
return stringToRegex(source)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return stringToRegex(text.toString())
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function toRegExpString(text: string): string {
|
|
25
|
+
const isStartWithSlash = text.startsWith('/')
|
|
26
|
+
const isEndWithSlash = text.endsWith('/')
|
|
27
|
+
|
|
28
|
+
const regexp = `new RegExp('${
|
|
29
|
+
jsStringEscape(
|
|
30
|
+
text.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : undefined),
|
|
31
|
+
)
|
|
32
|
+
}')`
|
|
33
|
+
|
|
34
|
+
return regexp
|
|
35
|
+
}
|
package/src/transformers/trim.ts
CHANGED
|
@@ -2,6 +2,21 @@ export function trim(text: string): string {
|
|
|
2
2
|
return text.replaceAll(/\n/g, '').trim()
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
export function trimQuotes(text: string): string {
|
|
6
|
+
if (text.match(/^"(.*)"$/)) {
|
|
7
|
+
return text.replace(/^"(.*)"$/, '$1')
|
|
8
|
+
}
|
|
9
|
+
if (text.match(/^'(.*)'$/)) {
|
|
10
|
+
return text.replace(/^'(.*)'$/, '$1')
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (text.match(/^`(.*)`$/)) {
|
|
14
|
+
return text.replace(/^`(.*)`$/, '$1')
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return text
|
|
18
|
+
}
|
|
19
|
+
|
|
5
20
|
export function trimExtName(text: string): string {
|
|
6
21
|
return text.replace(/\.[^/.]+$/, '')
|
|
7
22
|
}
|
package/dist/chunk-AWUFUNOJ.cjs
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
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
|
-
|
|
3
|
-
var _chunkDJLNT4KCcjs = require('./chunk-DJLNT4KC.cjs');
|
|
4
|
-
|
|
5
|
-
// src/transformers/casing.ts
|
|
6
|
-
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
7
|
-
|
|
8
|
-
// ../../node_modules/.pnpm/change-case@5.4.3/node_modules/change-case/dist/index.js
|
|
9
|
-
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
10
|
-
var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
11
|
-
var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
12
|
-
var SPLIT_SEPARATE_NUMBER_RE = /(\d)\p{Ll}|(\p{L})\d/u;
|
|
13
|
-
var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
14
|
-
var SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
15
|
-
var DEFAULT_PREFIX_SUFFIX_CHARACTERS = "";
|
|
16
|
-
function split(value) {
|
|
17
|
-
let result = value.trim();
|
|
18
|
-
result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
19
|
-
result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
20
|
-
let start = 0;
|
|
21
|
-
let end = result.length;
|
|
22
|
-
while (result.charAt(start) === "\0")
|
|
23
|
-
start++;
|
|
24
|
-
if (start === end)
|
|
25
|
-
return [];
|
|
26
|
-
while (result.charAt(end - 1) === "\0")
|
|
27
|
-
end--;
|
|
28
|
-
return result.slice(start, end).split(/\0/g);
|
|
29
|
-
}
|
|
30
|
-
function splitSeparateNumbers(value) {
|
|
31
|
-
const words = split(value);
|
|
32
|
-
for (let i = 0; i < words.length; i++) {
|
|
33
|
-
const word = words[i];
|
|
34
|
-
const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);
|
|
35
|
-
if (match) {
|
|
36
|
-
const offset = match.index + (_nullishCoalesce(match[1], () => ( match[2]))).length;
|
|
37
|
-
words.splice(i, 1, word.slice(0, offset), word.slice(offset));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return words;
|
|
41
|
-
}
|
|
42
|
-
function noCase(input, options) {
|
|
43
|
-
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
|
|
44
|
-
return prefix + words.map(lowerFactory(_optionalChain([options, 'optionalAccess', _ => _.locale]))).join(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _2 => _2.delimiter]), () => ( " "))) + suffix;
|
|
45
|
-
}
|
|
46
|
-
function camelCase(input, options) {
|
|
47
|
-
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
|
|
48
|
-
const lower = lowerFactory(_optionalChain([options, 'optionalAccess', _3 => _3.locale]));
|
|
49
|
-
const upper = upperFactory(_optionalChain([options, 'optionalAccess', _4 => _4.locale]));
|
|
50
|
-
const transform = _optionalChain([options, 'optionalAccess', _5 => _5.mergeAmbiguousCharacters]) ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
|
|
51
|
-
return prefix + words.map((word, index) => {
|
|
52
|
-
if (index === 0)
|
|
53
|
-
return lower(word);
|
|
54
|
-
return transform(word, index);
|
|
55
|
-
}).join(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _6 => _6.delimiter]), () => ( ""))) + suffix;
|
|
56
|
-
}
|
|
57
|
-
function pascalCase(input, options) {
|
|
58
|
-
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
|
|
59
|
-
const lower = lowerFactory(_optionalChain([options, 'optionalAccess', _7 => _7.locale]));
|
|
60
|
-
const upper = upperFactory(_optionalChain([options, 'optionalAccess', _8 => _8.locale]));
|
|
61
|
-
const transform = _optionalChain([options, 'optionalAccess', _9 => _9.mergeAmbiguousCharacters]) ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
|
|
62
|
-
return prefix + words.map(transform).join(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _10 => _10.delimiter]), () => ( ""))) + suffix;
|
|
63
|
-
}
|
|
64
|
-
function pathCase(input, options) {
|
|
65
|
-
return noCase(input, { delimiter: "/", ...options });
|
|
66
|
-
}
|
|
67
|
-
function lowerFactory(locale) {
|
|
68
|
-
return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
|
|
69
|
-
}
|
|
70
|
-
function upperFactory(locale) {
|
|
71
|
-
return locale === false ? (input) => input.toUpperCase() : (input) => input.toLocaleUpperCase(locale);
|
|
72
|
-
}
|
|
73
|
-
function capitalCaseTransformFactory(lower, upper) {
|
|
74
|
-
return (word) => `${upper(word[0])}${lower(word.slice(1))}`;
|
|
75
|
-
}
|
|
76
|
-
function pascalCaseTransformFactory(lower, upper) {
|
|
77
|
-
return (word, index) => {
|
|
78
|
-
const char0 = word[0];
|
|
79
|
-
const initial = index > 0 && char0 >= "0" && char0 <= "9" ? "_" + char0 : upper(char0);
|
|
80
|
-
return initial + lower(word.slice(1));
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function splitPrefixSuffix(input, options = {}) {
|
|
84
|
-
const splitFn = _nullishCoalesce(options.split, () => ( (options.separateNumbers ? splitSeparateNumbers : split)));
|
|
85
|
-
const prefixCharacters = _nullishCoalesce(options.prefixCharacters, () => ( DEFAULT_PREFIX_SUFFIX_CHARACTERS));
|
|
86
|
-
const suffixCharacters = _nullishCoalesce(options.suffixCharacters, () => ( DEFAULT_PREFIX_SUFFIX_CHARACTERS));
|
|
87
|
-
let prefixIndex = 0;
|
|
88
|
-
let suffixIndex = input.length;
|
|
89
|
-
while (prefixIndex < input.length) {
|
|
90
|
-
const char = input.charAt(prefixIndex);
|
|
91
|
-
if (!prefixCharacters.includes(char))
|
|
92
|
-
break;
|
|
93
|
-
prefixIndex++;
|
|
94
|
-
}
|
|
95
|
-
while (suffixIndex > prefixIndex) {
|
|
96
|
-
const index = suffixIndex - 1;
|
|
97
|
-
const char = input.charAt(index);
|
|
98
|
-
if (!suffixCharacters.includes(char))
|
|
99
|
-
break;
|
|
100
|
-
suffixIndex = index;
|
|
101
|
-
}
|
|
102
|
-
return [
|
|
103
|
-
input.slice(0, prefixIndex),
|
|
104
|
-
splitFn(input.slice(prefixIndex, suffixIndex)),
|
|
105
|
-
input.slice(suffixIndex)
|
|
106
|
-
];
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// src/transformers/casing.ts
|
|
110
|
-
function camelCase2(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
111
|
-
if (isFile) {
|
|
112
|
-
const splitArray = text.split(".");
|
|
113
|
-
return splitArray.map((item, i) => i === splitArray.length - 1 ? camelCase2(item, { prefix, suffix }) : camelCase2(item)).join("/");
|
|
114
|
-
}
|
|
115
|
-
return camelCase(`${prefix} ${text} ${suffix}`, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
116
|
-
}
|
|
117
|
-
function pascalCase2(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
118
|
-
if (isFile) {
|
|
119
|
-
const splitArray = text.split(".");
|
|
120
|
-
return splitArray.map((item, i) => i === splitArray.length - 1 ? pascalCase2(item, { prefix, suffix }) : camelCase2(item)).join("/");
|
|
121
|
-
}
|
|
122
|
-
return pascalCase(`${prefix} ${text} ${suffix}`, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
123
|
-
}
|
|
124
|
-
function pathCase2(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
125
|
-
if (isFile) {
|
|
126
|
-
const splitArray = text.split(".");
|
|
127
|
-
return splitArray.map((item, i) => i === splitArray.length - 1 ? pathCase2(item, { prefix, suffix }) : camelCase2(item)).join("/");
|
|
128
|
-
}
|
|
129
|
-
return pathCase(`${prefix} ${text} ${suffix}`, { delimiter: "" });
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
exports.camelCase = camelCase2; exports.pascalCase = pascalCase2; exports.pathCase = pathCase2;
|
|
137
|
-
//# sourceMappingURL=chunk-AWUFUNOJ.cjs.map
|