@sushichan044/eslint-todo 0.3.0 → 0.3.2
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/README.md +2 -2
- package/dist/cli/handlers/correct.mjs +3 -3
- package/dist/config/validation.mjs +14 -18
- package/dist/eslint/index.mjs +1 -2
- package/dist/index.d.mts +0 -1
- package/dist/package.mjs +1 -1
- package/dist/todofile/v1.mjs +11 -14
- package/dist/todofile/v2.mjs +14 -17
- package/package.json +23 -27
- package/dist/_virtual/rolldown_runtime.mjs +0 -22
- package/dist/node_modules/.pnpm/typia@11.0.0_typescript@5.9.3/node_modules/typia/lib/internal/_accessExpressionAsString.mjs +0 -49
- package/dist/node_modules/.pnpm/typia@11.0.0_typescript@5.9.3/node_modules/typia/lib/internal/_createStandardSchema.mjs +0 -74
- package/dist/node_modules/.pnpm/typia@11.0.0_typescript@5.9.3/node_modules/typia/lib/internal/_validateReport.mjs +0 -27
package/README.md
CHANGED
|
@@ -18,11 +18,11 @@ npm install --save-dev eslint @sushichan044/eslint-todo
|
|
|
18
18
|
Requires:
|
|
19
19
|
|
|
20
20
|
- **ES Module**
|
|
21
|
-
- ESLint: `^
|
|
21
|
+
- ESLint: `^9.0.0 || ^10.0.0`
|
|
22
22
|
- **Flat Config Required**
|
|
23
23
|
- If you are using legacy config, you must migrate into flat config first.
|
|
24
24
|
- Utilities like [@eslint/compat](https://github.com/eslint/rewrite/tree/main/packages/compat) can help you.
|
|
25
|
-
- Node.js: `^
|
|
25
|
+
- Node.js: `^22.0.0 || ^24.0.0 || >=25.0.0`
|
|
26
26
|
- May work in Deno, but not tested.
|
|
27
27
|
|
|
28
28
|
## Getting Started
|
|
@@ -27,12 +27,12 @@ If you want to fix ESLint errors, please use \`eslint --fix\` instead.`);
|
|
|
27
27
|
"before:select-rule": () => {
|
|
28
28
|
logger.start("Selecting rules to fix ...");
|
|
29
29
|
},
|
|
30
|
-
"after:select-rule": (result
|
|
31
|
-
if (!result
|
|
30
|
+
"after:select-rule": (result) => {
|
|
31
|
+
if (!result.success) {
|
|
32
32
|
logger.warn("Couldn't find any rule to fix. Check your configuration and change the limit if necessary.");
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
logger.success(`Selected ${result
|
|
35
|
+
logger.success(`Selected ${result.selection.ruleId}.`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
})();
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { require__createStandardSchema } from "../node_modules/.pnpm/typia@11.0.0_typescript@5.9.3/node_modules/typia/lib/internal/_createStandardSchema.mjs";
|
|
5
|
-
var import__accessExpressionAsString = /* @__PURE__ */ __toESM(require__accessExpressionAsString());
|
|
6
|
-
var import__validateReport = /* @__PURE__ */ __toESM(require__validateReport());
|
|
7
|
-
var import__createStandardSchema = /* @__PURE__ */ __toESM(require__createStandardSchema());
|
|
1
|
+
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
2
|
+
import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js";
|
|
3
|
+
import * as __typia_transform__createStandardSchema from "typia/lib/internal/_createStandardSchema.js";
|
|
8
4
|
const UserConfigSchema = (() => {
|
|
9
5
|
const _io0 = (input, _exceptionable = true) => (void 0 === input.correct || "object" === typeof input.correct && null !== input.correct && false === Array.isArray(input.correct) && _io1(input.correct, _exceptionable)) && (void 0 === input.root || "string" === typeof input.root) && (void 0 === input.todoFile || "string" === typeof input.todoFile) && (0 === Object.keys(input).length || Object.keys(input).every((key) => {
|
|
10
6
|
if ([
|
|
@@ -70,7 +66,7 @@ const UserConfigSchema = (() => {
|
|
|
70
66
|
const value = input[key];
|
|
71
67
|
if (void 0 === value) return true;
|
|
72
68
|
return _report(_exceptionable, {
|
|
73
|
-
path: _path +
|
|
69
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
74
70
|
expected: "undefined",
|
|
75
71
|
value,
|
|
76
72
|
description: [
|
|
@@ -130,7 +126,7 @@ const UserConfigSchema = (() => {
|
|
|
130
126
|
const value = input[key];
|
|
131
127
|
if (void 0 === value) return true;
|
|
132
128
|
return _report(_exceptionable, {
|
|
133
|
-
path: _path +
|
|
129
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
134
130
|
expected: "undefined",
|
|
135
131
|
value,
|
|
136
132
|
description: [
|
|
@@ -173,7 +169,7 @@ const UserConfigSchema = (() => {
|
|
|
173
169
|
const value = input[key];
|
|
174
170
|
if (void 0 === value) return true;
|
|
175
171
|
return _report(_exceptionable, {
|
|
176
|
-
path: _path +
|
|
172
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
177
173
|
expected: "undefined",
|
|
178
174
|
value,
|
|
179
175
|
description: [
|
|
@@ -216,7 +212,7 @@ const UserConfigSchema = (() => {
|
|
|
216
212
|
const value = input[key];
|
|
217
213
|
if (void 0 === value) return true;
|
|
218
214
|
return _report(_exceptionable, {
|
|
219
|
-
path: _path +
|
|
215
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
220
216
|
expected: "undefined",
|
|
221
217
|
value,
|
|
222
218
|
description: [
|
|
@@ -243,7 +239,7 @@ const UserConfigSchema = (() => {
|
|
|
243
239
|
const value = input[key];
|
|
244
240
|
if (void 0 === value) return true;
|
|
245
241
|
return _report(_exceptionable, {
|
|
246
|
-
path: _path +
|
|
242
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
247
243
|
expected: "undefined",
|
|
248
244
|
value,
|
|
249
245
|
description: [
|
|
@@ -257,18 +253,18 @@ const UserConfigSchema = (() => {
|
|
|
257
253
|
const __is = (input, _exceptionable = true) => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input, true);
|
|
258
254
|
let errors;
|
|
259
255
|
let _report;
|
|
260
|
-
return
|
|
256
|
+
return __typia_transform__createStandardSchema._createStandardSchema((input) => {
|
|
261
257
|
if (false === __is(input)) {
|
|
262
258
|
errors = [];
|
|
263
|
-
_report =
|
|
264
|
-
((input
|
|
259
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
260
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _report(true, {
|
|
265
261
|
path: _path + "",
|
|
266
262
|
expected: "UserConfig",
|
|
267
|
-
value: input
|
|
268
|
-
})) && _vo0(input
|
|
263
|
+
value: input
|
|
264
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
269
265
|
path: _path + "",
|
|
270
266
|
expected: "UserConfig",
|
|
271
|
-
value: input
|
|
267
|
+
value: input
|
|
272
268
|
}))(input, "$input", true);
|
|
273
269
|
const success = 0 === errors.length;
|
|
274
270
|
return success ? {
|
package/dist/eslint/index.mjs
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/package.mjs
CHANGED
package/dist/todofile/v1.mjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { __toESM } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require__accessExpressionAsString } from "../node_modules/.pnpm/typia@11.0.0_typescript@5.9.3/node_modules/typia/lib/internal/_accessExpressionAsString.mjs";
|
|
3
|
-
import { require__validateReport } from "../node_modules/.pnpm/typia@11.0.0_typescript@5.9.3/node_modules/typia/lib/internal/_validateReport.mjs";
|
|
4
1
|
import { isNonEmptyString } from "../utils/string.mjs";
|
|
5
2
|
import { TodoModuleV2Handler } from "./v2.mjs";
|
|
6
3
|
import { relative } from "pathe";
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
5
|
+
import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js";
|
|
9
6
|
const TodoModuleV1Handler = {
|
|
10
7
|
version: 1,
|
|
11
8
|
buildTodoFromLintResults(lintResult, config) {
|
|
@@ -45,11 +42,11 @@ const TodoModuleV1Handler = {
|
|
|
45
42
|
const value = input[key];
|
|
46
43
|
if (void 0 === value) return true;
|
|
47
44
|
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
48
|
-
path: _path +
|
|
45
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
49
46
|
expected: "ESLintTodoEntryV1",
|
|
50
47
|
value
|
|
51
|
-
})) && _vo1(value, _path +
|
|
52
|
-
path: _path +
|
|
48
|
+
})) && _vo1(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), _exceptionable) || _report(_exceptionable, {
|
|
49
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
53
50
|
expected: "ESLintTodoEntryV1",
|
|
54
51
|
value
|
|
55
52
|
});
|
|
@@ -78,7 +75,7 @@ const TodoModuleV1Handler = {
|
|
|
78
75
|
const value = input[key];
|
|
79
76
|
if (void 0 === value) return true;
|
|
80
77
|
return _report(_exceptionable, {
|
|
81
|
-
path: _path +
|
|
78
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
82
79
|
expected: "undefined",
|
|
83
80
|
value,
|
|
84
81
|
description: [
|
|
@@ -95,15 +92,15 @@ const TodoModuleV1Handler = {
|
|
|
95
92
|
return (input) => {
|
|
96
93
|
if (false === __is(input)) {
|
|
97
94
|
errors = [];
|
|
98
|
-
_report =
|
|
99
|
-
((input
|
|
95
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
96
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _report(true, {
|
|
100
97
|
path: _path + "",
|
|
101
98
|
expected: "TodoModuleV1",
|
|
102
|
-
value: input
|
|
103
|
-
})) && _vo0(input
|
|
99
|
+
value: input
|
|
100
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
104
101
|
path: _path + "",
|
|
105
102
|
expected: "TodoModuleV1",
|
|
106
|
-
value: input
|
|
103
|
+
value: input
|
|
107
104
|
}))(input, "$input", true);
|
|
108
105
|
const success = 0 === errors.length;
|
|
109
106
|
return success ? {
|
package/dist/todofile/v2.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { __toESM } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require__accessExpressionAsString } from "../node_modules/.pnpm/typia@11.0.0_typescript@5.9.3/node_modules/typia/lib/internal/_accessExpressionAsString.mjs";
|
|
3
|
-
import { require__validateReport } from "../node_modules/.pnpm/typia@11.0.0_typescript@5.9.3/node_modules/typia/lib/internal/_validateReport.mjs";
|
|
4
1
|
import { isNonEmptyString } from "../utils/string.mjs";
|
|
5
2
|
import { relative } from "pathe";
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
4
|
+
import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js";
|
|
8
5
|
const TodoModuleV2Handler = {
|
|
9
6
|
version: 2,
|
|
10
7
|
buildTodoFromLintResults(lintResult, config) {
|
|
@@ -83,7 +80,7 @@ const TodoModuleV2Handler = {
|
|
|
83
80
|
const value = input[key];
|
|
84
81
|
if (void 0 === value) return true;
|
|
85
82
|
return _report(_exceptionable, {
|
|
86
|
-
path: _path +
|
|
83
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
87
84
|
expected: "undefined",
|
|
88
85
|
value,
|
|
89
86
|
description: [
|
|
@@ -103,7 +100,7 @@ const TodoModuleV2Handler = {
|
|
|
103
100
|
const value = input[key];
|
|
104
101
|
if (void 0 === value) return true;
|
|
105
102
|
return _report(_exceptionable, {
|
|
106
|
-
path: _path +
|
|
103
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
107
104
|
expected: "undefined",
|
|
108
105
|
value,
|
|
109
106
|
description: [
|
|
@@ -117,11 +114,11 @@ const TodoModuleV2Handler = {
|
|
|
117
114
|
const value = input[key];
|
|
118
115
|
if (void 0 === value) return true;
|
|
119
116
|
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
120
|
-
path: _path +
|
|
117
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
121
118
|
expected: "ESLintTodoEntryV2",
|
|
122
119
|
value
|
|
123
|
-
})) && _vo3(value, _path +
|
|
124
|
-
path: _path +
|
|
120
|
+
})) && _vo3(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), _exceptionable) || _report(_exceptionable, {
|
|
121
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
125
122
|
expected: "ESLintTodoEntryV2",
|
|
126
123
|
value
|
|
127
124
|
});
|
|
@@ -146,7 +143,7 @@ const TodoModuleV2Handler = {
|
|
|
146
143
|
const value = input[key];
|
|
147
144
|
if (void 0 === value) return true;
|
|
148
145
|
return _report(_exceptionable, {
|
|
149
|
-
path: _path +
|
|
146
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
150
147
|
expected: "undefined",
|
|
151
148
|
value,
|
|
152
149
|
description: [
|
|
@@ -161,7 +158,7 @@ const TodoModuleV2Handler = {
|
|
|
161
158
|
const value = input[key];
|
|
162
159
|
if (void 0 === value) return true;
|
|
163
160
|
return "number" === typeof value || _report(_exceptionable, {
|
|
164
|
-
path: _path +
|
|
161
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
165
162
|
expected: "number",
|
|
166
163
|
value
|
|
167
164
|
});
|
|
@@ -172,15 +169,15 @@ const TodoModuleV2Handler = {
|
|
|
172
169
|
return (input) => {
|
|
173
170
|
if (false === __is(input)) {
|
|
174
171
|
errors = [];
|
|
175
|
-
_report =
|
|
176
|
-
((input
|
|
172
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
173
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
177
174
|
path: _path + "",
|
|
178
175
|
expected: "TodoModuleV2",
|
|
179
|
-
value: input
|
|
180
|
-
})) && _vo0(input
|
|
176
|
+
value: input
|
|
177
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
181
178
|
path: _path + "",
|
|
182
179
|
expected: "TodoModuleV2",
|
|
183
|
-
value: input
|
|
180
|
+
value: input
|
|
184
181
|
}))(input, "$input", true);
|
|
185
182
|
const success = 0 === errors.length;
|
|
186
183
|
return success ? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sushichan044/eslint-todo",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "A simple tool to gradually resolve a large number of ESLint violations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,58 +35,54 @@
|
|
|
35
35
|
"registry": "https://registry.npmjs.org/"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@sushichan044/eslint-config-array-resolver": "0.
|
|
38
|
+
"@sushichan044/eslint-config-array-resolver": "0.2.2",
|
|
39
39
|
"comlink": "4.4.2",
|
|
40
40
|
"consola": "3.4.2",
|
|
41
41
|
"defu": "6.1.4",
|
|
42
|
-
"gunshi": "0.
|
|
42
|
+
"gunshi": "0.29.3",
|
|
43
43
|
"hookable": "6.0.1",
|
|
44
44
|
"jiti": "2.6.1",
|
|
45
45
|
"klona": "2.0.6",
|
|
46
|
-
"magicast": "0.5.
|
|
46
|
+
"magicast": "0.5.2",
|
|
47
47
|
"pathe": "2.0.3",
|
|
48
|
-
"picomatch": "4.0.
|
|
49
|
-
"tinyexec": "1.0.2"
|
|
48
|
+
"picomatch": "4.0.4",
|
|
49
|
+
"tinyexec": "1.0.2",
|
|
50
|
+
"typia": "11.0.3"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@arethetypeswrong/core": "0.18.2",
|
|
53
54
|
"@ryoppippi/unplugin-typia": "2.6.5",
|
|
54
55
|
"@types/fs-extra": "11.0.4",
|
|
55
|
-
"@types/node": "
|
|
56
|
+
"@types/node": "24.10.12",
|
|
56
57
|
"@types/picomatch": "4.0.2",
|
|
57
58
|
"@virtual-live-lab/eslint-config": "2.3.1",
|
|
58
59
|
"@virtual-live-lab/prettier-config": "2.0.22",
|
|
59
60
|
"@virtual-live-lab/tsconfig": "2.1.21",
|
|
60
|
-
"@vitest/eslint-plugin": "1.6.
|
|
61
|
-
"eslint": "
|
|
62
|
-
"eslint-flat-config-utils": "2.1.4",
|
|
61
|
+
"@vitest/eslint-plugin": "1.6.6",
|
|
62
|
+
"eslint": "10.1.0",
|
|
63
63
|
"eslint-plugin-import-access": "3.1.0",
|
|
64
64
|
"eslint-plugin-unicorn": "62.0.0",
|
|
65
|
-
"eslint-typegen": "2.3.0",
|
|
66
65
|
"fs-extra": "11.3.3",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"publint": "0.3.16",
|
|
73
|
-
"release-it": "19.2.2",
|
|
66
|
+
"globals": "17.3.0",
|
|
67
|
+
"oxfmt": "0.28.0",
|
|
68
|
+
"pkg-pr-new": "0.0.66",
|
|
69
|
+
"publint": "0.3.17",
|
|
70
|
+
"release-it": "19.2.4",
|
|
74
71
|
"release-it-pnpm": "4.6.6",
|
|
75
72
|
"ts-patch": "3.3.0",
|
|
76
|
-
"tsdown": "0.
|
|
73
|
+
"tsdown": "0.20.3",
|
|
77
74
|
"typescript": "5.9.3",
|
|
78
|
-
"typescript-eslint": "8.
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"vite": "
|
|
82
|
-
"
|
|
83
|
-
"vitest": "4.0.16"
|
|
75
|
+
"typescript-eslint": "8.58.0",
|
|
76
|
+
"unplugin-unused": "0.5.7",
|
|
77
|
+
"vite": "7.3.1",
|
|
78
|
+
"vite-node": "5.3.0",
|
|
79
|
+
"vitest": "4.0.18"
|
|
84
80
|
},
|
|
85
81
|
"peerDependencies": {
|
|
86
|
-
"eslint": "^
|
|
82
|
+
"eslint": "^9.0.0 || ^10.0.0"
|
|
87
83
|
},
|
|
88
84
|
"engines": {
|
|
89
|
-
"node": "^
|
|
85
|
+
"node": "^22.0.0 || ^24.0.0 || >=25.0.0"
|
|
90
86
|
},
|
|
91
87
|
"scripts": {
|
|
92
88
|
"build": "tsdown --config-loader unrun",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
export { __commonJSMin, __toESM };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
var require__accessExpressionAsString = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports._accessExpressionAsString = void 0;
|
|
5
|
-
const _accessExpressionAsString = (str) => variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
|
|
6
|
-
exports._accessExpressionAsString = _accessExpressionAsString;
|
|
7
|
-
const variable = (str) => reserved(str) === false && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
|
|
8
|
-
const reserved = (str) => RESERVED.has(str);
|
|
9
|
-
const RESERVED = new Set([
|
|
10
|
-
"break",
|
|
11
|
-
"case",
|
|
12
|
-
"catch",
|
|
13
|
-
"class",
|
|
14
|
-
"const",
|
|
15
|
-
"continue",
|
|
16
|
-
"debugger",
|
|
17
|
-
"default",
|
|
18
|
-
"delete",
|
|
19
|
-
"do",
|
|
20
|
-
"else",
|
|
21
|
-
"enum",
|
|
22
|
-
"export",
|
|
23
|
-
"extends",
|
|
24
|
-
"false",
|
|
25
|
-
"finally",
|
|
26
|
-
"for",
|
|
27
|
-
"function",
|
|
28
|
-
"if",
|
|
29
|
-
"import",
|
|
30
|
-
"in",
|
|
31
|
-
"instanceof",
|
|
32
|
-
"new",
|
|
33
|
-
"null",
|
|
34
|
-
"return",
|
|
35
|
-
"super",
|
|
36
|
-
"switch",
|
|
37
|
-
"this",
|
|
38
|
-
"throw",
|
|
39
|
-
"true",
|
|
40
|
-
"try",
|
|
41
|
-
"typeof",
|
|
42
|
-
"var",
|
|
43
|
-
"void",
|
|
44
|
-
"while",
|
|
45
|
-
"with"
|
|
46
|
-
]);
|
|
47
|
-
}));
|
|
48
|
-
export default require__accessExpressionAsString();
|
|
49
|
-
export { require__accessExpressionAsString };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
var require__createStandardSchema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports._createStandardSchema = void 0;
|
|
5
|
-
const _createStandardSchema = (fn) => Object.assign(fn, { "~standard": {
|
|
6
|
-
version: 1,
|
|
7
|
-
vendor: "typia",
|
|
8
|
-
validate: (input) => {
|
|
9
|
-
const result = fn(input);
|
|
10
|
-
if (result.success) return { value: result.data };
|
|
11
|
-
else return { issues: result.errors.map((error) => ({
|
|
12
|
-
message: `expected ${error.expected}, got ${error.value}`,
|
|
13
|
-
path: typiaPathToStandardSchemaPath(error.path)
|
|
14
|
-
})) };
|
|
15
|
-
}
|
|
16
|
-
} });
|
|
17
|
-
exports._createStandardSchema = _createStandardSchema;
|
|
18
|
-
var PathParserState;
|
|
19
|
-
(function(PathParserState) {
|
|
20
|
-
PathParserState[PathParserState["Start"] = 0] = "Start";
|
|
21
|
-
PathParserState[PathParserState["Property"] = 1] = "Property";
|
|
22
|
-
PathParserState[PathParserState["StringKey"] = 2] = "StringKey";
|
|
23
|
-
PathParserState[PathParserState["NumberKey"] = 3] = "NumberKey";
|
|
24
|
-
})(PathParserState || (PathParserState = {}));
|
|
25
|
-
const typiaPathToStandardSchemaPath = (path) => {
|
|
26
|
-
if (!path.startsWith("$input")) throw new Error(`Invalid path: ${JSON.stringify(path)}`);
|
|
27
|
-
const segments = [];
|
|
28
|
-
let currentSegment = "";
|
|
29
|
-
let state = PathParserState.Start;
|
|
30
|
-
let index = 5;
|
|
31
|
-
while (index < path.length - 1) {
|
|
32
|
-
index++;
|
|
33
|
-
const char = path[index];
|
|
34
|
-
if (state === PathParserState.Property) if (char === "." || char === "[") {
|
|
35
|
-
segments.push({ key: currentSegment });
|
|
36
|
-
state = PathParserState.Start;
|
|
37
|
-
} else if (index === path.length - 1) {
|
|
38
|
-
currentSegment += char;
|
|
39
|
-
segments.push({ key: currentSegment });
|
|
40
|
-
index++;
|
|
41
|
-
state = PathParserState.Start;
|
|
42
|
-
} else currentSegment += char;
|
|
43
|
-
else if (state === PathParserState.StringKey) if (char === "\"") {
|
|
44
|
-
segments.push({ key: JSON.parse(currentSegment + char) });
|
|
45
|
-
index += 2;
|
|
46
|
-
state = PathParserState.Start;
|
|
47
|
-
} else if (char === "\\") {
|
|
48
|
-
currentSegment += path[index];
|
|
49
|
-
index++;
|
|
50
|
-
currentSegment += path[index];
|
|
51
|
-
} else currentSegment += char;
|
|
52
|
-
else if (state === PathParserState.NumberKey) if (char === "]") {
|
|
53
|
-
segments.push({ key: Number.parseInt(currentSegment) });
|
|
54
|
-
index++;
|
|
55
|
-
state = PathParserState.Start;
|
|
56
|
-
} else currentSegment += char;
|
|
57
|
-
if (state === PathParserState.Start && index < path.length - 1) {
|
|
58
|
-
const newChar = path[index];
|
|
59
|
-
currentSegment = "";
|
|
60
|
-
if (newChar === "[") if (path[index + 1] === "\"") {
|
|
61
|
-
state = PathParserState.StringKey;
|
|
62
|
-
index++;
|
|
63
|
-
currentSegment = "\"";
|
|
64
|
-
} else state = PathParserState.NumberKey;
|
|
65
|
-
else if (newChar === ".") state = PathParserState.Property;
|
|
66
|
-
else throw new Error("Unreachable: pointer points invalid character");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (state !== PathParserState.Start) throw new Error(`Failed to parse path: ${JSON.stringify(path)}`);
|
|
70
|
-
return segments;
|
|
71
|
-
};
|
|
72
|
-
}));
|
|
73
|
-
export default require__createStandardSchema();
|
|
74
|
-
export { require__createStandardSchema };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
var require__validateReport = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports._validateReport = void 0;
|
|
5
|
-
const _validateReport = (array) => {
|
|
6
|
-
const reportable = (path) => {
|
|
7
|
-
if (array.length === 0) return true;
|
|
8
|
-
const last = array[array.length - 1].path;
|
|
9
|
-
return path.length > last.length || last.substring(0, path.length) !== path;
|
|
10
|
-
};
|
|
11
|
-
return (exceptable, error) => {
|
|
12
|
-
var _a;
|
|
13
|
-
if (exceptable && reportable(error.path)) {
|
|
14
|
-
if (error.value === void 0) (_a = error.description) !== null && _a !== void 0 || (error.description = [
|
|
15
|
-
"The value at this path is `undefined`.",
|
|
16
|
-
"",
|
|
17
|
-
`Please fill the \`${error.expected}\` typed value next time.`
|
|
18
|
-
].join("\n"));
|
|
19
|
-
array.push(error);
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
exports._validateReport = _validateReport;
|
|
25
|
-
}));
|
|
26
|
-
export default require__validateReport();
|
|
27
|
-
export { require__validateReport };
|