@prisma/cli-init 0.0.0-dev.202511260055 → 0.0.0-dev.202511260112
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/{_-6Q3ARK63.js → _-VTLAS4VM.js} +1 -1
- package/dist/{accelerate-G7F7TX4S.js → accelerate-YEFEYVGD.js} +785 -1201
- package/dist/{chunk-IASWUJDO.js → chunk-7C5I22R2.js} +348 -434
- package/dist/{chunk-C6DDX2HM.js → chunk-T5EOVTT7.js} +1 -1
- package/dist/index.js +138 -132
- package/package.json +1 -1
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
-
// ../../node_modules/.pnpm/valibot@1.
|
|
4
|
-
var store
|
|
3
|
+
// ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.8.3/node_modules/valibot/dist/index.js
|
|
4
|
+
var store;
|
|
5
5
|
// @__NO_SIDE_EFFECTS__
|
|
6
|
-
function getGlobalConfig(
|
|
6
|
+
function getGlobalConfig(config2) {
|
|
7
7
|
return {
|
|
8
|
-
lang:
|
|
9
|
-
message:
|
|
10
|
-
abortEarly:
|
|
11
|
-
abortPipeEarly:
|
|
8
|
+
lang: config2?.lang ?? store?.lang,
|
|
9
|
+
message: config2?.message,
|
|
10
|
+
abortEarly: config2?.abortEarly ?? store?.abortEarly,
|
|
11
|
+
abortPipeEarly: config2?.abortPipeEarly ?? store?.abortPipeEarly
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
var
|
|
14
|
+
var store2;
|
|
15
15
|
// @__NO_SIDE_EFFECTS__
|
|
16
16
|
function getGlobalMessage(lang) {
|
|
17
|
-
return
|
|
17
|
+
return store2?.get(lang);
|
|
18
18
|
}
|
|
19
|
-
var
|
|
19
|
+
var store3;
|
|
20
20
|
// @__NO_SIDE_EFFECTS__
|
|
21
21
|
function getSchemaMessage(lang) {
|
|
22
|
-
return
|
|
22
|
+
return store3?.get(lang);
|
|
23
23
|
}
|
|
24
|
-
var
|
|
24
|
+
var store4;
|
|
25
25
|
// @__NO_SIDE_EFFECTS__
|
|
26
26
|
function getSpecificMessage(reference, lang) {
|
|
27
|
-
return
|
|
27
|
+
return store4?.get(reference)?.get(lang);
|
|
28
28
|
}
|
|
29
29
|
// @__NO_SIDE_EFFECTS__
|
|
30
30
|
function _stringify(input) {
|
|
31
31
|
const type = typeof input;
|
|
32
|
-
if (type === "string")
|
|
32
|
+
if (type === "string") {
|
|
33
33
|
return `"${input}"`;
|
|
34
|
-
|
|
34
|
+
}
|
|
35
|
+
if (type === "number" || type === "bigint" || type === "boolean") {
|
|
35
36
|
return `${input}`;
|
|
36
|
-
|
|
37
|
+
}
|
|
38
|
+
if (type === "object" || type === "function") {
|
|
37
39
|
return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
|
|
40
|
+
}
|
|
38
41
|
return type;
|
|
39
42
|
}
|
|
40
|
-
function _addIssue(context, label, dataset,
|
|
43
|
+
function _addIssue(context, label, dataset, config2, other) {
|
|
41
44
|
const input = other && "input" in other ? other.input : dataset.value;
|
|
42
45
|
const expected = other?.expected ?? context.expects ?? null;
|
|
43
46
|
const received = other?.received ?? /* @__PURE__ */ _stringify(input);
|
|
@@ -51,44 +54,51 @@ function _addIssue(context, label, dataset, config$1, other) {
|
|
|
51
54
|
requirement: context.requirement,
|
|
52
55
|
path: other?.path,
|
|
53
56
|
issues: other?.issues,
|
|
54
|
-
lang:
|
|
55
|
-
abortEarly:
|
|
56
|
-
abortPipeEarly:
|
|
57
|
+
lang: config2.lang,
|
|
58
|
+
abortEarly: config2.abortEarly,
|
|
59
|
+
abortPipeEarly: config2.abortPipeEarly
|
|
57
60
|
};
|
|
58
61
|
const isSchema = context.kind === "schema";
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
issue.message = typeof
|
|
62
|
-
|
|
62
|
+
const message2 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config2.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
|
|
63
|
+
if (message2 !== void 0) {
|
|
64
|
+
issue.message = typeof message2 === "function" ? (
|
|
65
|
+
// @ts-expect-error
|
|
66
|
+
message2(issue)
|
|
67
|
+
) : message2;
|
|
68
|
+
}
|
|
69
|
+
if (isSchema) {
|
|
63
70
|
dataset.typed = false;
|
|
64
|
-
|
|
71
|
+
}
|
|
72
|
+
if (dataset.issues) {
|
|
65
73
|
dataset.issues.push(issue);
|
|
66
|
-
else
|
|
74
|
+
} else {
|
|
67
75
|
dataset.issues = [issue];
|
|
76
|
+
}
|
|
68
77
|
}
|
|
69
78
|
// @__NO_SIDE_EFFECTS__
|
|
70
79
|
function _getStandardProps(context) {
|
|
71
80
|
return {
|
|
72
81
|
version: 1,
|
|
73
82
|
vendor: "valibot",
|
|
74
|
-
validate(
|
|
75
|
-
return context["~run"]({ value:
|
|
83
|
+
validate(value2) {
|
|
84
|
+
return context["~run"]({ value: value2 }, /* @__PURE__ */ getGlobalConfig());
|
|
76
85
|
}
|
|
77
86
|
};
|
|
78
87
|
}
|
|
79
88
|
// @__NO_SIDE_EFFECTS__
|
|
80
|
-
function _isValidObjectKey(
|
|
81
|
-
return Object.hasOwn(
|
|
89
|
+
function _isValidObjectKey(object2, key) {
|
|
90
|
+
return Object.hasOwn(object2, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
|
|
82
91
|
}
|
|
83
92
|
// @__NO_SIDE_EFFECTS__
|
|
84
|
-
function _joinExpects(
|
|
85
|
-
const list = [...new Set(
|
|
86
|
-
if (list.length > 1)
|
|
93
|
+
function _joinExpects(values2, separator) {
|
|
94
|
+
const list = [...new Set(values2)];
|
|
95
|
+
if (list.length > 1) {
|
|
87
96
|
return `(${list.join(` ${separator} `)})`;
|
|
97
|
+
}
|
|
88
98
|
return list[0] ?? "never";
|
|
89
99
|
}
|
|
90
100
|
// @__NO_SIDE_EFFECTS__
|
|
91
|
-
function integer(
|
|
101
|
+
function integer(message2) {
|
|
92
102
|
return {
|
|
93
103
|
kind: "validation",
|
|
94
104
|
type: "integer",
|
|
@@ -96,16 +106,17 @@ function integer(message$1) {
|
|
|
96
106
|
async: false,
|
|
97
107
|
expects: null,
|
|
98
108
|
requirement: Number.isInteger,
|
|
99
|
-
message:
|
|
100
|
-
"~run"(dataset,
|
|
101
|
-
if (dataset.typed && !this.requirement(dataset.value))
|
|
102
|
-
_addIssue(this, "integer", dataset,
|
|
109
|
+
message: message2,
|
|
110
|
+
"~run"(dataset, config2) {
|
|
111
|
+
if (dataset.typed && !this.requirement(dataset.value)) {
|
|
112
|
+
_addIssue(this, "integer", dataset, config2);
|
|
113
|
+
}
|
|
103
114
|
return dataset;
|
|
104
115
|
}
|
|
105
116
|
};
|
|
106
117
|
}
|
|
107
118
|
// @__NO_SIDE_EFFECTS__
|
|
108
|
-
function minLength(requirement,
|
|
119
|
+
function minLength(requirement, message2) {
|
|
109
120
|
return {
|
|
110
121
|
kind: "validation",
|
|
111
122
|
type: "min_length",
|
|
@@ -113,16 +124,19 @@ function minLength(requirement, message$1) {
|
|
|
113
124
|
async: false,
|
|
114
125
|
expects: `>=${requirement}`,
|
|
115
126
|
requirement,
|
|
116
|
-
message:
|
|
117
|
-
"~run"(dataset,
|
|
118
|
-
if (dataset.typed && dataset.value.length < this.requirement)
|
|
119
|
-
_addIssue(this, "length", dataset,
|
|
127
|
+
message: message2,
|
|
128
|
+
"~run"(dataset, config2) {
|
|
129
|
+
if (dataset.typed && dataset.value.length < this.requirement) {
|
|
130
|
+
_addIssue(this, "length", dataset, config2, {
|
|
131
|
+
received: `${dataset.value.length}`
|
|
132
|
+
});
|
|
133
|
+
}
|
|
120
134
|
return dataset;
|
|
121
135
|
}
|
|
122
136
|
};
|
|
123
137
|
}
|
|
124
138
|
// @__NO_SIDE_EFFECTS__
|
|
125
|
-
function minValue(requirement,
|
|
139
|
+
function minValue(requirement, message2) {
|
|
126
140
|
return {
|
|
127
141
|
kind: "validation",
|
|
128
142
|
type: "min_value",
|
|
@@ -130,39 +144,45 @@ function minValue(requirement, message$1) {
|
|
|
130
144
|
async: false,
|
|
131
145
|
expects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,
|
|
132
146
|
requirement,
|
|
133
|
-
message:
|
|
134
|
-
"~run"(dataset,
|
|
135
|
-
if (dataset.typed && !(dataset.value >= this.requirement))
|
|
136
|
-
_addIssue(this, "value", dataset,
|
|
147
|
+
message: message2,
|
|
148
|
+
"~run"(dataset, config2) {
|
|
149
|
+
if (dataset.typed && !(dataset.value >= this.requirement)) {
|
|
150
|
+
_addIssue(this, "value", dataset, config2, {
|
|
151
|
+
received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value)
|
|
152
|
+
});
|
|
153
|
+
}
|
|
137
154
|
return dataset;
|
|
138
155
|
}
|
|
139
156
|
};
|
|
140
157
|
}
|
|
141
158
|
// @__NO_SIDE_EFFECTS__
|
|
142
|
-
function parseJson(
|
|
159
|
+
function parseJson(config2, message2) {
|
|
143
160
|
return {
|
|
144
161
|
kind: "transformation",
|
|
145
162
|
type: "parse_json",
|
|
146
163
|
reference: parseJson,
|
|
147
|
-
config:
|
|
148
|
-
message:
|
|
164
|
+
config: config2,
|
|
165
|
+
message: message2,
|
|
149
166
|
async: false,
|
|
150
|
-
"~run"(dataset,
|
|
167
|
+
"~run"(dataset, config3) {
|
|
151
168
|
try {
|
|
152
169
|
dataset.value = JSON.parse(dataset.value, this.config?.reviver);
|
|
153
170
|
} catch (error) {
|
|
154
171
|
if (error instanceof Error) {
|
|
155
|
-
_addIssue(this, "JSON", dataset,
|
|
172
|
+
_addIssue(this, "JSON", dataset, config3, {
|
|
173
|
+
received: `"${error.message}"`
|
|
174
|
+
});
|
|
156
175
|
dataset.typed = false;
|
|
157
|
-
} else
|
|
176
|
+
} else {
|
|
158
177
|
throw error;
|
|
178
|
+
}
|
|
159
179
|
}
|
|
160
180
|
return dataset;
|
|
161
181
|
}
|
|
162
182
|
};
|
|
163
183
|
}
|
|
164
184
|
// @__NO_SIDE_EFFECTS__
|
|
165
|
-
function regex(requirement,
|
|
185
|
+
function regex(requirement, message2) {
|
|
166
186
|
return {
|
|
167
187
|
kind: "validation",
|
|
168
188
|
type: "regex",
|
|
@@ -170,16 +190,17 @@ function regex(requirement, message$1) {
|
|
|
170
190
|
async: false,
|
|
171
191
|
expects: `${requirement}`,
|
|
172
192
|
requirement,
|
|
173
|
-
message:
|
|
174
|
-
"~run"(dataset,
|
|
175
|
-
if (dataset.typed && !this.requirement.test(dataset.value))
|
|
176
|
-
_addIssue(this, "format", dataset,
|
|
193
|
+
message: message2,
|
|
194
|
+
"~run"(dataset, config2) {
|
|
195
|
+
if (dataset.typed && !this.requirement.test(dataset.value)) {
|
|
196
|
+
_addIssue(this, "format", dataset, config2);
|
|
197
|
+
}
|
|
177
198
|
return dataset;
|
|
178
199
|
}
|
|
179
200
|
};
|
|
180
201
|
}
|
|
181
202
|
// @__NO_SIDE_EFFECTS__
|
|
182
|
-
function url(
|
|
203
|
+
function url(message2) {
|
|
183
204
|
return {
|
|
184
205
|
kind: "validation",
|
|
185
206
|
type: "url",
|
|
@@ -194,24 +215,37 @@ function url(message$1) {
|
|
|
194
215
|
return false;
|
|
195
216
|
}
|
|
196
217
|
},
|
|
197
|
-
message:
|
|
198
|
-
"~run"(dataset,
|
|
199
|
-
if (dataset.typed && !this.requirement(dataset.value))
|
|
200
|
-
_addIssue(this, "URL", dataset,
|
|
218
|
+
message: message2,
|
|
219
|
+
"~run"(dataset, config2) {
|
|
220
|
+
if (dataset.typed && !this.requirement(dataset.value)) {
|
|
221
|
+
_addIssue(this, "URL", dataset, config2);
|
|
222
|
+
}
|
|
201
223
|
return dataset;
|
|
202
224
|
}
|
|
203
225
|
};
|
|
204
226
|
}
|
|
205
227
|
// @__NO_SIDE_EFFECTS__
|
|
206
|
-
function getFallback(schema, dataset,
|
|
207
|
-
return typeof schema.fallback === "function" ?
|
|
228
|
+
function getFallback(schema, dataset, config2) {
|
|
229
|
+
return typeof schema.fallback === "function" ? (
|
|
230
|
+
// @ts-expect-error
|
|
231
|
+
schema.fallback(dataset, config2)
|
|
232
|
+
) : (
|
|
233
|
+
// @ts-expect-error
|
|
234
|
+
schema.fallback
|
|
235
|
+
);
|
|
208
236
|
}
|
|
209
237
|
// @__NO_SIDE_EFFECTS__
|
|
210
|
-
function getDefault(schema, dataset,
|
|
211
|
-
return typeof schema.default === "function" ?
|
|
238
|
+
function getDefault(schema, dataset, config2) {
|
|
239
|
+
return typeof schema.default === "function" ? (
|
|
240
|
+
// @ts-expect-error
|
|
241
|
+
schema.default(dataset, config2)
|
|
242
|
+
) : (
|
|
243
|
+
// @ts-expect-error
|
|
244
|
+
schema.default
|
|
245
|
+
);
|
|
212
246
|
}
|
|
213
247
|
// @__NO_SIDE_EFFECTS__
|
|
214
|
-
function array(item,
|
|
248
|
+
function array(item, message2) {
|
|
215
249
|
return {
|
|
216
250
|
kind: "schema",
|
|
217
251
|
type: "array",
|
|
@@ -219,52 +253,56 @@ function array(item, message$1) {
|
|
|
219
253
|
expects: "Array",
|
|
220
254
|
async: false,
|
|
221
255
|
item,
|
|
222
|
-
message:
|
|
256
|
+
message: message2,
|
|
223
257
|
get "~standard"() {
|
|
224
258
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
225
259
|
},
|
|
226
|
-
"~run"(dataset,
|
|
260
|
+
"~run"(dataset, config2) {
|
|
227
261
|
const input = dataset.value;
|
|
228
262
|
if (Array.isArray(input)) {
|
|
229
263
|
dataset.typed = true;
|
|
230
264
|
dataset.value = [];
|
|
231
265
|
for (let key = 0; key < input.length; key++) {
|
|
232
|
-
const
|
|
233
|
-
const itemDataset = this.item["~run"]({ value:
|
|
266
|
+
const value2 = input[key];
|
|
267
|
+
const itemDataset = this.item["~run"]({ value: value2 }, config2);
|
|
234
268
|
if (itemDataset.issues) {
|
|
235
269
|
const pathItem = {
|
|
236
270
|
type: "array",
|
|
237
271
|
origin: "value",
|
|
238
272
|
input,
|
|
239
273
|
key,
|
|
240
|
-
value:
|
|
274
|
+
value: value2
|
|
241
275
|
};
|
|
242
276
|
for (const issue of itemDataset.issues) {
|
|
243
|
-
if (issue.path)
|
|
277
|
+
if (issue.path) {
|
|
244
278
|
issue.path.unshift(pathItem);
|
|
245
|
-
else
|
|
279
|
+
} else {
|
|
246
280
|
issue.path = [pathItem];
|
|
281
|
+
}
|
|
247
282
|
dataset.issues?.push(issue);
|
|
248
283
|
}
|
|
249
|
-
if (!dataset.issues)
|
|
284
|
+
if (!dataset.issues) {
|
|
250
285
|
dataset.issues = itemDataset.issues;
|
|
251
|
-
|
|
286
|
+
}
|
|
287
|
+
if (config2.abortEarly) {
|
|
252
288
|
dataset.typed = false;
|
|
253
289
|
break;
|
|
254
290
|
}
|
|
255
291
|
}
|
|
256
|
-
if (!itemDataset.typed)
|
|
292
|
+
if (!itemDataset.typed) {
|
|
257
293
|
dataset.typed = false;
|
|
294
|
+
}
|
|
258
295
|
dataset.value.push(itemDataset.value);
|
|
259
296
|
}
|
|
260
|
-
} else
|
|
261
|
-
_addIssue(this, "type", dataset,
|
|
297
|
+
} else {
|
|
298
|
+
_addIssue(this, "type", dataset, config2);
|
|
299
|
+
}
|
|
262
300
|
return dataset;
|
|
263
301
|
}
|
|
264
302
|
};
|
|
265
303
|
}
|
|
266
304
|
// @__NO_SIDE_EFFECTS__
|
|
267
|
-
function literal(literal_,
|
|
305
|
+
function literal(literal_, message2) {
|
|
268
306
|
return {
|
|
269
307
|
kind: "schema",
|
|
270
308
|
type: "literal",
|
|
@@ -272,185 +310,213 @@ function literal(literal_, message$1) {
|
|
|
272
310
|
expects: /* @__PURE__ */ _stringify(literal_),
|
|
273
311
|
async: false,
|
|
274
312
|
literal: literal_,
|
|
275
|
-
message:
|
|
313
|
+
message: message2,
|
|
276
314
|
get "~standard"() {
|
|
277
315
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
278
316
|
},
|
|
279
|
-
"~run"(dataset,
|
|
280
|
-
if (dataset.value === this.literal)
|
|
317
|
+
"~run"(dataset, config2) {
|
|
318
|
+
if (dataset.value === this.literal) {
|
|
281
319
|
dataset.typed = true;
|
|
282
|
-
else
|
|
283
|
-
_addIssue(this, "type", dataset,
|
|
320
|
+
} else {
|
|
321
|
+
_addIssue(this, "type", dataset, config2);
|
|
322
|
+
}
|
|
284
323
|
return dataset;
|
|
285
324
|
}
|
|
286
325
|
};
|
|
287
326
|
}
|
|
288
327
|
// @__NO_SIDE_EFFECTS__
|
|
289
|
-
function looseObject(
|
|
328
|
+
function looseObject(entries2, message2) {
|
|
290
329
|
return {
|
|
291
330
|
kind: "schema",
|
|
292
331
|
type: "loose_object",
|
|
293
332
|
reference: looseObject,
|
|
294
333
|
expects: "Object",
|
|
295
334
|
async: false,
|
|
296
|
-
entries:
|
|
297
|
-
message:
|
|
335
|
+
entries: entries2,
|
|
336
|
+
message: message2,
|
|
298
337
|
get "~standard"() {
|
|
299
338
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
300
339
|
},
|
|
301
|
-
"~run"(dataset,
|
|
340
|
+
"~run"(dataset, config2) {
|
|
302
341
|
const input = dataset.value;
|
|
303
342
|
if (input && typeof input === "object") {
|
|
304
343
|
dataset.typed = true;
|
|
305
344
|
dataset.value = {};
|
|
306
345
|
for (const key in this.entries) {
|
|
307
346
|
const valueSchema = this.entries[key];
|
|
308
|
-
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") &&
|
|
309
|
-
|
|
310
|
-
const
|
|
347
|
+
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && // @ts-expect-error
|
|
348
|
+
valueSchema.default !== void 0) {
|
|
349
|
+
const value2 = key in input ? (
|
|
350
|
+
// @ts-expect-error
|
|
351
|
+
input[key]
|
|
352
|
+
) : /* @__PURE__ */ getDefault(valueSchema);
|
|
353
|
+
const valueDataset = valueSchema["~run"]({ value: value2 }, config2);
|
|
311
354
|
if (valueDataset.issues) {
|
|
312
355
|
const pathItem = {
|
|
313
356
|
type: "object",
|
|
314
357
|
origin: "value",
|
|
315
358
|
input,
|
|
316
359
|
key,
|
|
317
|
-
value:
|
|
360
|
+
value: value2
|
|
318
361
|
};
|
|
319
362
|
for (const issue of valueDataset.issues) {
|
|
320
|
-
if (issue.path)
|
|
363
|
+
if (issue.path) {
|
|
321
364
|
issue.path.unshift(pathItem);
|
|
322
|
-
else
|
|
365
|
+
} else {
|
|
323
366
|
issue.path = [pathItem];
|
|
367
|
+
}
|
|
324
368
|
dataset.issues?.push(issue);
|
|
325
369
|
}
|
|
326
|
-
if (!dataset.issues)
|
|
370
|
+
if (!dataset.issues) {
|
|
327
371
|
dataset.issues = valueDataset.issues;
|
|
328
|
-
|
|
372
|
+
}
|
|
373
|
+
if (config2.abortEarly) {
|
|
329
374
|
dataset.typed = false;
|
|
330
375
|
break;
|
|
331
376
|
}
|
|
332
377
|
}
|
|
333
|
-
if (!valueDataset.typed)
|
|
378
|
+
if (!valueDataset.typed) {
|
|
334
379
|
dataset.typed = false;
|
|
380
|
+
}
|
|
335
381
|
dataset.value[key] = valueDataset.value;
|
|
336
|
-
} else if (valueSchema.fallback !== void 0)
|
|
382
|
+
} else if (valueSchema.fallback !== void 0) {
|
|
337
383
|
dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
338
|
-
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
339
|
-
_addIssue(this, "key", dataset,
|
|
384
|
+
} else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
385
|
+
_addIssue(this, "key", dataset, config2, {
|
|
340
386
|
input: void 0,
|
|
341
387
|
expected: `"${key}"`,
|
|
342
|
-
path: [
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
388
|
+
path: [
|
|
389
|
+
{
|
|
390
|
+
type: "object",
|
|
391
|
+
origin: "key",
|
|
392
|
+
input,
|
|
393
|
+
key,
|
|
394
|
+
// @ts-expect-error
|
|
395
|
+
value: input[key]
|
|
396
|
+
}
|
|
397
|
+
]
|
|
349
398
|
});
|
|
350
|
-
if (
|
|
399
|
+
if (config2.abortEarly) {
|
|
351
400
|
break;
|
|
401
|
+
}
|
|
352
402
|
}
|
|
353
403
|
}
|
|
354
|
-
if (!dataset.issues || !
|
|
355
|
-
for (const key in input)
|
|
356
|
-
if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries))
|
|
404
|
+
if (!dataset.issues || !config2.abortEarly) {
|
|
405
|
+
for (const key in input) {
|
|
406
|
+
if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) {
|
|
357
407
|
dataset.value[key] = input[key];
|
|
408
|
+
}
|
|
409
|
+
}
|
|
358
410
|
}
|
|
359
|
-
} else
|
|
360
|
-
_addIssue(this, "type", dataset,
|
|
411
|
+
} else {
|
|
412
|
+
_addIssue(this, "type", dataset, config2);
|
|
413
|
+
}
|
|
361
414
|
return dataset;
|
|
362
415
|
}
|
|
363
416
|
};
|
|
364
417
|
}
|
|
365
418
|
// @__NO_SIDE_EFFECTS__
|
|
366
|
-
function number(
|
|
419
|
+
function number(message2) {
|
|
367
420
|
return {
|
|
368
421
|
kind: "schema",
|
|
369
422
|
type: "number",
|
|
370
423
|
reference: number,
|
|
371
424
|
expects: "number",
|
|
372
425
|
async: false,
|
|
373
|
-
message:
|
|
426
|
+
message: message2,
|
|
374
427
|
get "~standard"() {
|
|
375
428
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
376
429
|
},
|
|
377
|
-
"~run"(dataset,
|
|
378
|
-
if (typeof dataset.value === "number" && !isNaN(dataset.value))
|
|
430
|
+
"~run"(dataset, config2) {
|
|
431
|
+
if (typeof dataset.value === "number" && !isNaN(dataset.value)) {
|
|
379
432
|
dataset.typed = true;
|
|
380
|
-
else
|
|
381
|
-
_addIssue(this, "type", dataset,
|
|
433
|
+
} else {
|
|
434
|
+
_addIssue(this, "type", dataset, config2);
|
|
435
|
+
}
|
|
382
436
|
return dataset;
|
|
383
437
|
}
|
|
384
438
|
};
|
|
385
439
|
}
|
|
386
440
|
// @__NO_SIDE_EFFECTS__
|
|
387
|
-
function object(
|
|
441
|
+
function object(entries2, message2) {
|
|
388
442
|
return {
|
|
389
443
|
kind: "schema",
|
|
390
444
|
type: "object",
|
|
391
445
|
reference: object,
|
|
392
446
|
expects: "Object",
|
|
393
447
|
async: false,
|
|
394
|
-
entries:
|
|
395
|
-
message:
|
|
448
|
+
entries: entries2,
|
|
449
|
+
message: message2,
|
|
396
450
|
get "~standard"() {
|
|
397
451
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
398
452
|
},
|
|
399
|
-
"~run"(dataset,
|
|
453
|
+
"~run"(dataset, config2) {
|
|
400
454
|
const input = dataset.value;
|
|
401
455
|
if (input && typeof input === "object") {
|
|
402
456
|
dataset.typed = true;
|
|
403
457
|
dataset.value = {};
|
|
404
458
|
for (const key in this.entries) {
|
|
405
459
|
const valueSchema = this.entries[key];
|
|
406
|
-
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") &&
|
|
407
|
-
|
|
408
|
-
const
|
|
460
|
+
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && // @ts-expect-error
|
|
461
|
+
valueSchema.default !== void 0) {
|
|
462
|
+
const value2 = key in input ? (
|
|
463
|
+
// @ts-expect-error
|
|
464
|
+
input[key]
|
|
465
|
+
) : /* @__PURE__ */ getDefault(valueSchema);
|
|
466
|
+
const valueDataset = valueSchema["~run"]({ value: value2 }, config2);
|
|
409
467
|
if (valueDataset.issues) {
|
|
410
468
|
const pathItem = {
|
|
411
469
|
type: "object",
|
|
412
470
|
origin: "value",
|
|
413
471
|
input,
|
|
414
472
|
key,
|
|
415
|
-
value:
|
|
473
|
+
value: value2
|
|
416
474
|
};
|
|
417
475
|
for (const issue of valueDataset.issues) {
|
|
418
|
-
if (issue.path)
|
|
476
|
+
if (issue.path) {
|
|
419
477
|
issue.path.unshift(pathItem);
|
|
420
|
-
else
|
|
478
|
+
} else {
|
|
421
479
|
issue.path = [pathItem];
|
|
480
|
+
}
|
|
422
481
|
dataset.issues?.push(issue);
|
|
423
482
|
}
|
|
424
|
-
if (!dataset.issues)
|
|
483
|
+
if (!dataset.issues) {
|
|
425
484
|
dataset.issues = valueDataset.issues;
|
|
426
|
-
|
|
485
|
+
}
|
|
486
|
+
if (config2.abortEarly) {
|
|
427
487
|
dataset.typed = false;
|
|
428
488
|
break;
|
|
429
489
|
}
|
|
430
490
|
}
|
|
431
|
-
if (!valueDataset.typed)
|
|
491
|
+
if (!valueDataset.typed) {
|
|
432
492
|
dataset.typed = false;
|
|
493
|
+
}
|
|
433
494
|
dataset.value[key] = valueDataset.value;
|
|
434
|
-
} else if (valueSchema.fallback !== void 0)
|
|
495
|
+
} else if (valueSchema.fallback !== void 0) {
|
|
435
496
|
dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
436
|
-
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
437
|
-
_addIssue(this, "key", dataset,
|
|
497
|
+
} else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
498
|
+
_addIssue(this, "key", dataset, config2, {
|
|
438
499
|
input: void 0,
|
|
439
500
|
expected: `"${key}"`,
|
|
440
|
-
path: [
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
501
|
+
path: [
|
|
502
|
+
{
|
|
503
|
+
type: "object",
|
|
504
|
+
origin: "key",
|
|
505
|
+
input,
|
|
506
|
+
key,
|
|
507
|
+
// @ts-expect-error
|
|
508
|
+
value: input[key]
|
|
509
|
+
}
|
|
510
|
+
]
|
|
447
511
|
});
|
|
448
|
-
if (
|
|
512
|
+
if (config2.abortEarly) {
|
|
449
513
|
break;
|
|
514
|
+
}
|
|
450
515
|
}
|
|
451
516
|
}
|
|
452
|
-
} else
|
|
453
|
-
_addIssue(this, "type", dataset,
|
|
517
|
+
} else {
|
|
518
|
+
_addIssue(this, "type", dataset, config2);
|
|
519
|
+
}
|
|
454
520
|
return dataset;
|
|
455
521
|
}
|
|
456
522
|
};
|
|
@@ -468,36 +534,38 @@ function optional(wrapped, default_) {
|
|
|
468
534
|
get "~standard"() {
|
|
469
535
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
470
536
|
},
|
|
471
|
-
"~run"(dataset,
|
|
537
|
+
"~run"(dataset, config2) {
|
|
472
538
|
if (dataset.value === void 0) {
|
|
473
|
-
if (this.default !== void 0)
|
|
474
|
-
dataset.value = /* @__PURE__ */ getDefault(this, dataset,
|
|
539
|
+
if (this.default !== void 0) {
|
|
540
|
+
dataset.value = /* @__PURE__ */ getDefault(this, dataset, config2);
|
|
541
|
+
}
|
|
475
542
|
if (dataset.value === void 0) {
|
|
476
543
|
dataset.typed = true;
|
|
477
544
|
return dataset;
|
|
478
545
|
}
|
|
479
546
|
}
|
|
480
|
-
return this.wrapped["~run"](dataset,
|
|
547
|
+
return this.wrapped["~run"](dataset, config2);
|
|
481
548
|
}
|
|
482
549
|
};
|
|
483
550
|
}
|
|
484
551
|
// @__NO_SIDE_EFFECTS__
|
|
485
|
-
function string(
|
|
552
|
+
function string(message2) {
|
|
486
553
|
return {
|
|
487
554
|
kind: "schema",
|
|
488
555
|
type: "string",
|
|
489
556
|
reference: string,
|
|
490
557
|
expects: "string",
|
|
491
558
|
async: false,
|
|
492
|
-
message:
|
|
559
|
+
message: message2,
|
|
493
560
|
get "~standard"() {
|
|
494
561
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
495
562
|
},
|
|
496
|
-
"~run"(dataset,
|
|
497
|
-
if (typeof dataset.value === "string")
|
|
563
|
+
"~run"(dataset, config2) {
|
|
564
|
+
if (typeof dataset.value === "string") {
|
|
498
565
|
dataset.typed = true;
|
|
499
|
-
else
|
|
500
|
-
_addIssue(this, "type", dataset,
|
|
566
|
+
} else {
|
|
567
|
+
_addIssue(this, "type", dataset, config2);
|
|
568
|
+
}
|
|
501
569
|
return dataset;
|
|
502
570
|
}
|
|
503
571
|
};
|
|
@@ -505,88 +573,107 @@ function string(message$1) {
|
|
|
505
573
|
// @__NO_SIDE_EFFECTS__
|
|
506
574
|
function _subIssues(datasets) {
|
|
507
575
|
let issues;
|
|
508
|
-
if (datasets)
|
|
509
|
-
for (const dataset of datasets)
|
|
510
|
-
if (issues)
|
|
576
|
+
if (datasets) {
|
|
577
|
+
for (const dataset of datasets) {
|
|
578
|
+
if (issues) {
|
|
511
579
|
issues.push(...dataset.issues);
|
|
512
|
-
else
|
|
580
|
+
} else {
|
|
513
581
|
issues = dataset.issues;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
514
585
|
return issues;
|
|
515
586
|
}
|
|
516
587
|
// @__NO_SIDE_EFFECTS__
|
|
517
|
-
function union(options,
|
|
588
|
+
function union(options, message2) {
|
|
518
589
|
return {
|
|
519
590
|
kind: "schema",
|
|
520
591
|
type: "union",
|
|
521
592
|
reference: union,
|
|
522
|
-
expects: /* @__PURE__ */ _joinExpects(
|
|
593
|
+
expects: /* @__PURE__ */ _joinExpects(
|
|
594
|
+
options.map((option) => option.expects),
|
|
595
|
+
"|"
|
|
596
|
+
),
|
|
523
597
|
async: false,
|
|
524
598
|
options,
|
|
525
|
-
message:
|
|
599
|
+
message: message2,
|
|
526
600
|
get "~standard"() {
|
|
527
601
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
528
602
|
},
|
|
529
|
-
"~run"(dataset,
|
|
603
|
+
"~run"(dataset, config2) {
|
|
530
604
|
let validDataset;
|
|
531
605
|
let typedDatasets;
|
|
532
606
|
let untypedDatasets;
|
|
533
607
|
for (const schema of this.options) {
|
|
534
|
-
const optionDataset = schema["~run"]({ value: dataset.value },
|
|
535
|
-
if (optionDataset.typed)
|
|
536
|
-
if (optionDataset.issues)
|
|
537
|
-
if (typedDatasets)
|
|
608
|
+
const optionDataset = schema["~run"]({ value: dataset.value }, config2);
|
|
609
|
+
if (optionDataset.typed) {
|
|
610
|
+
if (optionDataset.issues) {
|
|
611
|
+
if (typedDatasets) {
|
|
538
612
|
typedDatasets.push(optionDataset);
|
|
539
|
-
else
|
|
613
|
+
} else {
|
|
540
614
|
typedDatasets = [optionDataset];
|
|
541
|
-
|
|
615
|
+
}
|
|
616
|
+
} else {
|
|
542
617
|
validDataset = optionDataset;
|
|
543
618
|
break;
|
|
544
619
|
}
|
|
545
|
-
else
|
|
546
|
-
untypedDatasets
|
|
547
|
-
|
|
548
|
-
|
|
620
|
+
} else {
|
|
621
|
+
if (untypedDatasets) {
|
|
622
|
+
untypedDatasets.push(optionDataset);
|
|
623
|
+
} else {
|
|
624
|
+
untypedDatasets = [optionDataset];
|
|
625
|
+
}
|
|
626
|
+
}
|
|
549
627
|
}
|
|
550
|
-
if (validDataset)
|
|
628
|
+
if (validDataset) {
|
|
551
629
|
return validDataset;
|
|
630
|
+
}
|
|
552
631
|
if (typedDatasets) {
|
|
553
|
-
if (typedDatasets.length === 1)
|
|
632
|
+
if (typedDatasets.length === 1) {
|
|
554
633
|
return typedDatasets[0];
|
|
555
|
-
|
|
634
|
+
}
|
|
635
|
+
_addIssue(this, "type", dataset, config2, {
|
|
636
|
+
issues: /* @__PURE__ */ _subIssues(typedDatasets)
|
|
637
|
+
});
|
|
556
638
|
dataset.typed = true;
|
|
557
|
-
} else if (untypedDatasets?.length === 1)
|
|
639
|
+
} else if (untypedDatasets?.length === 1) {
|
|
558
640
|
return untypedDatasets[0];
|
|
559
|
-
else
|
|
560
|
-
_addIssue(this, "type", dataset,
|
|
641
|
+
} else {
|
|
642
|
+
_addIssue(this, "type", dataset, config2, {
|
|
643
|
+
issues: /* @__PURE__ */ _subIssues(untypedDatasets)
|
|
644
|
+
});
|
|
645
|
+
}
|
|
561
646
|
return dataset;
|
|
562
647
|
}
|
|
563
648
|
};
|
|
564
649
|
}
|
|
565
650
|
// @__NO_SIDE_EFFECTS__
|
|
566
|
-
function pipe(...
|
|
651
|
+
function pipe(...pipe2) {
|
|
567
652
|
return {
|
|
568
|
-
...
|
|
569
|
-
pipe:
|
|
653
|
+
...pipe2[0],
|
|
654
|
+
pipe: pipe2,
|
|
570
655
|
get "~standard"() {
|
|
571
656
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
572
657
|
},
|
|
573
|
-
"~run"(dataset,
|
|
574
|
-
for (const item of
|
|
658
|
+
"~run"(dataset, config2) {
|
|
659
|
+
for (const item of pipe2) {
|
|
575
660
|
if (item.kind !== "metadata") {
|
|
576
661
|
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
577
662
|
dataset.typed = false;
|
|
578
663
|
break;
|
|
579
664
|
}
|
|
580
|
-
if (!dataset.issues || !
|
|
581
|
-
dataset = item["~run"](dataset,
|
|
665
|
+
if (!dataset.issues || !config2.abortEarly && !config2.abortPipeEarly) {
|
|
666
|
+
dataset = item["~run"](dataset, config2);
|
|
667
|
+
}
|
|
582
668
|
}
|
|
669
|
+
}
|
|
583
670
|
return dataset;
|
|
584
671
|
}
|
|
585
672
|
};
|
|
586
673
|
}
|
|
587
674
|
// @__NO_SIDE_EFFECTS__
|
|
588
|
-
function safeParse(schema, input,
|
|
589
|
-
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(
|
|
675
|
+
function safeParse(schema, input, config2) {
|
|
676
|
+
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config2));
|
|
590
677
|
return {
|
|
591
678
|
typed: dataset.typed,
|
|
592
679
|
success: !dataset.issues,
|
|
@@ -693,7 +780,7 @@ function withResolvers(options) {
|
|
|
693
780
|
};
|
|
694
781
|
}
|
|
695
782
|
|
|
696
|
-
// ../../node_modules/.pnpm/std-env@3.
|
|
783
|
+
// ../../node_modules/.pnpm/std-env@3.9.0/node_modules/std-env/dist/index.mjs
|
|
697
784
|
var r = /* @__PURE__ */ Object.create(null);
|
|
698
785
|
var i = (e) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? r : globalThis);
|
|
699
786
|
var o = new Proxy(r, { get(e, s) {
|
|
@@ -829,110 +916,7 @@ function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
|
829
916
|
return linux(name);
|
|
830
917
|
}
|
|
831
918
|
|
|
832
|
-
// ../../node_modules/.pnpm/
|
|
833
|
-
var getNodes = (node) => {
|
|
834
|
-
const nodes = /* @__PURE__ */ new Set();
|
|
835
|
-
const queue = [node];
|
|
836
|
-
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
837
|
-
const node2 = queue[i2];
|
|
838
|
-
if (nodes.has(node2))
|
|
839
|
-
continue;
|
|
840
|
-
nodes.add(node2);
|
|
841
|
-
const { children } = node2;
|
|
842
|
-
if (!children?.length)
|
|
843
|
-
continue;
|
|
844
|
-
for (let ci = 0, cl = children.length; ci < cl; ci++) {
|
|
845
|
-
queue.push(children[ci]);
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
return Array.from(nodes);
|
|
849
|
-
};
|
|
850
|
-
var getNodeFlags = (node) => {
|
|
851
|
-
let flags = "";
|
|
852
|
-
const nodes = getNodes(node);
|
|
853
|
-
for (let i2 = 0, l2 = nodes.length; i2 < l2; i2++) {
|
|
854
|
-
const node2 = nodes[i2];
|
|
855
|
-
if (!node2.regex)
|
|
856
|
-
continue;
|
|
857
|
-
const nodeFlags = node2.regex.flags;
|
|
858
|
-
flags || (flags = nodeFlags);
|
|
859
|
-
if (flags === nodeFlags)
|
|
860
|
-
continue;
|
|
861
|
-
throw new Error(`Inconsistent RegExp flags used: "${flags}" and "${nodeFlags}"`);
|
|
862
|
-
}
|
|
863
|
-
return flags;
|
|
864
|
-
};
|
|
865
|
-
var getNodeSourceWithCache = (node, partial, cache) => {
|
|
866
|
-
const cached = cache.get(node);
|
|
867
|
-
if (cached !== void 0)
|
|
868
|
-
return cached;
|
|
869
|
-
const isNodePartial = node.partial ?? partial;
|
|
870
|
-
let source = "";
|
|
871
|
-
if (node.regex) {
|
|
872
|
-
source += isNodePartial ? "(?:$|" : "";
|
|
873
|
-
source += node.regex.source;
|
|
874
|
-
}
|
|
875
|
-
if (node.children?.length) {
|
|
876
|
-
const children = uniq(node.children.map((node2) => getNodeSourceWithCache(node2, partial, cache)).filter(Boolean));
|
|
877
|
-
if (children?.length) {
|
|
878
|
-
const isSomeChildNonPartial = node.children.some((child) => !child.regex || !(child.partial ?? partial));
|
|
879
|
-
const needsWrapperGroup = children.length > 1 || isNodePartial && (!source.length || isSomeChildNonPartial);
|
|
880
|
-
source += needsWrapperGroup ? isNodePartial ? "(?:$|" : "(?:" : "";
|
|
881
|
-
source += children.join("|");
|
|
882
|
-
source += needsWrapperGroup ? ")" : "";
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
if (node.regex) {
|
|
886
|
-
source += isNodePartial ? ")" : "";
|
|
887
|
-
}
|
|
888
|
-
cache.set(node, source);
|
|
889
|
-
return source;
|
|
890
|
-
};
|
|
891
|
-
var getNodeSource = (node, partial) => {
|
|
892
|
-
const cache = /* @__PURE__ */ new Map();
|
|
893
|
-
const nodes = getNodes(node);
|
|
894
|
-
for (let i2 = nodes.length - 1; i2 >= 0; i2--) {
|
|
895
|
-
const source = getNodeSourceWithCache(nodes[i2], partial, cache);
|
|
896
|
-
if (i2 > 0)
|
|
897
|
-
continue;
|
|
898
|
-
return source;
|
|
899
|
-
}
|
|
900
|
-
return "";
|
|
901
|
-
};
|
|
902
|
-
var uniq = (values) => {
|
|
903
|
-
return Array.from(new Set(values));
|
|
904
|
-
};
|
|
905
|
-
|
|
906
|
-
// ../../node_modules/.pnpm/graphmatch@1.1.0/node_modules/graphmatch/dist/index.js
|
|
907
|
-
var graphmatch = (node, input, options) => {
|
|
908
|
-
return graphmatch.compile(node, options).test(input);
|
|
909
|
-
};
|
|
910
|
-
graphmatch.compile = (node, options) => {
|
|
911
|
-
const partial = options?.partial ?? false;
|
|
912
|
-
const source = getNodeSource(node, partial);
|
|
913
|
-
const flags = getNodeFlags(node);
|
|
914
|
-
return new RegExp(`^(?:${source})$`, flags);
|
|
915
|
-
};
|
|
916
|
-
var dist_default = graphmatch;
|
|
917
|
-
|
|
918
|
-
// ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/compile/index.js
|
|
919
|
-
var compile = (node, options) => {
|
|
920
|
-
const re = dist_default.compile(node, options);
|
|
921
|
-
const source = `${re.source.slice(0, -1)}[\\\\/]?$`;
|
|
922
|
-
const flags = re.flags;
|
|
923
|
-
return new RegExp(source, flags);
|
|
924
|
-
};
|
|
925
|
-
var compile_default = compile;
|
|
926
|
-
|
|
927
|
-
// ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/merge/index.js
|
|
928
|
-
var merge = (res) => {
|
|
929
|
-
const source = res.map((re) => re.source).join("|") || "$^";
|
|
930
|
-
const flags = res[0]?.flags;
|
|
931
|
-
return new RegExp(source, flags);
|
|
932
|
-
};
|
|
933
|
-
var merge_default = merge;
|
|
934
|
-
|
|
935
|
-
// ../../node_modules/.pnpm/grammex@3.1.11/node_modules/grammex/dist/utils.js
|
|
919
|
+
// ../../node_modules/.pnpm/grammex@3.1.10/node_modules/grammex/dist/utils.js
|
|
936
920
|
var isArray = (value) => {
|
|
937
921
|
return Array.isArray(value);
|
|
938
922
|
};
|
|
@@ -988,7 +972,7 @@ var memoize = (fn) => {
|
|
|
988
972
|
};
|
|
989
973
|
};
|
|
990
974
|
|
|
991
|
-
// ../../node_modules/.pnpm/grammex@3.1.
|
|
975
|
+
// ../../node_modules/.pnpm/grammex@3.1.10/node_modules/grammex/dist/index.js
|
|
992
976
|
var parse = (input, rule, options = {}) => {
|
|
993
977
|
const state = { cache: {}, input, index: 0, indexBacktrackMax: 0, options, output: [] };
|
|
994
978
|
const matched = resolve(rule)(state);
|
|
@@ -1137,9 +1121,6 @@ var optional2 = (rule, handler) => {
|
|
|
1137
1121
|
var star = (rule, handler) => {
|
|
1138
1122
|
return repeat(rule, 0, Infinity, handler);
|
|
1139
1123
|
};
|
|
1140
|
-
var plus = (rule, handler) => {
|
|
1141
|
-
return repeat(rule, 1, Infinity, handler);
|
|
1142
|
-
};
|
|
1143
1124
|
var and = (rules, handler) => {
|
|
1144
1125
|
const erules = rules.map(resolve);
|
|
1145
1126
|
return memoizable(handleable(backtrackable((state) => {
|
|
@@ -1285,51 +1266,23 @@ var resolve = memoize((rule) => {
|
|
|
1285
1266
|
throw new Error("Invalid rule");
|
|
1286
1267
|
});
|
|
1287
1268
|
|
|
1288
|
-
// ../../node_modules/.pnpm/zeptomatch@2.
|
|
1269
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/utils.js
|
|
1289
1270
|
var identity = (value) => {
|
|
1290
1271
|
return value;
|
|
1291
1272
|
};
|
|
1292
|
-
var
|
|
1293
|
-
return
|
|
1294
|
-
};
|
|
1295
|
-
var memoizeByObject = (fn) => {
|
|
1296
|
-
const cacheFull = /* @__PURE__ */ new WeakMap();
|
|
1297
|
-
const cachePartial = /* @__PURE__ */ new WeakMap();
|
|
1298
|
-
return (globs, options) => {
|
|
1299
|
-
const cache = options?.partial ? cachePartial : cacheFull;
|
|
1300
|
-
const cached = cache.get(globs);
|
|
1301
|
-
if (cached !== void 0)
|
|
1302
|
-
return cached;
|
|
1303
|
-
const result = fn(globs, options);
|
|
1304
|
-
cache.set(globs, result);
|
|
1305
|
-
return result;
|
|
1273
|
+
var makeParser = (grammar) => {
|
|
1274
|
+
return (input) => {
|
|
1275
|
+
return parse(input, grammar, { memoization: false }).join("");
|
|
1306
1276
|
};
|
|
1307
1277
|
};
|
|
1308
|
-
var
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
const cache = options?.partial ? cachePartial : cacheFull;
|
|
1313
|
-
return cache[glob] ?? (cache[glob] = fn(glob, options));
|
|
1278
|
+
var memoize2 = (fn) => {
|
|
1279
|
+
const cache = {};
|
|
1280
|
+
return (arg) => {
|
|
1281
|
+
return cache[arg] ?? (cache[arg] = fn(arg));
|
|
1314
1282
|
};
|
|
1315
1283
|
};
|
|
1316
1284
|
|
|
1317
|
-
// ../../node_modules/.pnpm/zeptomatch@2.
|
|
1318
|
-
var Escaped = match(/\\./, identity);
|
|
1319
|
-
var Passthrough = match(/./, identity);
|
|
1320
|
-
var StarStarStar = match(/\*\*\*+/, "*");
|
|
1321
|
-
var StarStarNoLeft = match(/([^/{[(!])\*\*/, (_2, $1) => `${$1}*`);
|
|
1322
|
-
var StarStarNoRight = match(/(^|.)\*\*(?=[^*/)\]}])/, (_2, $1) => `${$1}*`);
|
|
1323
|
-
var Grammar = star(or([Escaped, StarStarStar, StarStarNoLeft, StarStarNoRight, Passthrough]));
|
|
1324
|
-
var grammar_default = Grammar;
|
|
1325
|
-
|
|
1326
|
-
// ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/normalize/index.js
|
|
1327
|
-
var normalize = (glob) => {
|
|
1328
|
-
return parse(glob, grammar_default, { memoization: false }).join("");
|
|
1329
|
-
};
|
|
1330
|
-
var normalize_default = normalize;
|
|
1331
|
-
|
|
1332
|
-
// ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/range.js
|
|
1285
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/range.js
|
|
1333
1286
|
var ALPHABET = "abcdefghijklmnopqrstuvwxyz";
|
|
1334
1287
|
var int2alpha = (int) => {
|
|
1335
1288
|
let alpha = "";
|
|
@@ -1363,121 +1316,82 @@ var makeRangeAlpha = (start, end) => {
|
|
|
1363
1316
|
return makeRangeInt(alpha2int(start), alpha2int(end)).map(int2alpha);
|
|
1364
1317
|
};
|
|
1365
1318
|
|
|
1366
|
-
// ../../node_modules/.pnpm/zeptomatch@2.
|
|
1367
|
-
var
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
var
|
|
1372
|
-
|
|
1373
|
-
};
|
|
1374
|
-
var sequence = /* @__PURE__ */ (() => {
|
|
1375
|
-
const pushToLeaves = (parent, child, handled) => {
|
|
1376
|
-
if (handled.has(parent))
|
|
1377
|
-
return;
|
|
1378
|
-
handled.add(parent);
|
|
1379
|
-
const { children } = parent;
|
|
1380
|
-
if (!children.length) {
|
|
1381
|
-
children.push(child);
|
|
1382
|
-
} else {
|
|
1383
|
-
for (let i2 = 0, l2 = children.length; i2 < l2; i2++) {
|
|
1384
|
-
pushToLeaves(children[i2], child, handled);
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
};
|
|
1388
|
-
return (nodes) => {
|
|
1389
|
-
if (!nodes.length) {
|
|
1390
|
-
return alternation([]);
|
|
1391
|
-
}
|
|
1392
|
-
for (let i2 = nodes.length - 1; i2 >= 1; i2--) {
|
|
1393
|
-
const handled = /* @__PURE__ */ new Set();
|
|
1394
|
-
const parent = nodes[i2 - 1];
|
|
1395
|
-
const child = nodes[i2];
|
|
1396
|
-
pushToLeaves(parent, child, handled);
|
|
1397
|
-
}
|
|
1398
|
-
return nodes[0];
|
|
1399
|
-
};
|
|
1400
|
-
})();
|
|
1401
|
-
var slash = () => {
|
|
1402
|
-
const regex4 = new RegExp("[\\\\/]", "s");
|
|
1403
|
-
return { regex: regex4, children: [] };
|
|
1404
|
-
};
|
|
1405
|
-
|
|
1406
|
-
// ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/parse/grammar.js
|
|
1407
|
-
var Escaped2 = match(/\\./, regex3);
|
|
1408
|
-
var Escape = match(/[$.*+?^(){}[\]\|]/, (char) => regex3(`\\${char}`));
|
|
1409
|
-
var Slash = match(/[\\\/]/, slash);
|
|
1410
|
-
var Passthrough2 = match(/[^$.*+?^(){}[\]\|\\\/]+/, regex3);
|
|
1411
|
-
var NegationOdd = match(/^(?:!!)*!(.*)$/, (_2, glob) => regex3(`(?!^${dist_default2.compile(glob).source}$).*?`));
|
|
1412
|
-
var NegationEven = match(/^(!!)+/);
|
|
1319
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/convert/grammar.js
|
|
1320
|
+
var Escaped = match(/\\./, identity);
|
|
1321
|
+
var Escape = match(/[$.*+?^(){}[\]\|]/, (char) => `\\${char}`);
|
|
1322
|
+
var Slash = match(/[\\/]/, "[\\\\/]");
|
|
1323
|
+
var Passthrough = match(/./, identity);
|
|
1324
|
+
var NegationOdd = match(/^(?:!!)*!(.*)$/, (_2, glob) => `(?!^${parser_default(glob)}$).*?`);
|
|
1325
|
+
var NegationEven = match(/^(!!)+/, "");
|
|
1413
1326
|
var Negation = or([NegationOdd, NegationEven]);
|
|
1414
|
-
var StarStarBetween = match(/\/(\*\*\/)+/, (
|
|
1415
|
-
var StarStarStart = match(/^(\*\*\/)+/,
|
|
1416
|
-
var StarStarEnd = match(/\/(\*\*)$/, (
|
|
1417
|
-
var StarStarNone = match(/\*\*/,
|
|
1327
|
+
var StarStarBetween = match(/\/(\*\*\/)+/, "(?:[\\\\/].+[\\\\/]|[\\\\/])");
|
|
1328
|
+
var StarStarStart = match(/^(\*\*\/)+/, "(?:^|.*[\\\\/])");
|
|
1329
|
+
var StarStarEnd = match(/\/(\*\*)$/, "(?:[\\\\/].*|$)");
|
|
1330
|
+
var StarStarNone = match(/\*\*/, ".*");
|
|
1418
1331
|
var StarStar = or([StarStarBetween, StarStarStart, StarStarEnd, StarStarNone]);
|
|
1419
|
-
var StarDouble = match(/\*\/(?!\*\*\/|\*$)/,
|
|
1420
|
-
var StarSingle = match(/\*/,
|
|
1332
|
+
var StarDouble = match(/\*\/(?!\*\*\/|\*$)/, "[^\\\\/]*[\\\\/]");
|
|
1333
|
+
var StarSingle = match(/\*/, "[^\\\\/]*");
|
|
1421
1334
|
var Star = or([StarDouble, StarSingle]);
|
|
1422
|
-
var Question = match("?",
|
|
1335
|
+
var Question = match("?", "[^\\\\/]");
|
|
1423
1336
|
var ClassOpen = match("[", identity);
|
|
1424
1337
|
var ClassClose = match("]", identity);
|
|
1425
1338
|
var ClassNegation = match(/[!^]/, "^\\\\/");
|
|
1426
1339
|
var ClassRange = match(/[a-z]-[a-z]|[0-9]-[0-9]/i, identity);
|
|
1427
|
-
var ClassEscaped = match(/\\./, identity);
|
|
1428
1340
|
var ClassEscape = match(/[$.*+?^(){}[\|]/, (char) => `\\${char}`);
|
|
1429
|
-
var
|
|
1430
|
-
var
|
|
1431
|
-
var
|
|
1432
|
-
var Class = and([ClassOpen, optional2(ClassNegation), star(ClassValue), ClassClose], (_2) => regex3(_2.join("")));
|
|
1341
|
+
var ClassPassthrough = match(/[^\]]/, identity);
|
|
1342
|
+
var ClassValue = or([Escaped, ClassEscape, ClassRange, ClassPassthrough]);
|
|
1343
|
+
var Class = and([ClassOpen, optional2(ClassNegation), star(ClassValue), ClassClose]);
|
|
1433
1344
|
var RangeOpen = match("{", "(?:");
|
|
1434
1345
|
var RangeClose = match("}", ")");
|
|
1435
1346
|
var RangeNumeric = match(/(\d+)\.\.(\d+)/, (_2, $1, $2) => makeRangePaddedInt(+$1, +$2, Math.min($1.length, $2.length)).join("|"));
|
|
1436
1347
|
var RangeAlphaLower = match(/([a-z]+)\.\.([a-z]+)/, (_2, $1, $2) => makeRangeAlpha($1, $2).join("|"));
|
|
1437
1348
|
var RangeAlphaUpper = match(/([A-Z]+)\.\.([A-Z]+)/, (_2, $1, $2) => makeRangeAlpha($1.toLowerCase(), $2.toLowerCase()).join("|").toUpperCase());
|
|
1438
1349
|
var RangeValue = or([RangeNumeric, RangeAlphaLower, RangeAlphaUpper]);
|
|
1439
|
-
var Range = and([RangeOpen, RangeValue, RangeClose]
|
|
1440
|
-
var BracesOpen = match("{");
|
|
1441
|
-
var BracesClose = match("}");
|
|
1442
|
-
var BracesComma = match(",");
|
|
1443
|
-
var
|
|
1444
|
-
var
|
|
1445
|
-
var BracesSlash = match(/[\\\/]/, slash);
|
|
1446
|
-
var BracesPassthrough = match(/[^$.*+?^(){}[\]\|\\\/,]+/, regex3);
|
|
1350
|
+
var Range = and([RangeOpen, RangeValue, RangeClose]);
|
|
1351
|
+
var BracesOpen = match("{", "(?:");
|
|
1352
|
+
var BracesClose = match("}", ")");
|
|
1353
|
+
var BracesComma = match(",", "|");
|
|
1354
|
+
var BracesEscape = match(/[$.*+?^(){[\]\|]/, (char) => `\\${char}`);
|
|
1355
|
+
var BracesPassthrough = match(/[^}]/, identity);
|
|
1447
1356
|
var BracesNested = lazy(() => Braces);
|
|
1448
|
-
var
|
|
1449
|
-
var
|
|
1450
|
-
var
|
|
1451
|
-
var
|
|
1452
|
-
|
|
1357
|
+
var BracesValue = or([StarStar, Star, Question, Class, Range, BracesNested, Escaped, BracesEscape, BracesComma, BracesPassthrough]);
|
|
1358
|
+
var Braces = and([BracesOpen, star(BracesValue), BracesClose]);
|
|
1359
|
+
var Grammar = star(or([Negation, StarStar, Star, Question, Class, Range, Braces, Escaped, Escape, Slash, Passthrough]));
|
|
1360
|
+
var grammar_default = Grammar;
|
|
1361
|
+
|
|
1362
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/convert/parser.js
|
|
1363
|
+
var parser = makeParser(grammar_default);
|
|
1364
|
+
var parser_default = parser;
|
|
1365
|
+
|
|
1366
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/normalize/grammar.js
|
|
1367
|
+
var Escaped2 = match(/\\./, identity);
|
|
1368
|
+
var Passthrough2 = match(/./, identity);
|
|
1369
|
+
var StarStarStar = match(/\*\*\*+/, "*");
|
|
1370
|
+
var StarStarNoLeft = match(/([^/{[(!])\*\*/, (_2, $1) => `${$1}*`);
|
|
1371
|
+
var StarStarNoRight = match(/(^|.)\*\*(?=[^*/)\]}])/, (_2, $1) => `${$1}*`);
|
|
1372
|
+
var Grammar2 = star(or([Escaped2, StarStarStar, StarStarNoLeft, StarStarNoRight, Passthrough2]));
|
|
1453
1373
|
var grammar_default2 = Grammar2;
|
|
1454
1374
|
|
|
1455
|
-
// ../../node_modules/.pnpm/zeptomatch@2.
|
|
1456
|
-
var
|
|
1457
|
-
|
|
1458
|
-
};
|
|
1459
|
-
var parse_default = _parse;
|
|
1375
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/normalize/parser.js
|
|
1376
|
+
var parser2 = makeParser(grammar_default2);
|
|
1377
|
+
var parser_default2 = parser2;
|
|
1460
1378
|
|
|
1461
|
-
// ../../node_modules/.pnpm/zeptomatch@2.
|
|
1462
|
-
var zeptomatch = (glob, path2
|
|
1463
|
-
|
|
1379
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/index.js
|
|
1380
|
+
var zeptomatch = (glob, path2) => {
|
|
1381
|
+
if (Array.isArray(glob)) {
|
|
1382
|
+
const res = glob.map(zeptomatch.compile);
|
|
1383
|
+
const isMatch = res.some((re) => re.test(path2));
|
|
1384
|
+
return isMatch;
|
|
1385
|
+
} else {
|
|
1386
|
+
const re = zeptomatch.compile(glob);
|
|
1387
|
+
const isMatch = re.test(path2);
|
|
1388
|
+
return isMatch;
|
|
1389
|
+
}
|
|
1464
1390
|
};
|
|
1465
|
-
zeptomatch.compile = (() => {
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
const compileGlobs = memoizeByObject((globs, options) => {
|
|
1470
|
-
return merge_default(globs.map((glob) => compileGlob(glob, options)));
|
|
1471
|
-
});
|
|
1472
|
-
return (glob, options) => {
|
|
1473
|
-
if (isString2(glob)) {
|
|
1474
|
-
return compileGlob(glob, options);
|
|
1475
|
-
} else {
|
|
1476
|
-
return compileGlobs(glob, options);
|
|
1477
|
-
}
|
|
1478
|
-
};
|
|
1479
|
-
})();
|
|
1480
|
-
var dist_default2 = zeptomatch;
|
|
1391
|
+
zeptomatch.compile = memoize2((glob) => {
|
|
1392
|
+
return new RegExp(`^${parser_default(parser_default2(glob))}[\\\\/]?$`, "s");
|
|
1393
|
+
});
|
|
1394
|
+
var dist_default = zeptomatch;
|
|
1481
1395
|
|
|
1482
1396
|
// ../../dev/server/src/filesystem.ts
|
|
1483
1397
|
var GLOBAL_DIR_ROOT_PATH = envPaths("prisma-dev");
|
|
@@ -1527,7 +1441,7 @@ async function readDirectoryNames(path2, globs) {
|
|
|
1527
1441
|
try {
|
|
1528
1442
|
const dirents = await readdir(path2, { withFileTypes: true });
|
|
1529
1443
|
return dirents.reduce((names, dirent) => {
|
|
1530
|
-
if (dirent.isDirectory() && !dirent.name.startsWith(".") && (!globs ||
|
|
1444
|
+
if (dirent.isDirectory() && !dirent.name.startsWith(".") && (!globs || dist_default(globs, dirent.name))) {
|
|
1531
1445
|
names.push(dirent.name);
|
|
1532
1446
|
}
|
|
1533
1447
|
return names;
|