drizzle-kit 0.20.17-e041df8 → 0.20.17-e0821c1
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/@types/utils.d.ts +1 -0
- package/bin.cjs +30109 -19077
- package/cli/commands/migrate.d.ts +41 -41
- package/cli/commands/mysqlIntrospect.d.ts +8 -8
- package/cli/commands/pgIntrospect.d.ts +8 -8
- package/cli/commands/sqliteIntrospect.d.ts +12 -12
- package/cli/commands/utils.d.ts +125 -3
- package/cli/connections.d.ts +7 -2
- package/cli/validations/cli.d.ts +61 -61
- package/cli/validations/common.d.ts +35 -35
- package/cli/validations/mysql.d.ts +4 -4
- package/cli/validations/outputs.d.ts +1 -2
- package/cli/validations/pg.d.ts +4 -4
- package/cli/validations/studio.d.ts +92 -0
- package/cli/views.d.ts +7 -0
- package/index.d.mts +7 -51
- package/index.d.ts +7 -51
- package/package.json +3 -2
- package/payload.js +1243 -557
- package/payload.mjs +1046 -360
- package/schemaValidator.d.ts +222 -222
- package/serializer/mysqlSchema.d.ts +892 -892
- package/serializer/pgSchema.d.ts +749 -749
- package/serializer/sqliteSchema.d.ts +457 -457
- package/serializer/studio.d.ts +20 -3
- package/snapshotsDiffer.d.ts +315 -316
- package/utils-studio.js +939 -828
- package/utils-studio.mjs +912 -801
- package/utils.js +844 -219
- package/utils.mjs +819 -194
package/payload.js
CHANGED
|
@@ -34,7 +34,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
));
|
|
35
35
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
36
|
|
|
37
|
-
// node_modules/.pnpm/chalk@5.
|
|
37
|
+
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
38
38
|
function assembleStyles() {
|
|
39
39
|
const codes = /* @__PURE__ */ new Map();
|
|
40
40
|
for (const [groupName, group] of Object.entries(styles)) {
|
|
@@ -151,7 +151,7 @@ function assembleStyles() {
|
|
|
151
151
|
}
|
|
152
152
|
var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
|
|
153
153
|
var init_ansi_styles = __esm({
|
|
154
|
-
"node_modules/.pnpm/chalk@5.
|
|
154
|
+
"node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
|
|
155
155
|
ANSI_BACKGROUND_OFFSET = 10;
|
|
156
156
|
wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
157
157
|
wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
@@ -225,7 +225,7 @@ var init_ansi_styles = __esm({
|
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
227
|
|
|
228
|
-
// node_modules/.pnpm/chalk@5.
|
|
228
|
+
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
229
229
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
|
|
230
230
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
231
231
|
const position = argv.indexOf(prefix + flag);
|
|
@@ -289,7 +289,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
289
289
|
return 1;
|
|
290
290
|
}
|
|
291
291
|
if ("CI" in env) {
|
|
292
|
-
if ("GITHUB_ACTIONS" in env) {
|
|
292
|
+
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
293
293
|
return 3;
|
|
294
294
|
}
|
|
295
295
|
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
@@ -337,7 +337,7 @@ function createSupportsColor(stream, options = {}) {
|
|
|
337
337
|
}
|
|
338
338
|
var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default;
|
|
339
339
|
var init_supports_color = __esm({
|
|
340
|
-
"node_modules/.pnpm/chalk@5.
|
|
340
|
+
"node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js"() {
|
|
341
341
|
import_node_process = __toESM(require("node:process"), 1);
|
|
342
342
|
import_node_os = __toESM(require("node:os"), 1);
|
|
343
343
|
import_node_tty = __toESM(require("node:tty"), 1);
|
|
@@ -355,7 +355,7 @@ var init_supports_color = __esm({
|
|
|
355
355
|
}
|
|
356
356
|
});
|
|
357
357
|
|
|
358
|
-
// node_modules/.pnpm/chalk@5.
|
|
358
|
+
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
|
|
359
359
|
function stringReplaceAll(string, substring, replacer) {
|
|
360
360
|
let index4 = string.indexOf(substring);
|
|
361
361
|
if (index4 === -1) {
|
|
@@ -385,21 +385,20 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index4) {
|
|
|
385
385
|
return returnValue;
|
|
386
386
|
}
|
|
387
387
|
var init_utilities = __esm({
|
|
388
|
-
"node_modules/.pnpm/chalk@5.
|
|
388
|
+
"node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js"() {
|
|
389
389
|
}
|
|
390
390
|
});
|
|
391
391
|
|
|
392
|
-
// node_modules/.pnpm/chalk@5.
|
|
392
|
+
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
|
|
393
393
|
function createChalk(options) {
|
|
394
394
|
return chalkFactory(options);
|
|
395
395
|
}
|
|
396
396
|
var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
|
|
397
397
|
var init_source = __esm({
|
|
398
|
-
"node_modules/.pnpm/chalk@5.
|
|
398
|
+
"node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js"() {
|
|
399
399
|
init_ansi_styles();
|
|
400
400
|
init_supports_color();
|
|
401
401
|
init_utilities();
|
|
402
|
-
init_ansi_styles();
|
|
403
402
|
({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
|
|
404
403
|
GENERATOR = Symbol("GENERATOR");
|
|
405
404
|
STYLER = Symbol("STYLER");
|
|
@@ -547,10 +546,10 @@ var init_source = __esm({
|
|
|
547
546
|
|
|
548
547
|
// node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js
|
|
549
548
|
var require_readline = __commonJS({
|
|
550
|
-
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js"(
|
|
549
|
+
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js"(exports2) {
|
|
551
550
|
"use strict";
|
|
552
|
-
Object.defineProperty(
|
|
553
|
-
|
|
551
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
552
|
+
exports2.prepareReadLine = void 0;
|
|
554
553
|
var prepareReadLine = () => {
|
|
555
554
|
const stdin = process.stdin;
|
|
556
555
|
const stdout = process.stdout;
|
|
@@ -566,13 +565,13 @@ var require_readline = __commonJS({
|
|
|
566
565
|
closable: rl
|
|
567
566
|
};
|
|
568
567
|
};
|
|
569
|
-
|
|
568
|
+
exports2.prepareReadLine = prepareReadLine;
|
|
570
569
|
}
|
|
571
570
|
});
|
|
572
571
|
|
|
573
572
|
// node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
574
573
|
var require_src = __commonJS({
|
|
575
|
-
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(
|
|
574
|
+
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports2, module2) {
|
|
576
575
|
"use strict";
|
|
577
576
|
var ESC = "\x1B";
|
|
578
577
|
var CSI = `${ESC}[`;
|
|
@@ -633,10 +632,10 @@ var require_src = __commonJS({
|
|
|
633
632
|
|
|
634
633
|
// node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/utils.js
|
|
635
634
|
var require_utils = __commonJS({
|
|
636
|
-
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/utils.js"(
|
|
635
|
+
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/utils.js"(exports2) {
|
|
637
636
|
"use strict";
|
|
638
|
-
Object.defineProperty(
|
|
639
|
-
|
|
637
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
638
|
+
exports2.clear = void 0;
|
|
640
639
|
var sisteransi_1 = require_src();
|
|
641
640
|
var strip = (str) => {
|
|
642
641
|
const pattern = [
|
|
@@ -657,13 +656,13 @@ var require_utils = __commonJS({
|
|
|
657
656
|
}
|
|
658
657
|
return sisteransi_1.erase.lines(rows);
|
|
659
658
|
};
|
|
660
|
-
|
|
659
|
+
exports2.clear = clear;
|
|
661
660
|
}
|
|
662
661
|
});
|
|
663
662
|
|
|
664
663
|
// node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js
|
|
665
664
|
var require_lodash = __commonJS({
|
|
666
|
-
"node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js"(
|
|
665
|
+
"node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js"(exports2, module2) {
|
|
667
666
|
var FUNC_ERROR_TEXT = "Expected a function";
|
|
668
667
|
var NAN = 0 / 0;
|
|
669
668
|
var symbolTag = "[object Symbol]";
|
|
@@ -811,9 +810,9 @@ var require_lodash = __commonJS({
|
|
|
811
810
|
|
|
812
811
|
// node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/index.js
|
|
813
812
|
var require_hanji = __commonJS({
|
|
814
|
-
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/index.js"(
|
|
813
|
+
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/index.js"(exports2) {
|
|
815
814
|
"use strict";
|
|
816
|
-
var __awaiter =
|
|
815
|
+
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
817
816
|
function adopt(value) {
|
|
818
817
|
return value instanceof P ? value : new P(function(resolve) {
|
|
819
818
|
resolve(value);
|
|
@@ -840,11 +839,11 @@ var require_hanji = __commonJS({
|
|
|
840
839
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
841
840
|
});
|
|
842
841
|
};
|
|
843
|
-
var __importDefault =
|
|
842
|
+
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
844
843
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
845
844
|
};
|
|
846
|
-
Object.defineProperty(
|
|
847
|
-
|
|
845
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
846
|
+
exports2.onTerminate = exports2.renderWithTask = exports2.render = exports2.TaskTerminal = exports2.TaskView = exports2.Terminal = exports2.deferred = exports2.SelectState = exports2.Prompt = void 0;
|
|
848
847
|
var readline_1 = require_readline();
|
|
849
848
|
var sisteransi_1 = require_src();
|
|
850
849
|
var utils_1 = require_utils();
|
|
@@ -879,7 +878,7 @@ var require_hanji = __commonJS({
|
|
|
879
878
|
this.inputCallbacks.forEach((it) => it(str, key));
|
|
880
879
|
}
|
|
881
880
|
};
|
|
882
|
-
|
|
881
|
+
exports2.Prompt = Prompt3;
|
|
883
882
|
var SelectState3 = class {
|
|
884
883
|
constructor(items) {
|
|
885
884
|
this.items = items;
|
|
@@ -907,7 +906,7 @@ var require_hanji = __commonJS({
|
|
|
907
906
|
return false;
|
|
908
907
|
}
|
|
909
908
|
};
|
|
910
|
-
|
|
909
|
+
exports2.SelectState = SelectState3;
|
|
911
910
|
var deferred = () => {
|
|
912
911
|
let resolve;
|
|
913
912
|
let reject;
|
|
@@ -921,7 +920,7 @@ var require_hanji = __commonJS({
|
|
|
921
920
|
promise
|
|
922
921
|
};
|
|
923
922
|
};
|
|
924
|
-
|
|
923
|
+
exports2.deferred = deferred;
|
|
925
924
|
var Terminal = class {
|
|
926
925
|
constructor(view, stdin, stdout, closable) {
|
|
927
926
|
this.view = view;
|
|
@@ -966,7 +965,7 @@ var require_hanji = __commonJS({
|
|
|
966
965
|
};
|
|
967
966
|
this.stdin.on("keypress", keypress);
|
|
968
967
|
this.view.attach(this);
|
|
969
|
-
const { resolve, promise } = (0,
|
|
968
|
+
const { resolve, promise } = (0, exports2.deferred)();
|
|
970
969
|
this.resolve = resolve;
|
|
971
970
|
this.promise = promise;
|
|
972
971
|
this.renderFunc = (0, lodash_throttle_1.default)((str) => {
|
|
@@ -997,7 +996,7 @@ var require_hanji = __commonJS({
|
|
|
997
996
|
this.renderFunc(`${clearPrefix}${string}`);
|
|
998
997
|
}
|
|
999
998
|
};
|
|
1000
|
-
|
|
999
|
+
exports2.Terminal = Terminal;
|
|
1001
1000
|
var TaskView2 = class {
|
|
1002
1001
|
constructor() {
|
|
1003
1002
|
this.attachCallbacks = [];
|
|
@@ -1022,7 +1021,7 @@ var require_hanji = __commonJS({
|
|
|
1022
1021
|
}
|
|
1023
1022
|
}
|
|
1024
1023
|
};
|
|
1025
|
-
|
|
1024
|
+
exports2.TaskView = TaskView2;
|
|
1026
1025
|
var TaskTerminal = class {
|
|
1027
1026
|
constructor(view, stdout) {
|
|
1028
1027
|
this.view = view;
|
|
@@ -1043,7 +1042,7 @@ var require_hanji = __commonJS({
|
|
|
1043
1042
|
this.stdout.write(`${clearPrefix}${string}`);
|
|
1044
1043
|
}
|
|
1045
1044
|
};
|
|
1046
|
-
|
|
1045
|
+
exports2.TaskTerminal = TaskTerminal;
|
|
1047
1046
|
function render6(view) {
|
|
1048
1047
|
const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
|
|
1049
1048
|
if (view instanceof Prompt3) {
|
|
@@ -1056,7 +1055,7 @@ var require_hanji = __commonJS({
|
|
|
1056
1055
|
closable.close();
|
|
1057
1056
|
return;
|
|
1058
1057
|
}
|
|
1059
|
-
|
|
1058
|
+
exports2.render = render6;
|
|
1060
1059
|
function renderWithTask2(view, task) {
|
|
1061
1060
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1062
1061
|
const terminal = new TaskTerminal(view, process.stdout);
|
|
@@ -1066,12 +1065,12 @@ var require_hanji = __commonJS({
|
|
|
1066
1065
|
return result;
|
|
1067
1066
|
});
|
|
1068
1067
|
}
|
|
1069
|
-
|
|
1068
|
+
exports2.renderWithTask = renderWithTask2;
|
|
1070
1069
|
var terminateHandler;
|
|
1071
1070
|
function onTerminate(callback) {
|
|
1072
1071
|
terminateHandler = callback;
|
|
1073
1072
|
}
|
|
1074
|
-
|
|
1073
|
+
exports2.onTerminate = onTerminate;
|
|
1075
1074
|
}
|
|
1076
1075
|
});
|
|
1077
1076
|
|
|
@@ -1110,11 +1109,12 @@ var init_global = __esm({
|
|
|
1110
1109
|
}
|
|
1111
1110
|
});
|
|
1112
1111
|
|
|
1113
|
-
// node_modules/.pnpm/zod@3.
|
|
1112
|
+
// node_modules/.pnpm/zod@3.23.4/node_modules/zod/lib/index.mjs
|
|
1114
1113
|
function getErrorMap() {
|
|
1115
1114
|
return overrideErrorMap;
|
|
1116
1115
|
}
|
|
1117
1116
|
function addIssueToContext(ctx, issueData) {
|
|
1117
|
+
const overrideMap = getErrorMap();
|
|
1118
1118
|
const issue = makeIssue({
|
|
1119
1119
|
issueData,
|
|
1120
1120
|
data: ctx.data,
|
|
@@ -1122,13 +1122,29 @@ function addIssueToContext(ctx, issueData) {
|
|
|
1122
1122
|
errorMaps: [
|
|
1123
1123
|
ctx.common.contextualErrorMap,
|
|
1124
1124
|
ctx.schemaErrorMap,
|
|
1125
|
-
|
|
1126
|
-
errorMap
|
|
1125
|
+
overrideMap,
|
|
1126
|
+
overrideMap === errorMap ? void 0 : errorMap
|
|
1127
1127
|
// then global default map
|
|
1128
1128
|
].filter((x) => !!x)
|
|
1129
1129
|
});
|
|
1130
1130
|
ctx.common.issues.push(issue);
|
|
1131
1131
|
}
|
|
1132
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1133
|
+
if (kind === "a" && !f)
|
|
1134
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
1135
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1136
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1137
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1138
|
+
}
|
|
1139
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1140
|
+
if (kind === "m")
|
|
1141
|
+
throw new TypeError("Private method is not writable");
|
|
1142
|
+
if (kind === "a" && !f)
|
|
1143
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
1144
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1145
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1146
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
1147
|
+
}
|
|
1132
1148
|
function processCreateParams(params) {
|
|
1133
1149
|
if (!params)
|
|
1134
1150
|
return {};
|
|
@@ -1139,15 +1155,50 @@ function processCreateParams(params) {
|
|
|
1139
1155
|
if (errorMap2)
|
|
1140
1156
|
return { errorMap: errorMap2, description };
|
|
1141
1157
|
const customMap = (iss, ctx) => {
|
|
1142
|
-
|
|
1143
|
-
|
|
1158
|
+
var _a, _b;
|
|
1159
|
+
const { message } = params;
|
|
1160
|
+
if (iss.code === "invalid_enum_value") {
|
|
1161
|
+
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
1162
|
+
}
|
|
1144
1163
|
if (typeof ctx.data === "undefined") {
|
|
1145
|
-
return { message:
|
|
1164
|
+
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
|
1146
1165
|
}
|
|
1147
|
-
|
|
1166
|
+
if (iss.code !== "invalid_type")
|
|
1167
|
+
return { message: ctx.defaultError };
|
|
1168
|
+
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
|
|
1148
1169
|
};
|
|
1149
1170
|
return { errorMap: customMap, description };
|
|
1150
1171
|
}
|
|
1172
|
+
function timeRegexSource(args) {
|
|
1173
|
+
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
1174
|
+
if (args.precision) {
|
|
1175
|
+
regex = `${regex}\\.\\d{${args.precision}}`;
|
|
1176
|
+
} else if (args.precision == null) {
|
|
1177
|
+
regex = `${regex}(\\.\\d+)?`;
|
|
1178
|
+
}
|
|
1179
|
+
return regex;
|
|
1180
|
+
}
|
|
1181
|
+
function timeRegex(args) {
|
|
1182
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
1183
|
+
}
|
|
1184
|
+
function datetimeRegex(args) {
|
|
1185
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
|
1186
|
+
const opts = [];
|
|
1187
|
+
opts.push(args.local ? `Z?` : `Z`);
|
|
1188
|
+
if (args.offset)
|
|
1189
|
+
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
1190
|
+
regex = `${regex}(${opts.join("|")})`;
|
|
1191
|
+
return new RegExp(`^${regex}$`);
|
|
1192
|
+
}
|
|
1193
|
+
function isValidIP(ip, version) {
|
|
1194
|
+
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
|
|
1195
|
+
return true;
|
|
1196
|
+
}
|
|
1197
|
+
if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
|
|
1198
|
+
return true;
|
|
1199
|
+
}
|
|
1200
|
+
return false;
|
|
1201
|
+
}
|
|
1151
1202
|
function floatSafeRemainder(val, step) {
|
|
1152
1203
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
1153
1204
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
@@ -1168,7 +1219,10 @@ function deepPartialify(schema4) {
|
|
|
1168
1219
|
shape: () => newShape
|
|
1169
1220
|
});
|
|
1170
1221
|
} else if (schema4 instanceof ZodArray) {
|
|
1171
|
-
return ZodArray
|
|
1222
|
+
return new ZodArray({
|
|
1223
|
+
...schema4._def,
|
|
1224
|
+
type: deepPartialify(schema4.element)
|
|
1225
|
+
});
|
|
1172
1226
|
} else if (schema4 instanceof ZodOptional) {
|
|
1173
1227
|
return ZodOptional.create(deepPartialify(schema4.unwrap()));
|
|
1174
1228
|
} else if (schema4 instanceof ZodNullable) {
|
|
@@ -1224,9 +1278,9 @@ function createZodEnum(values, params) {
|
|
|
1224
1278
|
...processCreateParams(params)
|
|
1225
1279
|
});
|
|
1226
1280
|
}
|
|
1227
|
-
var util, ZodParsedType, getParsedType, ZodIssueCode, ZodError, errorMap, overrideErrorMap, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, uuidRegex, emailRegex,
|
|
1281
|
+
var util, objectUtil, ZodParsedType, getParsedType, ZodIssueCode, ZodError, errorMap, overrideErrorMap, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, _ZodEnum_cache, _ZodNativeEnum_cache, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv6Regex, base64Regex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, coerce;
|
|
1228
1282
|
var init_lib = __esm({
|
|
1229
|
-
"node_modules/.pnpm/zod@3.
|
|
1283
|
+
"node_modules/.pnpm/zod@3.23.4/node_modules/zod/lib/index.mjs"() {
|
|
1230
1284
|
(function(util2) {
|
|
1231
1285
|
util2.assertEqual = (val) => val;
|
|
1232
1286
|
function assertIs(_arg) {
|
|
@@ -1284,6 +1338,15 @@ var init_lib = __esm({
|
|
|
1284
1338
|
return value;
|
|
1285
1339
|
};
|
|
1286
1340
|
})(util || (util = {}));
|
|
1341
|
+
(function(objectUtil2) {
|
|
1342
|
+
objectUtil2.mergeShapes = (first, second) => {
|
|
1343
|
+
return {
|
|
1344
|
+
...first,
|
|
1345
|
+
...second
|
|
1346
|
+
// second overwrites first
|
|
1347
|
+
};
|
|
1348
|
+
};
|
|
1349
|
+
})(objectUtil || (objectUtil = {}));
|
|
1287
1350
|
ZodParsedType = util.arrayToEnum([
|
|
1288
1351
|
"string",
|
|
1289
1352
|
"nan",
|
|
@@ -1365,7 +1428,7 @@ var init_lib = __esm({
|
|
|
1365
1428
|
"not_multiple_of",
|
|
1366
1429
|
"not_finite"
|
|
1367
1430
|
]);
|
|
1368
|
-
ZodError = class extends Error {
|
|
1431
|
+
ZodError = class _ZodError extends Error {
|
|
1369
1432
|
constructor(issues) {
|
|
1370
1433
|
super();
|
|
1371
1434
|
this.issues = [];
|
|
@@ -1423,6 +1486,11 @@ var init_lib = __esm({
|
|
|
1423
1486
|
processError(this);
|
|
1424
1487
|
return fieldErrors;
|
|
1425
1488
|
}
|
|
1489
|
+
static assert(value) {
|
|
1490
|
+
if (!(value instanceof _ZodError)) {
|
|
1491
|
+
throw new Error(`Not a ZodError: ${value}`);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1426
1494
|
toString() {
|
|
1427
1495
|
return this.message;
|
|
1428
1496
|
}
|
|
@@ -1489,7 +1557,12 @@ var init_lib = __esm({
|
|
|
1489
1557
|
break;
|
|
1490
1558
|
case ZodIssueCode.invalid_string:
|
|
1491
1559
|
if (typeof issue.validation === "object") {
|
|
1492
|
-
if ("
|
|
1560
|
+
if ("includes" in issue.validation) {
|
|
1561
|
+
message = `Invalid input: must include "${issue.validation.includes}"`;
|
|
1562
|
+
if (typeof issue.validation.position === "number") {
|
|
1563
|
+
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
|
1564
|
+
}
|
|
1565
|
+
} else if ("startsWith" in issue.validation) {
|
|
1493
1566
|
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
1494
1567
|
} else if ("endsWith" in issue.validation) {
|
|
1495
1568
|
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
@@ -1510,7 +1583,7 @@ var init_lib = __esm({
|
|
|
1510
1583
|
else if (issue.type === "number")
|
|
1511
1584
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
1512
1585
|
else if (issue.type === "date")
|
|
1513
|
-
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(issue.minimum)}`;
|
|
1586
|
+
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
1514
1587
|
else
|
|
1515
1588
|
message = "Invalid input";
|
|
1516
1589
|
break;
|
|
@@ -1521,8 +1594,10 @@ var init_lib = __esm({
|
|
|
1521
1594
|
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
1522
1595
|
else if (issue.type === "number")
|
|
1523
1596
|
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
1597
|
+
else if (issue.type === "bigint")
|
|
1598
|
+
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
1524
1599
|
else if (issue.type === "date")
|
|
1525
|
-
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(issue.maximum)}`;
|
|
1600
|
+
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
|
|
1526
1601
|
else
|
|
1527
1602
|
message = "Invalid input";
|
|
1528
1603
|
break;
|
|
@@ -1552,6 +1627,13 @@ var init_lib = __esm({
|
|
|
1552
1627
|
...issueData,
|
|
1553
1628
|
path: fullPath
|
|
1554
1629
|
};
|
|
1630
|
+
if (issueData.message !== void 0) {
|
|
1631
|
+
return {
|
|
1632
|
+
...issueData,
|
|
1633
|
+
path: fullPath,
|
|
1634
|
+
message: issueData.message
|
|
1635
|
+
};
|
|
1636
|
+
}
|
|
1555
1637
|
let errorMessage = "";
|
|
1556
1638
|
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
1557
1639
|
for (const map of maps) {
|
|
@@ -1560,7 +1642,7 @@ var init_lib = __esm({
|
|
|
1560
1642
|
return {
|
|
1561
1643
|
...issueData,
|
|
1562
1644
|
path: fullPath,
|
|
1563
|
-
message:
|
|
1645
|
+
message: errorMessage
|
|
1564
1646
|
};
|
|
1565
1647
|
};
|
|
1566
1648
|
ParseStatus = class _ParseStatus {
|
|
@@ -1589,9 +1671,11 @@ var init_lib = __esm({
|
|
|
1589
1671
|
static async mergeObjectAsync(status, pairs) {
|
|
1590
1672
|
const syncPairs = [];
|
|
1591
1673
|
for (const pair of pairs) {
|
|
1674
|
+
const key = await pair.key;
|
|
1675
|
+
const value = await pair.value;
|
|
1592
1676
|
syncPairs.push({
|
|
1593
|
-
key
|
|
1594
|
-
value
|
|
1677
|
+
key,
|
|
1678
|
+
value
|
|
1595
1679
|
});
|
|
1596
1680
|
}
|
|
1597
1681
|
return _ParseStatus.mergeObjectSync(status, syncPairs);
|
|
@@ -1608,7 +1692,7 @@ var init_lib = __esm({
|
|
|
1608
1692
|
status.dirty();
|
|
1609
1693
|
if (value.status === "dirty")
|
|
1610
1694
|
status.dirty();
|
|
1611
|
-
if (typeof value.value !== "undefined" || pair.alwaysSet) {
|
|
1695
|
+
if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
|
|
1612
1696
|
finalObject[key.value] = value.value;
|
|
1613
1697
|
}
|
|
1614
1698
|
}
|
|
@@ -1623,20 +1707,28 @@ var init_lib = __esm({
|
|
|
1623
1707
|
isAborted = (x) => x.status === "aborted";
|
|
1624
1708
|
isDirty = (x) => x.status === "dirty";
|
|
1625
1709
|
isValid = (x) => x.status === "valid";
|
|
1626
|
-
isAsync = (x) => typeof Promise !==
|
|
1710
|
+
isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
1627
1711
|
(function(errorUtil2) {
|
|
1628
1712
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
1629
1713
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
1630
1714
|
})(errorUtil || (errorUtil = {}));
|
|
1631
1715
|
ParseInputLazyPath = class {
|
|
1632
1716
|
constructor(parent, value, path2, key) {
|
|
1717
|
+
this._cachedPath = [];
|
|
1633
1718
|
this.parent = parent;
|
|
1634
1719
|
this.data = value;
|
|
1635
1720
|
this._path = path2;
|
|
1636
1721
|
this._key = key;
|
|
1637
1722
|
}
|
|
1638
1723
|
get path() {
|
|
1639
|
-
|
|
1724
|
+
if (!this._cachedPath.length) {
|
|
1725
|
+
if (this._key instanceof Array) {
|
|
1726
|
+
this._cachedPath.push(...this._path, ...this._key);
|
|
1727
|
+
} else {
|
|
1728
|
+
this._cachedPath.push(...this._path, this._key);
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
return this._cachedPath;
|
|
1640
1732
|
}
|
|
1641
1733
|
};
|
|
1642
1734
|
handleResult = (ctx, result) => {
|
|
@@ -1646,8 +1738,16 @@ var init_lib = __esm({
|
|
|
1646
1738
|
if (!ctx.common.issues.length) {
|
|
1647
1739
|
throw new Error("Validation failed but no issues detected.");
|
|
1648
1740
|
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1741
|
+
return {
|
|
1742
|
+
success: false,
|
|
1743
|
+
get error() {
|
|
1744
|
+
if (this._error)
|
|
1745
|
+
return this._error;
|
|
1746
|
+
const error2 = new ZodError(ctx.common.issues);
|
|
1747
|
+
this._error = error2;
|
|
1748
|
+
return this._error;
|
|
1749
|
+
}
|
|
1750
|
+
};
|
|
1651
1751
|
}
|
|
1652
1752
|
};
|
|
1653
1753
|
ZodType = class {
|
|
@@ -1675,6 +1775,7 @@ var init_lib = __esm({
|
|
|
1675
1775
|
this.catch = this.catch.bind(this);
|
|
1676
1776
|
this.describe = this.describe.bind(this);
|
|
1677
1777
|
this.pipe = this.pipe.bind(this);
|
|
1778
|
+
this.readonly = this.readonly.bind(this);
|
|
1678
1779
|
this.isNullable = this.isNullable.bind(this);
|
|
1679
1780
|
this.isOptional = this.isOptional.bind(this);
|
|
1680
1781
|
}
|
|
@@ -1819,28 +1920,29 @@ var init_lib = __esm({
|
|
|
1819
1920
|
return this._refinement(refinement);
|
|
1820
1921
|
}
|
|
1821
1922
|
optional() {
|
|
1822
|
-
return ZodOptional.create(this);
|
|
1923
|
+
return ZodOptional.create(this, this._def);
|
|
1823
1924
|
}
|
|
1824
1925
|
nullable() {
|
|
1825
|
-
return ZodNullable.create(this);
|
|
1926
|
+
return ZodNullable.create(this, this._def);
|
|
1826
1927
|
}
|
|
1827
1928
|
nullish() {
|
|
1828
|
-
return this.
|
|
1929
|
+
return this.nullable().optional();
|
|
1829
1930
|
}
|
|
1830
1931
|
array() {
|
|
1831
|
-
return ZodArray.create(this);
|
|
1932
|
+
return ZodArray.create(this, this._def);
|
|
1832
1933
|
}
|
|
1833
1934
|
promise() {
|
|
1834
|
-
return ZodPromise.create(this);
|
|
1935
|
+
return ZodPromise.create(this, this._def);
|
|
1835
1936
|
}
|
|
1836
1937
|
or(option) {
|
|
1837
|
-
return ZodUnion.create([this, option]);
|
|
1938
|
+
return ZodUnion.create([this, option], this._def);
|
|
1838
1939
|
}
|
|
1839
1940
|
and(incoming) {
|
|
1840
|
-
return ZodIntersection.create(this, incoming);
|
|
1941
|
+
return ZodIntersection.create(this, incoming, this._def);
|
|
1841
1942
|
}
|
|
1842
1943
|
transform(transform) {
|
|
1843
1944
|
return new ZodEffects({
|
|
1945
|
+
...processCreateParams(this._def),
|
|
1844
1946
|
schema: this,
|
|
1845
1947
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
1846
1948
|
effect: { type: "transform", transform }
|
|
@@ -1849,6 +1951,7 @@ var init_lib = __esm({
|
|
|
1849
1951
|
default(def) {
|
|
1850
1952
|
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
|
1851
1953
|
return new ZodDefault({
|
|
1954
|
+
...processCreateParams(this._def),
|
|
1852
1955
|
innerType: this,
|
|
1853
1956
|
defaultValue: defaultValueFunc,
|
|
1854
1957
|
typeName: ZodFirstPartyTypeKind.ZodDefault
|
|
@@ -1858,14 +1961,15 @@ var init_lib = __esm({
|
|
|
1858
1961
|
return new ZodBranded({
|
|
1859
1962
|
typeName: ZodFirstPartyTypeKind.ZodBranded,
|
|
1860
1963
|
type: this,
|
|
1861
|
-
...processCreateParams(
|
|
1964
|
+
...processCreateParams(this._def)
|
|
1862
1965
|
});
|
|
1863
1966
|
}
|
|
1864
1967
|
catch(def) {
|
|
1865
|
-
const
|
|
1968
|
+
const catchValueFunc = typeof def === "function" ? def : () => def;
|
|
1866
1969
|
return new ZodCatch({
|
|
1970
|
+
...processCreateParams(this._def),
|
|
1867
1971
|
innerType: this,
|
|
1868
|
-
|
|
1972
|
+
catchValue: catchValueFunc,
|
|
1869
1973
|
typeName: ZodFirstPartyTypeKind.ZodCatch
|
|
1870
1974
|
});
|
|
1871
1975
|
}
|
|
@@ -1879,6 +1983,9 @@ var init_lib = __esm({
|
|
|
1879
1983
|
pipe(target) {
|
|
1880
1984
|
return ZodPipeline.create(this, target);
|
|
1881
1985
|
}
|
|
1986
|
+
readonly() {
|
|
1987
|
+
return ZodReadonly.create(this);
|
|
1988
|
+
}
|
|
1882
1989
|
isOptional() {
|
|
1883
1990
|
return this.safeParse(void 0).success;
|
|
1884
1991
|
}
|
|
@@ -1887,43 +1994,19 @@ var init_lib = __esm({
|
|
|
1887
1994
|
}
|
|
1888
1995
|
};
|
|
1889
1996
|
cuidRegex = /^c[^\s-]{8,}$/i;
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
} else {
|
|
1903
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
|
1904
|
-
}
|
|
1905
|
-
} else {
|
|
1906
|
-
if (args.offset) {
|
|
1907
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
1908
|
-
} else {
|
|
1909
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
|
-
};
|
|
1997
|
+
cuid2Regex = /^[0-9a-z]+$/;
|
|
1998
|
+
ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
1999
|
+
uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
|
2000
|
+
nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
2001
|
+
durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
2002
|
+
emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
2003
|
+
_emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
2004
|
+
ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
2005
|
+
ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
|
|
2006
|
+
base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
2007
|
+
dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
2008
|
+
dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
1913
2009
|
ZodString = class _ZodString extends ZodType {
|
|
1914
|
-
constructor() {
|
|
1915
|
-
super(...arguments);
|
|
1916
|
-
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
|
|
1917
|
-
validation,
|
|
1918
|
-
code: ZodIssueCode.invalid_string,
|
|
1919
|
-
...errorUtil.errToObj(message)
|
|
1920
|
-
});
|
|
1921
|
-
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
|
|
1922
|
-
this.trim = () => new _ZodString({
|
|
1923
|
-
...this._def,
|
|
1924
|
-
checks: [...this._def.checks, { kind: "trim" }]
|
|
1925
|
-
});
|
|
1926
|
-
}
|
|
1927
2010
|
_parse(input) {
|
|
1928
2011
|
if (this._def.coerce) {
|
|
1929
2012
|
input.data = String(input.data);
|
|
@@ -1931,15 +2014,11 @@ var init_lib = __esm({
|
|
|
1931
2014
|
const parsedType = this._getType(input);
|
|
1932
2015
|
if (parsedType !== ZodParsedType.string) {
|
|
1933
2016
|
const ctx2 = this._getOrReturnCtx(input);
|
|
1934
|
-
addIssueToContext(
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
received: ctx2.parsedType
|
|
1940
|
-
}
|
|
1941
|
-
//
|
|
1942
|
-
);
|
|
2017
|
+
addIssueToContext(ctx2, {
|
|
2018
|
+
code: ZodIssueCode.invalid_type,
|
|
2019
|
+
expected: ZodParsedType.string,
|
|
2020
|
+
received: ctx2.parsedType
|
|
2021
|
+
});
|
|
1943
2022
|
return INVALID;
|
|
1944
2023
|
}
|
|
1945
2024
|
const status = new ParseStatus();
|
|
@@ -2007,6 +2086,19 @@ var init_lib = __esm({
|
|
|
2007
2086
|
});
|
|
2008
2087
|
status.dirty();
|
|
2009
2088
|
}
|
|
2089
|
+
} else if (check.kind === "emoji") {
|
|
2090
|
+
if (!emojiRegex) {
|
|
2091
|
+
emojiRegex = new RegExp(_emojiRegex, "u");
|
|
2092
|
+
}
|
|
2093
|
+
if (!emojiRegex.test(input.data)) {
|
|
2094
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2095
|
+
addIssueToContext(ctx, {
|
|
2096
|
+
validation: "emoji",
|
|
2097
|
+
code: ZodIssueCode.invalid_string,
|
|
2098
|
+
message: check.message
|
|
2099
|
+
});
|
|
2100
|
+
status.dirty();
|
|
2101
|
+
}
|
|
2010
2102
|
} else if (check.kind === "uuid") {
|
|
2011
2103
|
if (!uuidRegex.test(input.data)) {
|
|
2012
2104
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2017,6 +2109,16 @@ var init_lib = __esm({
|
|
|
2017
2109
|
});
|
|
2018
2110
|
status.dirty();
|
|
2019
2111
|
}
|
|
2112
|
+
} else if (check.kind === "nanoid") {
|
|
2113
|
+
if (!nanoidRegex.test(input.data)) {
|
|
2114
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2115
|
+
addIssueToContext(ctx, {
|
|
2116
|
+
validation: "nanoid",
|
|
2117
|
+
code: ZodIssueCode.invalid_string,
|
|
2118
|
+
message: check.message
|
|
2119
|
+
});
|
|
2120
|
+
status.dirty();
|
|
2121
|
+
}
|
|
2020
2122
|
} else if (check.kind === "cuid") {
|
|
2021
2123
|
if (!cuidRegex.test(input.data)) {
|
|
2022
2124
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2027,6 +2129,26 @@ var init_lib = __esm({
|
|
|
2027
2129
|
});
|
|
2028
2130
|
status.dirty();
|
|
2029
2131
|
}
|
|
2132
|
+
} else if (check.kind === "cuid2") {
|
|
2133
|
+
if (!cuid2Regex.test(input.data)) {
|
|
2134
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2135
|
+
addIssueToContext(ctx, {
|
|
2136
|
+
validation: "cuid2",
|
|
2137
|
+
code: ZodIssueCode.invalid_string,
|
|
2138
|
+
message: check.message
|
|
2139
|
+
});
|
|
2140
|
+
status.dirty();
|
|
2141
|
+
}
|
|
2142
|
+
} else if (check.kind === "ulid") {
|
|
2143
|
+
if (!ulidRegex.test(input.data)) {
|
|
2144
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2145
|
+
addIssueToContext(ctx, {
|
|
2146
|
+
validation: "ulid",
|
|
2147
|
+
code: ZodIssueCode.invalid_string,
|
|
2148
|
+
message: check.message
|
|
2149
|
+
});
|
|
2150
|
+
status.dirty();
|
|
2151
|
+
}
|
|
2030
2152
|
} else if (check.kind === "url") {
|
|
2031
2153
|
try {
|
|
2032
2154
|
new URL(input.data);
|
|
@@ -2053,6 +2175,20 @@ var init_lib = __esm({
|
|
|
2053
2175
|
}
|
|
2054
2176
|
} else if (check.kind === "trim") {
|
|
2055
2177
|
input.data = input.data.trim();
|
|
2178
|
+
} else if (check.kind === "includes") {
|
|
2179
|
+
if (!input.data.includes(check.value, check.position)) {
|
|
2180
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2181
|
+
addIssueToContext(ctx, {
|
|
2182
|
+
code: ZodIssueCode.invalid_string,
|
|
2183
|
+
validation: { includes: check.value, position: check.position },
|
|
2184
|
+
message: check.message
|
|
2185
|
+
});
|
|
2186
|
+
status.dirty();
|
|
2187
|
+
}
|
|
2188
|
+
} else if (check.kind === "toLowerCase") {
|
|
2189
|
+
input.data = input.data.toLowerCase();
|
|
2190
|
+
} else if (check.kind === "toUpperCase") {
|
|
2191
|
+
input.data = input.data.toUpperCase();
|
|
2056
2192
|
} else if (check.kind === "startsWith") {
|
|
2057
2193
|
if (!input.data.startsWith(check.value)) {
|
|
2058
2194
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2084,12 +2220,71 @@ var init_lib = __esm({
|
|
|
2084
2220
|
});
|
|
2085
2221
|
status.dirty();
|
|
2086
2222
|
}
|
|
2223
|
+
} else if (check.kind === "date") {
|
|
2224
|
+
const regex = dateRegex;
|
|
2225
|
+
if (!regex.test(input.data)) {
|
|
2226
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2227
|
+
addIssueToContext(ctx, {
|
|
2228
|
+
code: ZodIssueCode.invalid_string,
|
|
2229
|
+
validation: "date",
|
|
2230
|
+
message: check.message
|
|
2231
|
+
});
|
|
2232
|
+
status.dirty();
|
|
2233
|
+
}
|
|
2234
|
+
} else if (check.kind === "time") {
|
|
2235
|
+
const regex = timeRegex(check);
|
|
2236
|
+
if (!regex.test(input.data)) {
|
|
2237
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2238
|
+
addIssueToContext(ctx, {
|
|
2239
|
+
code: ZodIssueCode.invalid_string,
|
|
2240
|
+
validation: "time",
|
|
2241
|
+
message: check.message
|
|
2242
|
+
});
|
|
2243
|
+
status.dirty();
|
|
2244
|
+
}
|
|
2245
|
+
} else if (check.kind === "duration") {
|
|
2246
|
+
if (!durationRegex.test(input.data)) {
|
|
2247
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2248
|
+
addIssueToContext(ctx, {
|
|
2249
|
+
validation: "duration",
|
|
2250
|
+
code: ZodIssueCode.invalid_string,
|
|
2251
|
+
message: check.message
|
|
2252
|
+
});
|
|
2253
|
+
status.dirty();
|
|
2254
|
+
}
|
|
2255
|
+
} else if (check.kind === "ip") {
|
|
2256
|
+
if (!isValidIP(input.data, check.version)) {
|
|
2257
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2258
|
+
addIssueToContext(ctx, {
|
|
2259
|
+
validation: "ip",
|
|
2260
|
+
code: ZodIssueCode.invalid_string,
|
|
2261
|
+
message: check.message
|
|
2262
|
+
});
|
|
2263
|
+
status.dirty();
|
|
2264
|
+
}
|
|
2265
|
+
} else if (check.kind === "base64") {
|
|
2266
|
+
if (!base64Regex.test(input.data)) {
|
|
2267
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2268
|
+
addIssueToContext(ctx, {
|
|
2269
|
+
validation: "base64",
|
|
2270
|
+
code: ZodIssueCode.invalid_string,
|
|
2271
|
+
message: check.message
|
|
2272
|
+
});
|
|
2273
|
+
status.dirty();
|
|
2274
|
+
}
|
|
2087
2275
|
} else {
|
|
2088
2276
|
util.assertNever(check);
|
|
2089
2277
|
}
|
|
2090
2278
|
}
|
|
2091
2279
|
return { status: status.value, value: input.data };
|
|
2092
2280
|
}
|
|
2281
|
+
_regex(regex, validation, message) {
|
|
2282
|
+
return this.refinement((data) => regex.test(data), {
|
|
2283
|
+
validation,
|
|
2284
|
+
code: ZodIssueCode.invalid_string,
|
|
2285
|
+
...errorUtil.errToObj(message)
|
|
2286
|
+
});
|
|
2287
|
+
}
|
|
2093
2288
|
_addCheck(check) {
|
|
2094
2289
|
return new _ZodString({
|
|
2095
2290
|
...this._def,
|
|
@@ -2102,19 +2297,38 @@ var init_lib = __esm({
|
|
|
2102
2297
|
url(message) {
|
|
2103
2298
|
return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
|
|
2104
2299
|
}
|
|
2300
|
+
emoji(message) {
|
|
2301
|
+
return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
|
|
2302
|
+
}
|
|
2105
2303
|
uuid(message) {
|
|
2106
2304
|
return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
|
|
2107
2305
|
}
|
|
2306
|
+
nanoid(message) {
|
|
2307
|
+
return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
|
|
2308
|
+
}
|
|
2108
2309
|
cuid(message) {
|
|
2109
2310
|
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
|
2110
2311
|
}
|
|
2312
|
+
cuid2(message) {
|
|
2313
|
+
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
|
|
2314
|
+
}
|
|
2315
|
+
ulid(message) {
|
|
2316
|
+
return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
|
|
2317
|
+
}
|
|
2318
|
+
base64(message) {
|
|
2319
|
+
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
|
2320
|
+
}
|
|
2321
|
+
ip(options) {
|
|
2322
|
+
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
|
2323
|
+
}
|
|
2111
2324
|
datetime(options) {
|
|
2112
|
-
var _a;
|
|
2325
|
+
var _a, _b;
|
|
2113
2326
|
if (typeof options === "string") {
|
|
2114
2327
|
return this._addCheck({
|
|
2115
2328
|
kind: "datetime",
|
|
2116
2329
|
precision: null,
|
|
2117
2330
|
offset: false,
|
|
2331
|
+
local: false,
|
|
2118
2332
|
message: options
|
|
2119
2333
|
});
|
|
2120
2334
|
}
|
|
@@ -2122,9 +2336,30 @@ var init_lib = __esm({
|
|
|
2122
2336
|
kind: "datetime",
|
|
2123
2337
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
2124
2338
|
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
|
2339
|
+
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
|
|
2125
2340
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
2126
2341
|
});
|
|
2127
2342
|
}
|
|
2343
|
+
date(message) {
|
|
2344
|
+
return this._addCheck({ kind: "date", message });
|
|
2345
|
+
}
|
|
2346
|
+
time(options) {
|
|
2347
|
+
if (typeof options === "string") {
|
|
2348
|
+
return this._addCheck({
|
|
2349
|
+
kind: "time",
|
|
2350
|
+
precision: null,
|
|
2351
|
+
message: options
|
|
2352
|
+
});
|
|
2353
|
+
}
|
|
2354
|
+
return this._addCheck({
|
|
2355
|
+
kind: "time",
|
|
2356
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
2357
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
2358
|
+
});
|
|
2359
|
+
}
|
|
2360
|
+
duration(message) {
|
|
2361
|
+
return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
|
|
2362
|
+
}
|
|
2128
2363
|
regex(regex, message) {
|
|
2129
2364
|
return this._addCheck({
|
|
2130
2365
|
kind: "regex",
|
|
@@ -2132,6 +2367,14 @@ var init_lib = __esm({
|
|
|
2132
2367
|
...errorUtil.errToObj(message)
|
|
2133
2368
|
});
|
|
2134
2369
|
}
|
|
2370
|
+
includes(value, options) {
|
|
2371
|
+
return this._addCheck({
|
|
2372
|
+
kind: "includes",
|
|
2373
|
+
value,
|
|
2374
|
+
position: options === null || options === void 0 ? void 0 : options.position,
|
|
2375
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
2376
|
+
});
|
|
2377
|
+
}
|
|
2135
2378
|
startsWith(value, message) {
|
|
2136
2379
|
return this._addCheck({
|
|
2137
2380
|
kind: "startsWith",
|
|
@@ -2167,21 +2410,73 @@ var init_lib = __esm({
|
|
|
2167
2410
|
...errorUtil.errToObj(message)
|
|
2168
2411
|
});
|
|
2169
2412
|
}
|
|
2413
|
+
/**
|
|
2414
|
+
* @deprecated Use z.string().min(1) instead.
|
|
2415
|
+
* @see {@link ZodString.min}
|
|
2416
|
+
*/
|
|
2417
|
+
nonempty(message) {
|
|
2418
|
+
return this.min(1, errorUtil.errToObj(message));
|
|
2419
|
+
}
|
|
2420
|
+
trim() {
|
|
2421
|
+
return new _ZodString({
|
|
2422
|
+
...this._def,
|
|
2423
|
+
checks: [...this._def.checks, { kind: "trim" }]
|
|
2424
|
+
});
|
|
2425
|
+
}
|
|
2426
|
+
toLowerCase() {
|
|
2427
|
+
return new _ZodString({
|
|
2428
|
+
...this._def,
|
|
2429
|
+
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
2430
|
+
});
|
|
2431
|
+
}
|
|
2432
|
+
toUpperCase() {
|
|
2433
|
+
return new _ZodString({
|
|
2434
|
+
...this._def,
|
|
2435
|
+
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
2436
|
+
});
|
|
2437
|
+
}
|
|
2170
2438
|
get isDatetime() {
|
|
2171
2439
|
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
|
2172
2440
|
}
|
|
2441
|
+
get isDate() {
|
|
2442
|
+
return !!this._def.checks.find((ch) => ch.kind === "date");
|
|
2443
|
+
}
|
|
2444
|
+
get isTime() {
|
|
2445
|
+
return !!this._def.checks.find((ch) => ch.kind === "time");
|
|
2446
|
+
}
|
|
2447
|
+
get isDuration() {
|
|
2448
|
+
return !!this._def.checks.find((ch) => ch.kind === "duration");
|
|
2449
|
+
}
|
|
2173
2450
|
get isEmail() {
|
|
2174
2451
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
|
2175
2452
|
}
|
|
2176
2453
|
get isURL() {
|
|
2177
2454
|
return !!this._def.checks.find((ch) => ch.kind === "url");
|
|
2178
2455
|
}
|
|
2456
|
+
get isEmoji() {
|
|
2457
|
+
return !!this._def.checks.find((ch) => ch.kind === "emoji");
|
|
2458
|
+
}
|
|
2179
2459
|
get isUUID() {
|
|
2180
2460
|
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
|
2181
2461
|
}
|
|
2462
|
+
get isNANOID() {
|
|
2463
|
+
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
|
|
2464
|
+
}
|
|
2182
2465
|
get isCUID() {
|
|
2183
2466
|
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
|
2184
2467
|
}
|
|
2468
|
+
get isCUID2() {
|
|
2469
|
+
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
|
|
2470
|
+
}
|
|
2471
|
+
get isULID() {
|
|
2472
|
+
return !!this._def.checks.find((ch) => ch.kind === "ulid");
|
|
2473
|
+
}
|
|
2474
|
+
get isIP() {
|
|
2475
|
+
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
2476
|
+
}
|
|
2477
|
+
get isBase64() {
|
|
2478
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
2479
|
+
}
|
|
2185
2480
|
get minLength() {
|
|
2186
2481
|
let min = null;
|
|
2187
2482
|
for (const ch of this._def.checks) {
|
|
@@ -2212,23 +2507,253 @@ var init_lib = __esm({
|
|
|
2212
2507
|
...processCreateParams(params)
|
|
2213
2508
|
});
|
|
2214
2509
|
};
|
|
2215
|
-
ZodNumber = class _ZodNumber extends ZodType {
|
|
2510
|
+
ZodNumber = class _ZodNumber extends ZodType {
|
|
2511
|
+
constructor() {
|
|
2512
|
+
super(...arguments);
|
|
2513
|
+
this.min = this.gte;
|
|
2514
|
+
this.max = this.lte;
|
|
2515
|
+
this.step = this.multipleOf;
|
|
2516
|
+
}
|
|
2517
|
+
_parse(input) {
|
|
2518
|
+
if (this._def.coerce) {
|
|
2519
|
+
input.data = Number(input.data);
|
|
2520
|
+
}
|
|
2521
|
+
const parsedType = this._getType(input);
|
|
2522
|
+
if (parsedType !== ZodParsedType.number) {
|
|
2523
|
+
const ctx2 = this._getOrReturnCtx(input);
|
|
2524
|
+
addIssueToContext(ctx2, {
|
|
2525
|
+
code: ZodIssueCode.invalid_type,
|
|
2526
|
+
expected: ZodParsedType.number,
|
|
2527
|
+
received: ctx2.parsedType
|
|
2528
|
+
});
|
|
2529
|
+
return INVALID;
|
|
2530
|
+
}
|
|
2531
|
+
let ctx = void 0;
|
|
2532
|
+
const status = new ParseStatus();
|
|
2533
|
+
for (const check of this._def.checks) {
|
|
2534
|
+
if (check.kind === "int") {
|
|
2535
|
+
if (!util.isInteger(input.data)) {
|
|
2536
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2537
|
+
addIssueToContext(ctx, {
|
|
2538
|
+
code: ZodIssueCode.invalid_type,
|
|
2539
|
+
expected: "integer",
|
|
2540
|
+
received: "float",
|
|
2541
|
+
message: check.message
|
|
2542
|
+
});
|
|
2543
|
+
status.dirty();
|
|
2544
|
+
}
|
|
2545
|
+
} else if (check.kind === "min") {
|
|
2546
|
+
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
|
2547
|
+
if (tooSmall) {
|
|
2548
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2549
|
+
addIssueToContext(ctx, {
|
|
2550
|
+
code: ZodIssueCode.too_small,
|
|
2551
|
+
minimum: check.value,
|
|
2552
|
+
type: "number",
|
|
2553
|
+
inclusive: check.inclusive,
|
|
2554
|
+
exact: false,
|
|
2555
|
+
message: check.message
|
|
2556
|
+
});
|
|
2557
|
+
status.dirty();
|
|
2558
|
+
}
|
|
2559
|
+
} else if (check.kind === "max") {
|
|
2560
|
+
const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
|
|
2561
|
+
if (tooBig) {
|
|
2562
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2563
|
+
addIssueToContext(ctx, {
|
|
2564
|
+
code: ZodIssueCode.too_big,
|
|
2565
|
+
maximum: check.value,
|
|
2566
|
+
type: "number",
|
|
2567
|
+
inclusive: check.inclusive,
|
|
2568
|
+
exact: false,
|
|
2569
|
+
message: check.message
|
|
2570
|
+
});
|
|
2571
|
+
status.dirty();
|
|
2572
|
+
}
|
|
2573
|
+
} else if (check.kind === "multipleOf") {
|
|
2574
|
+
if (floatSafeRemainder(input.data, check.value) !== 0) {
|
|
2575
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2576
|
+
addIssueToContext(ctx, {
|
|
2577
|
+
code: ZodIssueCode.not_multiple_of,
|
|
2578
|
+
multipleOf: check.value,
|
|
2579
|
+
message: check.message
|
|
2580
|
+
});
|
|
2581
|
+
status.dirty();
|
|
2582
|
+
}
|
|
2583
|
+
} else if (check.kind === "finite") {
|
|
2584
|
+
if (!Number.isFinite(input.data)) {
|
|
2585
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2586
|
+
addIssueToContext(ctx, {
|
|
2587
|
+
code: ZodIssueCode.not_finite,
|
|
2588
|
+
message: check.message
|
|
2589
|
+
});
|
|
2590
|
+
status.dirty();
|
|
2591
|
+
}
|
|
2592
|
+
} else {
|
|
2593
|
+
util.assertNever(check);
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
return { status: status.value, value: input.data };
|
|
2597
|
+
}
|
|
2598
|
+
gte(value, message) {
|
|
2599
|
+
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
2600
|
+
}
|
|
2601
|
+
gt(value, message) {
|
|
2602
|
+
return this.setLimit("min", value, false, errorUtil.toString(message));
|
|
2603
|
+
}
|
|
2604
|
+
lte(value, message) {
|
|
2605
|
+
return this.setLimit("max", value, true, errorUtil.toString(message));
|
|
2606
|
+
}
|
|
2607
|
+
lt(value, message) {
|
|
2608
|
+
return this.setLimit("max", value, false, errorUtil.toString(message));
|
|
2609
|
+
}
|
|
2610
|
+
setLimit(kind, value, inclusive, message) {
|
|
2611
|
+
return new _ZodNumber({
|
|
2612
|
+
...this._def,
|
|
2613
|
+
checks: [
|
|
2614
|
+
...this._def.checks,
|
|
2615
|
+
{
|
|
2616
|
+
kind,
|
|
2617
|
+
value,
|
|
2618
|
+
inclusive,
|
|
2619
|
+
message: errorUtil.toString(message)
|
|
2620
|
+
}
|
|
2621
|
+
]
|
|
2622
|
+
});
|
|
2623
|
+
}
|
|
2624
|
+
_addCheck(check) {
|
|
2625
|
+
return new _ZodNumber({
|
|
2626
|
+
...this._def,
|
|
2627
|
+
checks: [...this._def.checks, check]
|
|
2628
|
+
});
|
|
2629
|
+
}
|
|
2630
|
+
int(message) {
|
|
2631
|
+
return this._addCheck({
|
|
2632
|
+
kind: "int",
|
|
2633
|
+
message: errorUtil.toString(message)
|
|
2634
|
+
});
|
|
2635
|
+
}
|
|
2636
|
+
positive(message) {
|
|
2637
|
+
return this._addCheck({
|
|
2638
|
+
kind: "min",
|
|
2639
|
+
value: 0,
|
|
2640
|
+
inclusive: false,
|
|
2641
|
+
message: errorUtil.toString(message)
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
negative(message) {
|
|
2645
|
+
return this._addCheck({
|
|
2646
|
+
kind: "max",
|
|
2647
|
+
value: 0,
|
|
2648
|
+
inclusive: false,
|
|
2649
|
+
message: errorUtil.toString(message)
|
|
2650
|
+
});
|
|
2651
|
+
}
|
|
2652
|
+
nonpositive(message) {
|
|
2653
|
+
return this._addCheck({
|
|
2654
|
+
kind: "max",
|
|
2655
|
+
value: 0,
|
|
2656
|
+
inclusive: true,
|
|
2657
|
+
message: errorUtil.toString(message)
|
|
2658
|
+
});
|
|
2659
|
+
}
|
|
2660
|
+
nonnegative(message) {
|
|
2661
|
+
return this._addCheck({
|
|
2662
|
+
kind: "min",
|
|
2663
|
+
value: 0,
|
|
2664
|
+
inclusive: true,
|
|
2665
|
+
message: errorUtil.toString(message)
|
|
2666
|
+
});
|
|
2667
|
+
}
|
|
2668
|
+
multipleOf(value, message) {
|
|
2669
|
+
return this._addCheck({
|
|
2670
|
+
kind: "multipleOf",
|
|
2671
|
+
value,
|
|
2672
|
+
message: errorUtil.toString(message)
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
finite(message) {
|
|
2676
|
+
return this._addCheck({
|
|
2677
|
+
kind: "finite",
|
|
2678
|
+
message: errorUtil.toString(message)
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
safe(message) {
|
|
2682
|
+
return this._addCheck({
|
|
2683
|
+
kind: "min",
|
|
2684
|
+
inclusive: true,
|
|
2685
|
+
value: Number.MIN_SAFE_INTEGER,
|
|
2686
|
+
message: errorUtil.toString(message)
|
|
2687
|
+
})._addCheck({
|
|
2688
|
+
kind: "max",
|
|
2689
|
+
inclusive: true,
|
|
2690
|
+
value: Number.MAX_SAFE_INTEGER,
|
|
2691
|
+
message: errorUtil.toString(message)
|
|
2692
|
+
});
|
|
2693
|
+
}
|
|
2694
|
+
get minValue() {
|
|
2695
|
+
let min = null;
|
|
2696
|
+
for (const ch of this._def.checks) {
|
|
2697
|
+
if (ch.kind === "min") {
|
|
2698
|
+
if (min === null || ch.value > min)
|
|
2699
|
+
min = ch.value;
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
return min;
|
|
2703
|
+
}
|
|
2704
|
+
get maxValue() {
|
|
2705
|
+
let max = null;
|
|
2706
|
+
for (const ch of this._def.checks) {
|
|
2707
|
+
if (ch.kind === "max") {
|
|
2708
|
+
if (max === null || ch.value < max)
|
|
2709
|
+
max = ch.value;
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
return max;
|
|
2713
|
+
}
|
|
2714
|
+
get isInt() {
|
|
2715
|
+
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
2716
|
+
}
|
|
2717
|
+
get isFinite() {
|
|
2718
|
+
let max = null, min = null;
|
|
2719
|
+
for (const ch of this._def.checks) {
|
|
2720
|
+
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
2721
|
+
return true;
|
|
2722
|
+
} else if (ch.kind === "min") {
|
|
2723
|
+
if (min === null || ch.value > min)
|
|
2724
|
+
min = ch.value;
|
|
2725
|
+
} else if (ch.kind === "max") {
|
|
2726
|
+
if (max === null || ch.value < max)
|
|
2727
|
+
max = ch.value;
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
return Number.isFinite(min) && Number.isFinite(max);
|
|
2731
|
+
}
|
|
2732
|
+
};
|
|
2733
|
+
ZodNumber.create = (params) => {
|
|
2734
|
+
return new ZodNumber({
|
|
2735
|
+
checks: [],
|
|
2736
|
+
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
2737
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
2738
|
+
...processCreateParams(params)
|
|
2739
|
+
});
|
|
2740
|
+
};
|
|
2741
|
+
ZodBigInt = class _ZodBigInt extends ZodType {
|
|
2216
2742
|
constructor() {
|
|
2217
2743
|
super(...arguments);
|
|
2218
2744
|
this.min = this.gte;
|
|
2219
2745
|
this.max = this.lte;
|
|
2220
|
-
this.step = this.multipleOf;
|
|
2221
2746
|
}
|
|
2222
2747
|
_parse(input) {
|
|
2223
2748
|
if (this._def.coerce) {
|
|
2224
|
-
input.data =
|
|
2749
|
+
input.data = BigInt(input.data);
|
|
2225
2750
|
}
|
|
2226
2751
|
const parsedType = this._getType(input);
|
|
2227
|
-
if (parsedType !== ZodParsedType.
|
|
2752
|
+
if (parsedType !== ZodParsedType.bigint) {
|
|
2228
2753
|
const ctx2 = this._getOrReturnCtx(input);
|
|
2229
2754
|
addIssueToContext(ctx2, {
|
|
2230
2755
|
code: ZodIssueCode.invalid_type,
|
|
2231
|
-
expected: ZodParsedType.
|
|
2756
|
+
expected: ZodParsedType.bigint,
|
|
2232
2757
|
received: ctx2.parsedType
|
|
2233
2758
|
});
|
|
2234
2759
|
return INVALID;
|
|
@@ -2236,27 +2761,15 @@ var init_lib = __esm({
|
|
|
2236
2761
|
let ctx = void 0;
|
|
2237
2762
|
const status = new ParseStatus();
|
|
2238
2763
|
for (const check of this._def.checks) {
|
|
2239
|
-
if (check.kind === "
|
|
2240
|
-
if (!util.isInteger(input.data)) {
|
|
2241
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
|
2242
|
-
addIssueToContext(ctx, {
|
|
2243
|
-
code: ZodIssueCode.invalid_type,
|
|
2244
|
-
expected: "integer",
|
|
2245
|
-
received: "float",
|
|
2246
|
-
message: check.message
|
|
2247
|
-
});
|
|
2248
|
-
status.dirty();
|
|
2249
|
-
}
|
|
2250
|
-
} else if (check.kind === "min") {
|
|
2764
|
+
if (check.kind === "min") {
|
|
2251
2765
|
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
|
2252
2766
|
if (tooSmall) {
|
|
2253
2767
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2254
2768
|
addIssueToContext(ctx, {
|
|
2255
2769
|
code: ZodIssueCode.too_small,
|
|
2770
|
+
type: "bigint",
|
|
2256
2771
|
minimum: check.value,
|
|
2257
|
-
type: "number",
|
|
2258
2772
|
inclusive: check.inclusive,
|
|
2259
|
-
exact: false,
|
|
2260
2773
|
message: check.message
|
|
2261
2774
|
});
|
|
2262
2775
|
status.dirty();
|
|
@@ -2267,16 +2780,15 @@ var init_lib = __esm({
|
|
|
2267
2780
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2268
2781
|
addIssueToContext(ctx, {
|
|
2269
2782
|
code: ZodIssueCode.too_big,
|
|
2783
|
+
type: "bigint",
|
|
2270
2784
|
maximum: check.value,
|
|
2271
|
-
type: "number",
|
|
2272
2785
|
inclusive: check.inclusive,
|
|
2273
|
-
exact: false,
|
|
2274
2786
|
message: check.message
|
|
2275
2787
|
});
|
|
2276
2788
|
status.dirty();
|
|
2277
2789
|
}
|
|
2278
2790
|
} else if (check.kind === "multipleOf") {
|
|
2279
|
-
if (
|
|
2791
|
+
if (input.data % check.value !== BigInt(0)) {
|
|
2280
2792
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2281
2793
|
addIssueToContext(ctx, {
|
|
2282
2794
|
code: ZodIssueCode.not_multiple_of,
|
|
@@ -2285,15 +2797,6 @@ var init_lib = __esm({
|
|
|
2285
2797
|
});
|
|
2286
2798
|
status.dirty();
|
|
2287
2799
|
}
|
|
2288
|
-
} else if (check.kind === "finite") {
|
|
2289
|
-
if (!Number.isFinite(input.data)) {
|
|
2290
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
|
2291
|
-
addIssueToContext(ctx, {
|
|
2292
|
-
code: ZodIssueCode.not_finite,
|
|
2293
|
-
message: check.message
|
|
2294
|
-
});
|
|
2295
|
-
status.dirty();
|
|
2296
|
-
}
|
|
2297
2800
|
} else {
|
|
2298
2801
|
util.assertNever(check);
|
|
2299
2802
|
}
|
|
@@ -2313,7 +2816,7 @@ var init_lib = __esm({
|
|
|
2313
2816
|
return this.setLimit("max", value, false, errorUtil.toString(message));
|
|
2314
2817
|
}
|
|
2315
2818
|
setLimit(kind, value, inclusive, message) {
|
|
2316
|
-
return new
|
|
2819
|
+
return new _ZodBigInt({
|
|
2317
2820
|
...this._def,
|
|
2318
2821
|
checks: [
|
|
2319
2822
|
...this._def.checks,
|
|
@@ -2327,21 +2830,15 @@ var init_lib = __esm({
|
|
|
2327
2830
|
});
|
|
2328
2831
|
}
|
|
2329
2832
|
_addCheck(check) {
|
|
2330
|
-
return new
|
|
2833
|
+
return new _ZodBigInt({
|
|
2331
2834
|
...this._def,
|
|
2332
2835
|
checks: [...this._def.checks, check]
|
|
2333
2836
|
});
|
|
2334
2837
|
}
|
|
2335
|
-
int(message) {
|
|
2336
|
-
return this._addCheck({
|
|
2337
|
-
kind: "int",
|
|
2338
|
-
message: errorUtil.toString(message)
|
|
2339
|
-
});
|
|
2340
|
-
}
|
|
2341
2838
|
positive(message) {
|
|
2342
2839
|
return this._addCheck({
|
|
2343
2840
|
kind: "min",
|
|
2344
|
-
value: 0,
|
|
2841
|
+
value: BigInt(0),
|
|
2345
2842
|
inclusive: false,
|
|
2346
2843
|
message: errorUtil.toString(message)
|
|
2347
2844
|
});
|
|
@@ -2349,7 +2846,7 @@ var init_lib = __esm({
|
|
|
2349
2846
|
negative(message) {
|
|
2350
2847
|
return this._addCheck({
|
|
2351
2848
|
kind: "max",
|
|
2352
|
-
value: 0,
|
|
2849
|
+
value: BigInt(0),
|
|
2353
2850
|
inclusive: false,
|
|
2354
2851
|
message: errorUtil.toString(message)
|
|
2355
2852
|
});
|
|
@@ -2357,7 +2854,7 @@ var init_lib = __esm({
|
|
|
2357
2854
|
nonpositive(message) {
|
|
2358
2855
|
return this._addCheck({
|
|
2359
2856
|
kind: "max",
|
|
2360
|
-
value: 0,
|
|
2857
|
+
value: BigInt(0),
|
|
2361
2858
|
inclusive: true,
|
|
2362
2859
|
message: errorUtil.toString(message)
|
|
2363
2860
|
});
|
|
@@ -2365,7 +2862,7 @@ var init_lib = __esm({
|
|
|
2365
2862
|
nonnegative(message) {
|
|
2366
2863
|
return this._addCheck({
|
|
2367
2864
|
kind: "min",
|
|
2368
|
-
value: 0,
|
|
2865
|
+
value: BigInt(0),
|
|
2369
2866
|
inclusive: true,
|
|
2370
2867
|
message: errorUtil.toString(message)
|
|
2371
2868
|
});
|
|
@@ -2377,12 +2874,6 @@ var init_lib = __esm({
|
|
|
2377
2874
|
message: errorUtil.toString(message)
|
|
2378
2875
|
});
|
|
2379
2876
|
}
|
|
2380
|
-
finite(message) {
|
|
2381
|
-
return this._addCheck({
|
|
2382
|
-
kind: "finite",
|
|
2383
|
-
message: errorUtil.toString(message)
|
|
2384
|
-
});
|
|
2385
|
-
}
|
|
2386
2877
|
get minValue() {
|
|
2387
2878
|
let min = null;
|
|
2388
2879
|
for (const ch of this._def.checks) {
|
|
@@ -2403,39 +2894,11 @@ var init_lib = __esm({
|
|
|
2403
2894
|
}
|
|
2404
2895
|
return max;
|
|
2405
2896
|
}
|
|
2406
|
-
get isInt() {
|
|
2407
|
-
return !!this._def.checks.find((ch) => ch.kind === "int");
|
|
2408
|
-
}
|
|
2409
|
-
};
|
|
2410
|
-
ZodNumber.create = (params) => {
|
|
2411
|
-
return new ZodNumber({
|
|
2412
|
-
checks: [],
|
|
2413
|
-
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
2414
|
-
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
2415
|
-
...processCreateParams(params)
|
|
2416
|
-
});
|
|
2417
|
-
};
|
|
2418
|
-
ZodBigInt = class extends ZodType {
|
|
2419
|
-
_parse(input) {
|
|
2420
|
-
if (this._def.coerce) {
|
|
2421
|
-
input.data = BigInt(input.data);
|
|
2422
|
-
}
|
|
2423
|
-
const parsedType = this._getType(input);
|
|
2424
|
-
if (parsedType !== ZodParsedType.bigint) {
|
|
2425
|
-
const ctx = this._getOrReturnCtx(input);
|
|
2426
|
-
addIssueToContext(ctx, {
|
|
2427
|
-
code: ZodIssueCode.invalid_type,
|
|
2428
|
-
expected: ZodParsedType.bigint,
|
|
2429
|
-
received: ctx.parsedType
|
|
2430
|
-
});
|
|
2431
|
-
return INVALID;
|
|
2432
|
-
}
|
|
2433
|
-
return OK(input.data);
|
|
2434
|
-
}
|
|
2435
2897
|
};
|
|
2436
2898
|
ZodBigInt.create = (params) => {
|
|
2437
2899
|
var _a;
|
|
2438
2900
|
return new ZodBigInt({
|
|
2901
|
+
checks: [],
|
|
2439
2902
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
2440
2903
|
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
2441
2904
|
...processCreateParams(params)
|
|
@@ -2761,13 +3224,13 @@ var init_lib = __esm({
|
|
|
2761
3224
|
}
|
|
2762
3225
|
}
|
|
2763
3226
|
if (ctx.common.async) {
|
|
2764
|
-
return Promise.all(ctx.data.map((item, i) => {
|
|
3227
|
+
return Promise.all([...ctx.data].map((item, i) => {
|
|
2765
3228
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
|
2766
3229
|
})).then((result2) => {
|
|
2767
3230
|
return ParseStatus.mergeArray(status, result2);
|
|
2768
3231
|
});
|
|
2769
3232
|
}
|
|
2770
|
-
const result = ctx.data.map((item, i) => {
|
|
3233
|
+
const result = [...ctx.data].map((item, i) => {
|
|
2771
3234
|
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
|
2772
3235
|
});
|
|
2773
3236
|
return ParseStatus.mergeArray(status, result);
|
|
@@ -2807,31 +3270,12 @@ var init_lib = __esm({
|
|
|
2807
3270
|
...processCreateParams(params)
|
|
2808
3271
|
});
|
|
2809
3272
|
};
|
|
2810
|
-
(function(objectUtil2) {
|
|
2811
|
-
objectUtil2.mergeShapes = (first, second) => {
|
|
2812
|
-
return {
|
|
2813
|
-
...first,
|
|
2814
|
-
...second
|
|
2815
|
-
// second overwrites first
|
|
2816
|
-
};
|
|
2817
|
-
};
|
|
2818
|
-
})(objectUtil || (objectUtil = {}));
|
|
2819
|
-
AugmentFactory = (def) => (augmentation) => {
|
|
2820
|
-
return new ZodObject({
|
|
2821
|
-
...def,
|
|
2822
|
-
shape: () => ({
|
|
2823
|
-
...def.shape(),
|
|
2824
|
-
...augmentation
|
|
2825
|
-
})
|
|
2826
|
-
});
|
|
2827
|
-
};
|
|
2828
3273
|
ZodObject = class _ZodObject extends ZodType {
|
|
2829
3274
|
constructor() {
|
|
2830
3275
|
super(...arguments);
|
|
2831
3276
|
this._cached = null;
|
|
2832
3277
|
this.nonstrict = this.passthrough;
|
|
2833
|
-
this.augment =
|
|
2834
|
-
this.extend = AugmentFactory(this._def);
|
|
3278
|
+
this.augment = this.extend;
|
|
2835
3279
|
}
|
|
2836
3280
|
_getCached() {
|
|
2837
3281
|
if (this._cached !== null)
|
|
@@ -2912,9 +3356,10 @@ var init_lib = __esm({
|
|
|
2912
3356
|
const syncPairs = [];
|
|
2913
3357
|
for (const pair of pairs) {
|
|
2914
3358
|
const key = await pair.key;
|
|
3359
|
+
const value = await pair.value;
|
|
2915
3360
|
syncPairs.push({
|
|
2916
3361
|
key,
|
|
2917
|
-
value
|
|
3362
|
+
value,
|
|
2918
3363
|
alwaysSet: pair.alwaysSet
|
|
2919
3364
|
});
|
|
2920
3365
|
}
|
|
@@ -2961,8 +3406,31 @@ var init_lib = __esm({
|
|
|
2961
3406
|
unknownKeys: "passthrough"
|
|
2962
3407
|
});
|
|
2963
3408
|
}
|
|
2964
|
-
|
|
2965
|
-
|
|
3409
|
+
// const AugmentFactory =
|
|
3410
|
+
// <Def extends ZodObjectDef>(def: Def) =>
|
|
3411
|
+
// <Augmentation extends ZodRawShape>(
|
|
3412
|
+
// augmentation: Augmentation
|
|
3413
|
+
// ): ZodObject<
|
|
3414
|
+
// extendShape<ReturnType<Def["shape"]>, Augmentation>,
|
|
3415
|
+
// Def["unknownKeys"],
|
|
3416
|
+
// Def["catchall"]
|
|
3417
|
+
// > => {
|
|
3418
|
+
// return new ZodObject({
|
|
3419
|
+
// ...def,
|
|
3420
|
+
// shape: () => ({
|
|
3421
|
+
// ...def.shape(),
|
|
3422
|
+
// ...augmentation,
|
|
3423
|
+
// }),
|
|
3424
|
+
// }) as any;
|
|
3425
|
+
// };
|
|
3426
|
+
extend(augmentation) {
|
|
3427
|
+
return new _ZodObject({
|
|
3428
|
+
...this._def,
|
|
3429
|
+
shape: () => ({
|
|
3430
|
+
...this._def.shape(),
|
|
3431
|
+
...augmentation
|
|
3432
|
+
})
|
|
3433
|
+
});
|
|
2966
3434
|
}
|
|
2967
3435
|
/**
|
|
2968
3436
|
* Prior to zod@1.0.12 there was a bug in the
|
|
@@ -2973,11 +3441,73 @@ var init_lib = __esm({
|
|
|
2973
3441
|
const merged = new _ZodObject({
|
|
2974
3442
|
unknownKeys: merging._def.unknownKeys,
|
|
2975
3443
|
catchall: merging._def.catchall,
|
|
2976
|
-
shape: () =>
|
|
3444
|
+
shape: () => ({
|
|
3445
|
+
...this._def.shape(),
|
|
3446
|
+
...merging._def.shape()
|
|
3447
|
+
}),
|
|
2977
3448
|
typeName: ZodFirstPartyTypeKind.ZodObject
|
|
2978
3449
|
});
|
|
2979
3450
|
return merged;
|
|
2980
3451
|
}
|
|
3452
|
+
// merge<
|
|
3453
|
+
// Incoming extends AnyZodObject,
|
|
3454
|
+
// Augmentation extends Incoming["shape"],
|
|
3455
|
+
// NewOutput extends {
|
|
3456
|
+
// [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
|
|
3457
|
+
// ? Augmentation[k]["_output"]
|
|
3458
|
+
// : k extends keyof Output
|
|
3459
|
+
// ? Output[k]
|
|
3460
|
+
// : never;
|
|
3461
|
+
// },
|
|
3462
|
+
// NewInput extends {
|
|
3463
|
+
// [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
|
|
3464
|
+
// ? Augmentation[k]["_input"]
|
|
3465
|
+
// : k extends keyof Input
|
|
3466
|
+
// ? Input[k]
|
|
3467
|
+
// : never;
|
|
3468
|
+
// }
|
|
3469
|
+
// >(
|
|
3470
|
+
// merging: Incoming
|
|
3471
|
+
// ): ZodObject<
|
|
3472
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
|
3473
|
+
// Incoming["_def"]["unknownKeys"],
|
|
3474
|
+
// Incoming["_def"]["catchall"],
|
|
3475
|
+
// NewOutput,
|
|
3476
|
+
// NewInput
|
|
3477
|
+
// > {
|
|
3478
|
+
// const merged: any = new ZodObject({
|
|
3479
|
+
// unknownKeys: merging._def.unknownKeys,
|
|
3480
|
+
// catchall: merging._def.catchall,
|
|
3481
|
+
// shape: () =>
|
|
3482
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
|
3483
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
3484
|
+
// }) as any;
|
|
3485
|
+
// return merged;
|
|
3486
|
+
// }
|
|
3487
|
+
setKey(key, schema4) {
|
|
3488
|
+
return this.augment({ [key]: schema4 });
|
|
3489
|
+
}
|
|
3490
|
+
// merge<Incoming extends AnyZodObject>(
|
|
3491
|
+
// merging: Incoming
|
|
3492
|
+
// ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
|
|
3493
|
+
// ZodObject<
|
|
3494
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
|
3495
|
+
// Incoming["_def"]["unknownKeys"],
|
|
3496
|
+
// Incoming["_def"]["catchall"]
|
|
3497
|
+
// > {
|
|
3498
|
+
// // const mergedShape = objectUtil.mergeShapes(
|
|
3499
|
+
// // this._def.shape(),
|
|
3500
|
+
// // merging._def.shape()
|
|
3501
|
+
// // );
|
|
3502
|
+
// const merged: any = new ZodObject({
|
|
3503
|
+
// unknownKeys: merging._def.unknownKeys,
|
|
3504
|
+
// catchall: merging._def.catchall,
|
|
3505
|
+
// shape: () =>
|
|
3506
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
|
3507
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
3508
|
+
// }) as any;
|
|
3509
|
+
// return merged;
|
|
3510
|
+
// }
|
|
2981
3511
|
catchall(index4) {
|
|
2982
3512
|
return new _ZodObject({
|
|
2983
3513
|
...this._def,
|
|
@@ -2986,9 +3516,10 @@ var init_lib = __esm({
|
|
|
2986
3516
|
}
|
|
2987
3517
|
pick(mask) {
|
|
2988
3518
|
const shape = {};
|
|
2989
|
-
util.objectKeys(mask).
|
|
2990
|
-
if (this.shape[key])
|
|
3519
|
+
util.objectKeys(mask).forEach((key) => {
|
|
3520
|
+
if (mask[key] && this.shape[key]) {
|
|
2991
3521
|
shape[key] = this.shape[key];
|
|
3522
|
+
}
|
|
2992
3523
|
});
|
|
2993
3524
|
return new _ZodObject({
|
|
2994
3525
|
...this._def,
|
|
@@ -2997,8 +3528,8 @@ var init_lib = __esm({
|
|
|
2997
3528
|
}
|
|
2998
3529
|
omit(mask) {
|
|
2999
3530
|
const shape = {};
|
|
3000
|
-
util.objectKeys(this.shape).
|
|
3001
|
-
if (
|
|
3531
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
3532
|
+
if (!mask[key]) {
|
|
3002
3533
|
shape[key] = this.shape[key];
|
|
3003
3534
|
}
|
|
3004
3535
|
});
|
|
@@ -3007,29 +3538,22 @@ var init_lib = __esm({
|
|
|
3007
3538
|
shape: () => shape
|
|
3008
3539
|
});
|
|
3009
3540
|
}
|
|
3541
|
+
/**
|
|
3542
|
+
* @deprecated
|
|
3543
|
+
*/
|
|
3010
3544
|
deepPartial() {
|
|
3011
3545
|
return deepPartialify(this);
|
|
3012
3546
|
}
|
|
3013
3547
|
partial(mask) {
|
|
3014
3548
|
const newShape = {};
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
newShape[key] = this.shape[key].optional();
|
|
3021
|
-
}
|
|
3022
|
-
});
|
|
3023
|
-
return new _ZodObject({
|
|
3024
|
-
...this._def,
|
|
3025
|
-
shape: () => newShape
|
|
3026
|
-
});
|
|
3027
|
-
} else {
|
|
3028
|
-
for (const key in this.shape) {
|
|
3029
|
-
const fieldSchema = this.shape[key];
|
|
3549
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
3550
|
+
const fieldSchema = this.shape[key];
|
|
3551
|
+
if (mask && !mask[key]) {
|
|
3552
|
+
newShape[key] = fieldSchema;
|
|
3553
|
+
} else {
|
|
3030
3554
|
newShape[key] = fieldSchema.optional();
|
|
3031
3555
|
}
|
|
3032
|
-
}
|
|
3556
|
+
});
|
|
3033
3557
|
return new _ZodObject({
|
|
3034
3558
|
...this._def,
|
|
3035
3559
|
shape: () => newShape
|
|
@@ -3037,21 +3561,10 @@ var init_lib = __esm({
|
|
|
3037
3561
|
}
|
|
3038
3562
|
required(mask) {
|
|
3039
3563
|
const newShape = {};
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
} else {
|
|
3045
|
-
const fieldSchema = this.shape[key];
|
|
3046
|
-
let newField = fieldSchema;
|
|
3047
|
-
while (newField instanceof ZodOptional) {
|
|
3048
|
-
newField = newField._def.innerType;
|
|
3049
|
-
}
|
|
3050
|
-
newShape[key] = newField;
|
|
3051
|
-
}
|
|
3052
|
-
});
|
|
3053
|
-
} else {
|
|
3054
|
-
for (const key in this.shape) {
|
|
3564
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
3565
|
+
if (mask && !mask[key]) {
|
|
3566
|
+
newShape[key] = this.shape[key];
|
|
3567
|
+
} else {
|
|
3055
3568
|
const fieldSchema = this.shape[key];
|
|
3056
3569
|
let newField = fieldSchema;
|
|
3057
3570
|
while (newField instanceof ZodOptional) {
|
|
@@ -3059,7 +3572,7 @@ var init_lib = __esm({
|
|
|
3059
3572
|
}
|
|
3060
3573
|
newShape[key] = newField;
|
|
3061
3574
|
}
|
|
3062
|
-
}
|
|
3575
|
+
});
|
|
3063
3576
|
return new _ZodObject({
|
|
3064
3577
|
...this._def,
|
|
3065
3578
|
shape: () => newShape
|
|
@@ -3197,15 +3710,25 @@ var init_lib = __esm({
|
|
|
3197
3710
|
} else if (type instanceof ZodEnum) {
|
|
3198
3711
|
return type.options;
|
|
3199
3712
|
} else if (type instanceof ZodNativeEnum) {
|
|
3200
|
-
return
|
|
3713
|
+
return util.objectValues(type.enum);
|
|
3201
3714
|
} else if (type instanceof ZodDefault) {
|
|
3202
3715
|
return getDiscriminator(type._def.innerType);
|
|
3203
3716
|
} else if (type instanceof ZodUndefined) {
|
|
3204
3717
|
return [void 0];
|
|
3205
3718
|
} else if (type instanceof ZodNull) {
|
|
3206
3719
|
return [null];
|
|
3720
|
+
} else if (type instanceof ZodOptional) {
|
|
3721
|
+
return [void 0, ...getDiscriminator(type.unwrap())];
|
|
3722
|
+
} else if (type instanceof ZodNullable) {
|
|
3723
|
+
return [null, ...getDiscriminator(type.unwrap())];
|
|
3724
|
+
} else if (type instanceof ZodBranded) {
|
|
3725
|
+
return getDiscriminator(type.unwrap());
|
|
3726
|
+
} else if (type instanceof ZodReadonly) {
|
|
3727
|
+
return getDiscriminator(type.unwrap());
|
|
3728
|
+
} else if (type instanceof ZodCatch) {
|
|
3729
|
+
return getDiscriminator(type._def.innerType);
|
|
3207
3730
|
} else {
|
|
3208
|
-
return
|
|
3731
|
+
return [];
|
|
3209
3732
|
}
|
|
3210
3733
|
};
|
|
3211
3734
|
ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
@@ -3265,7 +3788,7 @@ var init_lib = __esm({
|
|
|
3265
3788
|
const optionsMap = /* @__PURE__ */ new Map();
|
|
3266
3789
|
for (const type of options) {
|
|
3267
3790
|
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
3268
|
-
if (!discriminatorValues) {
|
|
3791
|
+
if (!discriminatorValues.length) {
|
|
3269
3792
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
3270
3793
|
}
|
|
3271
3794
|
for (const value of discriminatorValues) {
|
|
@@ -3369,7 +3892,7 @@ var init_lib = __esm({
|
|
|
3369
3892
|
});
|
|
3370
3893
|
status.dirty();
|
|
3371
3894
|
}
|
|
3372
|
-
const items = ctx.data.map((item, itemIndex) => {
|
|
3895
|
+
const items = [...ctx.data].map((item, itemIndex) => {
|
|
3373
3896
|
const schema4 = this._def.items[itemIndex] || this._def.rest;
|
|
3374
3897
|
if (!schema4)
|
|
3375
3898
|
return null;
|
|
@@ -3427,7 +3950,8 @@ var init_lib = __esm({
|
|
|
3427
3950
|
for (const key in ctx.data) {
|
|
3428
3951
|
pairs.push({
|
|
3429
3952
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
|
3430
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
|
|
3953
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
|
|
3954
|
+
alwaysSet: key in ctx.data
|
|
3431
3955
|
});
|
|
3432
3956
|
}
|
|
3433
3957
|
if (ctx.common.async) {
|
|
@@ -3457,6 +3981,12 @@ var init_lib = __esm({
|
|
|
3457
3981
|
}
|
|
3458
3982
|
};
|
|
3459
3983
|
ZodMap = class extends ZodType {
|
|
3984
|
+
get keySchema() {
|
|
3985
|
+
return this._def.keyType;
|
|
3986
|
+
}
|
|
3987
|
+
get valueSchema() {
|
|
3988
|
+
return this._def.valueType;
|
|
3989
|
+
}
|
|
3460
3990
|
_parse(input) {
|
|
3461
3991
|
const { status, ctx } = this._processInputParams(input);
|
|
3462
3992
|
if (ctx.parsedType !== ZodParsedType.map) {
|
|
@@ -3651,27 +4181,29 @@ var init_lib = __esm({
|
|
|
3651
4181
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
3652
4182
|
const fn = ctx.data;
|
|
3653
4183
|
if (this._def.returns instanceof ZodPromise) {
|
|
3654
|
-
|
|
4184
|
+
const me = this;
|
|
4185
|
+
return OK(async function(...args) {
|
|
3655
4186
|
const error2 = new ZodError([]);
|
|
3656
|
-
const parsedArgs = await
|
|
4187
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
3657
4188
|
error2.addIssue(makeArgsIssue(args, e));
|
|
3658
4189
|
throw error2;
|
|
3659
4190
|
});
|
|
3660
|
-
const result = await fn
|
|
3661
|
-
const parsedReturns = await
|
|
4191
|
+
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
4192
|
+
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
3662
4193
|
error2.addIssue(makeReturnsIssue(result, e));
|
|
3663
4194
|
throw error2;
|
|
3664
4195
|
});
|
|
3665
4196
|
return parsedReturns;
|
|
3666
4197
|
});
|
|
3667
4198
|
} else {
|
|
3668
|
-
|
|
3669
|
-
|
|
4199
|
+
const me = this;
|
|
4200
|
+
return OK(function(...args) {
|
|
4201
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
|
3670
4202
|
if (!parsedArgs.success) {
|
|
3671
4203
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
3672
4204
|
}
|
|
3673
|
-
const result = fn
|
|
3674
|
-
const parsedReturns =
|
|
4205
|
+
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
4206
|
+
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
3675
4207
|
if (!parsedReturns.success) {
|
|
3676
4208
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
3677
4209
|
}
|
|
@@ -3736,6 +4268,7 @@ var init_lib = __esm({
|
|
|
3736
4268
|
if (input.data !== this._def.value) {
|
|
3737
4269
|
const ctx = this._getOrReturnCtx(input);
|
|
3738
4270
|
addIssueToContext(ctx, {
|
|
4271
|
+
received: ctx.data,
|
|
3739
4272
|
code: ZodIssueCode.invalid_literal,
|
|
3740
4273
|
expected: this._def.value
|
|
3741
4274
|
});
|
|
@@ -3754,7 +4287,11 @@ var init_lib = __esm({
|
|
|
3754
4287
|
...processCreateParams(params)
|
|
3755
4288
|
});
|
|
3756
4289
|
};
|
|
3757
|
-
ZodEnum = class extends ZodType {
|
|
4290
|
+
ZodEnum = class _ZodEnum extends ZodType {
|
|
4291
|
+
constructor() {
|
|
4292
|
+
super(...arguments);
|
|
4293
|
+
_ZodEnum_cache.set(this, void 0);
|
|
4294
|
+
}
|
|
3758
4295
|
_parse(input) {
|
|
3759
4296
|
if (typeof input.data !== "string") {
|
|
3760
4297
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -3766,7 +4303,10 @@ var init_lib = __esm({
|
|
|
3766
4303
|
});
|
|
3767
4304
|
return INVALID;
|
|
3768
4305
|
}
|
|
3769
|
-
if (this
|
|
4306
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
|
|
4307
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
|
4308
|
+
}
|
|
4309
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
|
|
3770
4310
|
const ctx = this._getOrReturnCtx(input);
|
|
3771
4311
|
const expectedValues = this._def.values;
|
|
3772
4312
|
addIssueToContext(ctx, {
|
|
@@ -3802,9 +4342,26 @@ var init_lib = __esm({
|
|
|
3802
4342
|
}
|
|
3803
4343
|
return enumValues;
|
|
3804
4344
|
}
|
|
4345
|
+
extract(values, newDef = this._def) {
|
|
4346
|
+
return _ZodEnum.create(values, {
|
|
4347
|
+
...this._def,
|
|
4348
|
+
...newDef
|
|
4349
|
+
});
|
|
4350
|
+
}
|
|
4351
|
+
exclude(values, newDef = this._def) {
|
|
4352
|
+
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
|
|
4353
|
+
...this._def,
|
|
4354
|
+
...newDef
|
|
4355
|
+
});
|
|
4356
|
+
}
|
|
3805
4357
|
};
|
|
4358
|
+
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
3806
4359
|
ZodEnum.create = createZodEnum;
|
|
3807
4360
|
ZodNativeEnum = class extends ZodType {
|
|
4361
|
+
constructor() {
|
|
4362
|
+
super(...arguments);
|
|
4363
|
+
_ZodNativeEnum_cache.set(this, void 0);
|
|
4364
|
+
}
|
|
3808
4365
|
_parse(input) {
|
|
3809
4366
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
3810
4367
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -3817,7 +4374,10 @@ var init_lib = __esm({
|
|
|
3817
4374
|
});
|
|
3818
4375
|
return INVALID;
|
|
3819
4376
|
}
|
|
3820
|
-
if (
|
|
4377
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
|
|
4378
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
|
4379
|
+
}
|
|
4380
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
|
3821
4381
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
3822
4382
|
addIssueToContext(ctx, {
|
|
3823
4383
|
received: ctx.data,
|
|
@@ -3832,6 +4392,7 @@ var init_lib = __esm({
|
|
|
3832
4392
|
return this._def.values;
|
|
3833
4393
|
}
|
|
3834
4394
|
};
|
|
4395
|
+
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
3835
4396
|
ZodNativeEnum.create = (values, params) => {
|
|
3836
4397
|
return new ZodNativeEnum({
|
|
3837
4398
|
values,
|
|
@@ -3840,6 +4401,9 @@ var init_lib = __esm({
|
|
|
3840
4401
|
});
|
|
3841
4402
|
};
|
|
3842
4403
|
ZodPromise = class extends ZodType {
|
|
4404
|
+
unwrap() {
|
|
4405
|
+
return this._def.type;
|
|
4406
|
+
}
|
|
3843
4407
|
_parse(input) {
|
|
3844
4408
|
const { ctx } = this._processInputParams(input);
|
|
3845
4409
|
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
|
@@ -3876,24 +4440,6 @@ var init_lib = __esm({
|
|
|
3876
4440
|
_parse(input) {
|
|
3877
4441
|
const { status, ctx } = this._processInputParams(input);
|
|
3878
4442
|
const effect = this._def.effect || null;
|
|
3879
|
-
if (effect.type === "preprocess") {
|
|
3880
|
-
const processed = effect.transform(ctx.data);
|
|
3881
|
-
if (ctx.common.async) {
|
|
3882
|
-
return Promise.resolve(processed).then((processed2) => {
|
|
3883
|
-
return this._def.schema._parseAsync({
|
|
3884
|
-
data: processed2,
|
|
3885
|
-
path: ctx.path,
|
|
3886
|
-
parent: ctx
|
|
3887
|
-
});
|
|
3888
|
-
});
|
|
3889
|
-
} else {
|
|
3890
|
-
return this._def.schema._parseSync({
|
|
3891
|
-
data: processed,
|
|
3892
|
-
path: ctx.path,
|
|
3893
|
-
parent: ctx
|
|
3894
|
-
});
|
|
3895
|
-
}
|
|
3896
|
-
}
|
|
3897
4443
|
const checkCtx = {
|
|
3898
4444
|
addIssue: (arg) => {
|
|
3899
4445
|
addIssueToContext(ctx, arg);
|
|
@@ -3908,6 +4454,42 @@ var init_lib = __esm({
|
|
|
3908
4454
|
}
|
|
3909
4455
|
};
|
|
3910
4456
|
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
|
4457
|
+
if (effect.type === "preprocess") {
|
|
4458
|
+
const processed = effect.transform(ctx.data, checkCtx);
|
|
4459
|
+
if (ctx.common.async) {
|
|
4460
|
+
return Promise.resolve(processed).then(async (processed2) => {
|
|
4461
|
+
if (status.value === "aborted")
|
|
4462
|
+
return INVALID;
|
|
4463
|
+
const result = await this._def.schema._parseAsync({
|
|
4464
|
+
data: processed2,
|
|
4465
|
+
path: ctx.path,
|
|
4466
|
+
parent: ctx
|
|
4467
|
+
});
|
|
4468
|
+
if (result.status === "aborted")
|
|
4469
|
+
return INVALID;
|
|
4470
|
+
if (result.status === "dirty")
|
|
4471
|
+
return DIRTY(result.value);
|
|
4472
|
+
if (status.value === "dirty")
|
|
4473
|
+
return DIRTY(result.value);
|
|
4474
|
+
return result;
|
|
4475
|
+
});
|
|
4476
|
+
} else {
|
|
4477
|
+
if (status.value === "aborted")
|
|
4478
|
+
return INVALID;
|
|
4479
|
+
const result = this._def.schema._parseSync({
|
|
4480
|
+
data: processed,
|
|
4481
|
+
path: ctx.path,
|
|
4482
|
+
parent: ctx
|
|
4483
|
+
});
|
|
4484
|
+
if (result.status === "aborted")
|
|
4485
|
+
return INVALID;
|
|
4486
|
+
if (result.status === "dirty")
|
|
4487
|
+
return DIRTY(result.value);
|
|
4488
|
+
if (status.value === "dirty")
|
|
4489
|
+
return DIRTY(result.value);
|
|
4490
|
+
return result;
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
3911
4493
|
if (effect.type === "refinement") {
|
|
3912
4494
|
const executeRefinement = (acc) => {
|
|
3913
4495
|
const result = effect.refinement(acc, checkCtx);
|
|
@@ -4050,26 +4632,45 @@ var init_lib = __esm({
|
|
|
4050
4632
|
ZodCatch = class extends ZodType {
|
|
4051
4633
|
_parse(input) {
|
|
4052
4634
|
const { ctx } = this._processInputParams(input);
|
|
4635
|
+
const newCtx = {
|
|
4636
|
+
...ctx,
|
|
4637
|
+
common: {
|
|
4638
|
+
...ctx.common,
|
|
4639
|
+
issues: []
|
|
4640
|
+
}
|
|
4641
|
+
};
|
|
4053
4642
|
const result = this._def.innerType._parse({
|
|
4054
|
-
data:
|
|
4055
|
-
path:
|
|
4056
|
-
parent:
|
|
4643
|
+
data: newCtx.data,
|
|
4644
|
+
path: newCtx.path,
|
|
4645
|
+
parent: {
|
|
4646
|
+
...newCtx
|
|
4647
|
+
}
|
|
4057
4648
|
});
|
|
4058
4649
|
if (isAsync(result)) {
|
|
4059
4650
|
return result.then((result2) => {
|
|
4060
4651
|
return {
|
|
4061
4652
|
status: "valid",
|
|
4062
|
-
value: result2.status === "valid" ? result2.value : this._def.
|
|
4653
|
+
value: result2.status === "valid" ? result2.value : this._def.catchValue({
|
|
4654
|
+
get error() {
|
|
4655
|
+
return new ZodError(newCtx.common.issues);
|
|
4656
|
+
},
|
|
4657
|
+
input: newCtx.data
|
|
4658
|
+
})
|
|
4063
4659
|
};
|
|
4064
4660
|
});
|
|
4065
4661
|
} else {
|
|
4066
4662
|
return {
|
|
4067
4663
|
status: "valid",
|
|
4068
|
-
value: result.status === "valid" ? result.value : this._def.
|
|
4664
|
+
value: result.status === "valid" ? result.value : this._def.catchValue({
|
|
4665
|
+
get error() {
|
|
4666
|
+
return new ZodError(newCtx.common.issues);
|
|
4667
|
+
},
|
|
4668
|
+
input: newCtx.data
|
|
4669
|
+
})
|
|
4069
4670
|
};
|
|
4070
4671
|
}
|
|
4071
4672
|
}
|
|
4072
|
-
|
|
4673
|
+
removeCatch() {
|
|
4073
4674
|
return this._def.innerType;
|
|
4074
4675
|
}
|
|
4075
4676
|
};
|
|
@@ -4077,7 +4678,7 @@ var init_lib = __esm({
|
|
|
4077
4678
|
return new ZodCatch({
|
|
4078
4679
|
innerType: type,
|
|
4079
4680
|
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
4080
|
-
|
|
4681
|
+
catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
|
|
4081
4682
|
...processCreateParams(params)
|
|
4082
4683
|
});
|
|
4083
4684
|
};
|
|
@@ -4172,6 +4773,25 @@ var init_lib = __esm({
|
|
|
4172
4773
|
});
|
|
4173
4774
|
}
|
|
4174
4775
|
};
|
|
4776
|
+
ZodReadonly = class extends ZodType {
|
|
4777
|
+
_parse(input) {
|
|
4778
|
+
const result = this._def.innerType._parse(input);
|
|
4779
|
+
if (isValid(result)) {
|
|
4780
|
+
result.value = Object.freeze(result.value);
|
|
4781
|
+
}
|
|
4782
|
+
return result;
|
|
4783
|
+
}
|
|
4784
|
+
unwrap() {
|
|
4785
|
+
return this._def.innerType;
|
|
4786
|
+
}
|
|
4787
|
+
};
|
|
4788
|
+
ZodReadonly.create = (type, params) => {
|
|
4789
|
+
return new ZodReadonly({
|
|
4790
|
+
innerType: type,
|
|
4791
|
+
typeName: ZodFirstPartyTypeKind.ZodReadonly,
|
|
4792
|
+
...processCreateParams(params)
|
|
4793
|
+
});
|
|
4794
|
+
};
|
|
4175
4795
|
late = {
|
|
4176
4796
|
object: ZodObject.lazycreate
|
|
4177
4797
|
};
|
|
@@ -4211,6 +4831,7 @@ var init_lib = __esm({
|
|
|
4211
4831
|
ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
|
|
4212
4832
|
ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
|
|
4213
4833
|
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
|
4834
|
+
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
|
4214
4835
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
4215
4836
|
stringType = ZodString.create;
|
|
4216
4837
|
numberType = ZodNumber.create;
|
|
@@ -4249,7 +4870,10 @@ var init_lib = __esm({
|
|
|
4249
4870
|
coerce = {
|
|
4250
4871
|
string: (arg) => ZodString.create({ ...arg, coerce: true }),
|
|
4251
4872
|
number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
|
|
4252
|
-
boolean: (arg) => ZodBoolean.create({
|
|
4873
|
+
boolean: (arg) => ZodBoolean.create({
|
|
4874
|
+
...arg,
|
|
4875
|
+
coerce: true
|
|
4876
|
+
}),
|
|
4253
4877
|
bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
|
|
4254
4878
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
4255
4879
|
};
|
|
@@ -4695,7 +5319,7 @@ var init_pgSchema = __esm({
|
|
|
4695
5319
|
}).strict();
|
|
4696
5320
|
pgSchemaInternal = objectType({
|
|
4697
5321
|
version: literalType("6"),
|
|
4698
|
-
dialect: literalType("
|
|
5322
|
+
dialect: literalType("postgresql"),
|
|
4699
5323
|
tables: recordType(stringType(), table2),
|
|
4700
5324
|
enums: recordType(stringType(), enumSchema),
|
|
4701
5325
|
schemas: recordType(stringType(), stringType()),
|
|
@@ -4724,14 +5348,14 @@ var init_pgSchema = __esm({
|
|
|
4724
5348
|
}).strict();
|
|
4725
5349
|
pgSchemaSquashedV4 = objectType({
|
|
4726
5350
|
version: literalType("4"),
|
|
4727
|
-
dialect:
|
|
5351
|
+
dialect: literalType("pg"),
|
|
4728
5352
|
tables: recordType(stringType(), tableSquashedV42),
|
|
4729
5353
|
enums: recordType(stringType(), enumSchemaV1),
|
|
4730
5354
|
schemas: recordType(stringType(), stringType())
|
|
4731
5355
|
}).strict();
|
|
4732
5356
|
pgSchemaSquashed = objectType({
|
|
4733
5357
|
version: literalType("6"),
|
|
4734
|
-
dialect:
|
|
5358
|
+
dialect: literalType("postgresql"),
|
|
4735
5359
|
tables: recordType(stringType(), tableSquashed2),
|
|
4736
5360
|
enums: recordType(stringType(), enumSchema),
|
|
4737
5361
|
schemas: recordType(stringType(), stringType())
|
|
@@ -4842,7 +5466,7 @@ var init_pgSchema = __esm({
|
|
|
4842
5466
|
};
|
|
4843
5467
|
dryPg = pgSchema.parse({
|
|
4844
5468
|
version: snapshotVersion,
|
|
4845
|
-
dialect: "
|
|
5469
|
+
dialect: "postgresql",
|
|
4846
5470
|
id: originUUID,
|
|
4847
5471
|
prevId: "",
|
|
4848
5472
|
tables: {},
|
|
@@ -5071,7 +5695,6 @@ var init_utils = __esm({
|
|
|
5071
5695
|
init_mysqlSchema();
|
|
5072
5696
|
init_pgSchema();
|
|
5073
5697
|
init_sqliteSchema();
|
|
5074
|
-
init_source();
|
|
5075
5698
|
init_global();
|
|
5076
5699
|
copy = (it) => {
|
|
5077
5700
|
return JSON.parse(JSON.stringify(it));
|
|
@@ -5276,10 +5899,9 @@ var init_serializer = __esm({
|
|
|
5276
5899
|
"src/serializer/index.ts"() {
|
|
5277
5900
|
"use strict";
|
|
5278
5901
|
glob = __toESM(require("glob"));
|
|
5279
|
-
init_source();
|
|
5280
5902
|
init_views();
|
|
5281
|
-
sqlToStr = (
|
|
5282
|
-
return
|
|
5903
|
+
sqlToStr = (sql) => {
|
|
5904
|
+
return sql.toQuery({
|
|
5283
5905
|
escapeName: () => {
|
|
5284
5906
|
throw new Error("we don't support params for `sql` default values");
|
|
5285
5907
|
},
|
|
@@ -5305,7 +5927,8 @@ var init_outputs = __esm({
|
|
|
5305
5927
|
warning: (str) => `${source_default.white.bgGray(" Warning ")} ${str}`,
|
|
5306
5928
|
errorWarning: (str) => `${source_default.red(`${source_default.white.bgRed(" Warning ")} ${str}`)}`,
|
|
5307
5929
|
fullWarning: (str) => `${source_default.black.bgYellow("[Warning]")} ${source_default.bold(str)}`,
|
|
5308
|
-
suggestion: (str) => `${source_default.white.bgGray(" Suggestion ")} ${str}
|
|
5930
|
+
suggestion: (str) => `${source_default.white.bgGray(" Suggestion ")} ${str}`,
|
|
5931
|
+
info: (str) => `${source_default.grey(str)}`
|
|
5309
5932
|
};
|
|
5310
5933
|
}
|
|
5311
5934
|
});
|
|
@@ -5390,7 +6013,7 @@ var init_schemaValidator = __esm({
|
|
|
5390
6013
|
init_mysqlSchema();
|
|
5391
6014
|
init_pgSchema();
|
|
5392
6015
|
init_sqliteSchema();
|
|
5393
|
-
dialect3 = enumType(["
|
|
6016
|
+
dialect3 = enumType(["postgresql", "mysql", "sqlite"]);
|
|
5394
6017
|
commonSquashedSchema = unionType([
|
|
5395
6018
|
pgSchemaSquashed,
|
|
5396
6019
|
mysqlSchemaSquashed,
|
|
@@ -5510,8 +6133,8 @@ var init_cli = __esm({
|
|
|
5510
6133
|
dialect: dialect3,
|
|
5511
6134
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
5512
6135
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
|
5513
|
-
|
|
5514
|
-
driver: stringType(),
|
|
6136
|
+
schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
|
|
6137
|
+
driver: stringType().optional(),
|
|
5515
6138
|
// pg
|
|
5516
6139
|
connectionString: stringType().optional(),
|
|
5517
6140
|
// mysql
|
|
@@ -5549,7 +6172,7 @@ var init_cli = __esm({
|
|
|
5549
6172
|
authToken: stringType().optional(),
|
|
5550
6173
|
introspectCasing: casing,
|
|
5551
6174
|
breakpoints: booleanType().optional().default(true)
|
|
5552
|
-
});
|
|
6175
|
+
}).passthrough();
|
|
5553
6176
|
configCheck = objectType({
|
|
5554
6177
|
dialect: dialect3.optional(),
|
|
5555
6178
|
out: stringType().optional()
|
|
@@ -5563,6 +6186,33 @@ var init_cli = __esm({
|
|
|
5563
6186
|
}
|
|
5564
6187
|
});
|
|
5565
6188
|
|
|
6189
|
+
// src/cli/validations/studio.ts
|
|
6190
|
+
var credentials, studioCliParams, studioConfig;
|
|
6191
|
+
var init_studio = __esm({
|
|
6192
|
+
"src/cli/validations/studio.ts"() {
|
|
6193
|
+
"use strict";
|
|
6194
|
+
init_lib();
|
|
6195
|
+
init_mysql();
|
|
6196
|
+
init_sqlite();
|
|
6197
|
+
init_schemaValidator();
|
|
6198
|
+
init_pg();
|
|
6199
|
+
credentials = intersectionType(
|
|
6200
|
+
postgresCredentials,
|
|
6201
|
+
mysqlCredentials,
|
|
6202
|
+
sqliteCredentials
|
|
6203
|
+
);
|
|
6204
|
+
studioCliParams = objectType({
|
|
6205
|
+
port: coerce.number().optional().default(4983),
|
|
6206
|
+
host: stringType().optional().default("127.0.0.1"),
|
|
6207
|
+
config: stringType().optional()
|
|
6208
|
+
});
|
|
6209
|
+
studioConfig = objectType({
|
|
6210
|
+
dialect: dialect3,
|
|
6211
|
+
schema: unionType([stringType(), stringType().array()])
|
|
6212
|
+
});
|
|
6213
|
+
}
|
|
6214
|
+
});
|
|
6215
|
+
|
|
5566
6216
|
// src/cli/commands/_es5.ts
|
|
5567
6217
|
var es5_exports = {};
|
|
5568
6218
|
__export(es5_exports, {
|
|
@@ -5579,7 +6229,7 @@ var init_es5 = __esm({
|
|
|
5579
6229
|
|
|
5580
6230
|
// node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
|
|
5581
6231
|
var require_ms = __commonJS({
|
|
5582
|
-
"node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(
|
|
6232
|
+
"node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports2, module2) {
|
|
5583
6233
|
var s = 1e3;
|
|
5584
6234
|
var m = s * 60;
|
|
5585
6235
|
var h = m * 60;
|
|
@@ -5695,7 +6345,7 @@ var require_ms = __commonJS({
|
|
|
5695
6345
|
|
|
5696
6346
|
// node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js
|
|
5697
6347
|
var require_common = __commonJS({
|
|
5698
|
-
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js"(
|
|
6348
|
+
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js"(exports2, module2) {
|
|
5699
6349
|
function setup(env2) {
|
|
5700
6350
|
createDebug.debug = createDebug;
|
|
5701
6351
|
createDebug.default = createDebug;
|
|
@@ -5858,13 +6508,13 @@ var require_common = __commonJS({
|
|
|
5858
6508
|
|
|
5859
6509
|
// node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js
|
|
5860
6510
|
var require_browser = __commonJS({
|
|
5861
|
-
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js"(
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
6511
|
+
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js"(exports2, module2) {
|
|
6512
|
+
exports2.formatArgs = formatArgs;
|
|
6513
|
+
exports2.save = save;
|
|
6514
|
+
exports2.load = load;
|
|
6515
|
+
exports2.useColors = useColors;
|
|
6516
|
+
exports2.storage = localstorage();
|
|
6517
|
+
exports2.destroy = /* @__PURE__ */ (() => {
|
|
5868
6518
|
let warned = false;
|
|
5869
6519
|
return () => {
|
|
5870
6520
|
if (!warned) {
|
|
@@ -5873,7 +6523,7 @@ var require_browser = __commonJS({
|
|
|
5873
6523
|
}
|
|
5874
6524
|
};
|
|
5875
6525
|
})();
|
|
5876
|
-
|
|
6526
|
+
exports2.colors = [
|
|
5877
6527
|
"#0000CC",
|
|
5878
6528
|
"#0000FF",
|
|
5879
6529
|
"#0033CC",
|
|
@@ -5984,14 +6634,14 @@ var require_browser = __commonJS({
|
|
|
5984
6634
|
});
|
|
5985
6635
|
args.splice(lastC, 0, c);
|
|
5986
6636
|
}
|
|
5987
|
-
|
|
6637
|
+
exports2.log = console.debug || console.log || (() => {
|
|
5988
6638
|
});
|
|
5989
6639
|
function save(namespaces) {
|
|
5990
6640
|
try {
|
|
5991
6641
|
if (namespaces) {
|
|
5992
|
-
|
|
6642
|
+
exports2.storage.setItem("debug", namespaces);
|
|
5993
6643
|
} else {
|
|
5994
|
-
|
|
6644
|
+
exports2.storage.removeItem("debug");
|
|
5995
6645
|
}
|
|
5996
6646
|
} catch (error2) {
|
|
5997
6647
|
}
|
|
@@ -5999,7 +6649,7 @@ var require_browser = __commonJS({
|
|
|
5999
6649
|
function load() {
|
|
6000
6650
|
let r;
|
|
6001
6651
|
try {
|
|
6002
|
-
r =
|
|
6652
|
+
r = exports2.storage.getItem("debug");
|
|
6003
6653
|
} catch (error2) {
|
|
6004
6654
|
}
|
|
6005
6655
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
@@ -6013,7 +6663,7 @@ var require_browser = __commonJS({
|
|
|
6013
6663
|
} catch (error2) {
|
|
6014
6664
|
}
|
|
6015
6665
|
}
|
|
6016
|
-
module2.exports = require_common()(
|
|
6666
|
+
module2.exports = require_common()(exports2);
|
|
6017
6667
|
var { formatters } = module2.exports;
|
|
6018
6668
|
formatters.j = function(v) {
|
|
6019
6669
|
try {
|
|
@@ -6027,7 +6677,7 @@ var require_browser = __commonJS({
|
|
|
6027
6677
|
|
|
6028
6678
|
// node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
|
|
6029
6679
|
var require_has_flag = __commonJS({
|
|
6030
|
-
"node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(
|
|
6680
|
+
"node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) {
|
|
6031
6681
|
"use strict";
|
|
6032
6682
|
module2.exports = (flag, argv = process.argv) => {
|
|
6033
6683
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -6040,7 +6690,7 @@ var require_has_flag = __commonJS({
|
|
|
6040
6690
|
|
|
6041
6691
|
// node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
6042
6692
|
var require_supports_color = __commonJS({
|
|
6043
|
-
"node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(
|
|
6693
|
+
"node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) {
|
|
6044
6694
|
"use strict";
|
|
6045
6695
|
var os2 = require("os");
|
|
6046
6696
|
var tty2 = require("tty");
|
|
@@ -6142,25 +6792,25 @@ var require_supports_color = __commonJS({
|
|
|
6142
6792
|
|
|
6143
6793
|
// node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js
|
|
6144
6794
|
var require_node = __commonJS({
|
|
6145
|
-
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js"(
|
|
6795
|
+
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js"(exports2, module2) {
|
|
6146
6796
|
var tty2 = require("tty");
|
|
6147
6797
|
var util2 = require("util");
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6798
|
+
exports2.init = init;
|
|
6799
|
+
exports2.log = log;
|
|
6800
|
+
exports2.formatArgs = formatArgs;
|
|
6801
|
+
exports2.save = save;
|
|
6802
|
+
exports2.load = load;
|
|
6803
|
+
exports2.useColors = useColors;
|
|
6804
|
+
exports2.destroy = util2.deprecate(
|
|
6155
6805
|
() => {
|
|
6156
6806
|
},
|
|
6157
6807
|
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
6158
6808
|
);
|
|
6159
|
-
|
|
6809
|
+
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
6160
6810
|
try {
|
|
6161
6811
|
const supportsColor2 = require_supports_color();
|
|
6162
6812
|
if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) {
|
|
6163
|
-
|
|
6813
|
+
exports2.colors = [
|
|
6164
6814
|
20,
|
|
6165
6815
|
21,
|
|
6166
6816
|
26,
|
|
@@ -6241,7 +6891,7 @@ var require_node = __commonJS({
|
|
|
6241
6891
|
}
|
|
6242
6892
|
} catch (error2) {
|
|
6243
6893
|
}
|
|
6244
|
-
|
|
6894
|
+
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
6245
6895
|
return /^debug_/i.test(key);
|
|
6246
6896
|
}).reduce((obj, key) => {
|
|
6247
6897
|
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_2, k) => {
|
|
@@ -6261,7 +6911,7 @@ var require_node = __commonJS({
|
|
|
6261
6911
|
return obj;
|
|
6262
6912
|
}, {});
|
|
6263
6913
|
function useColors() {
|
|
6264
|
-
return "colors" in
|
|
6914
|
+
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty2.isatty(process.stderr.fd);
|
|
6265
6915
|
}
|
|
6266
6916
|
function formatArgs(args) {
|
|
6267
6917
|
const { namespace: name, useColors: useColors2 } = this;
|
|
@@ -6276,7 +6926,7 @@ var require_node = __commonJS({
|
|
|
6276
6926
|
}
|
|
6277
6927
|
}
|
|
6278
6928
|
function getDate() {
|
|
6279
|
-
if (
|
|
6929
|
+
if (exports2.inspectOpts.hideDate) {
|
|
6280
6930
|
return "";
|
|
6281
6931
|
}
|
|
6282
6932
|
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
@@ -6296,12 +6946,12 @@ var require_node = __commonJS({
|
|
|
6296
6946
|
}
|
|
6297
6947
|
function init(debug) {
|
|
6298
6948
|
debug.inspectOpts = {};
|
|
6299
|
-
const keys = Object.keys(
|
|
6949
|
+
const keys = Object.keys(exports2.inspectOpts);
|
|
6300
6950
|
for (let i = 0; i < keys.length; i++) {
|
|
6301
|
-
debug.inspectOpts[keys[i]] =
|
|
6951
|
+
debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
6302
6952
|
}
|
|
6303
6953
|
}
|
|
6304
|
-
module2.exports = require_common()(
|
|
6954
|
+
module2.exports = require_common()(exports2);
|
|
6305
6955
|
var { formatters } = module2.exports;
|
|
6306
6956
|
formatters.o = function(v) {
|
|
6307
6957
|
this.inspectOpts.colors = this.useColors;
|
|
@@ -6316,7 +6966,7 @@ var require_node = __commonJS({
|
|
|
6316
6966
|
|
|
6317
6967
|
// node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js
|
|
6318
6968
|
var require_src2 = __commonJS({
|
|
6319
|
-
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js"(
|
|
6969
|
+
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js"(exports2, module2) {
|
|
6320
6970
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
6321
6971
|
module2.exports = require_browser();
|
|
6322
6972
|
} else {
|
|
@@ -6325,11 +6975,11 @@ var require_src2 = __commonJS({
|
|
|
6325
6975
|
}
|
|
6326
6976
|
});
|
|
6327
6977
|
|
|
6328
|
-
// node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.19.
|
|
6978
|
+
// node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.19.12/node_modules/esbuild-register/dist/node.js
|
|
6329
6979
|
var require_node2 = __commonJS({
|
|
6330
|
-
"node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.19.
|
|
6980
|
+
"node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.19.12/node_modules/esbuild-register/dist/node.js"(exports2) {
|
|
6331
6981
|
"use strict";
|
|
6332
|
-
Object.defineProperty(
|
|
6982
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6333
6983
|
function _interopRequireDefault2(obj) {
|
|
6334
6984
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
6335
6985
|
}
|
|
@@ -6358,15 +7008,15 @@ var require_node2 = __commonJS({
|
|
|
6358
7008
|
var __toModule = (module22) => {
|
|
6359
7009
|
return __exportStar(__markAsModule(__defProp2(module22 != null ? __create2(__getProtoOf2(module22)) : {}, "default", module22 && module22.__esModule && "default" in module22 ? { get: () => module22.default, enumerable: true } : { value: module22, enumerable: true })), module22);
|
|
6360
7010
|
};
|
|
6361
|
-
var require_base64 = __commonJS2((
|
|
7011
|
+
var require_base64 = __commonJS2((exports3) => {
|
|
6362
7012
|
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
6363
|
-
|
|
7013
|
+
exports3.encode = function(number) {
|
|
6364
7014
|
if (0 <= number && number < intToCharMap.length) {
|
|
6365
7015
|
return intToCharMap[number];
|
|
6366
7016
|
}
|
|
6367
7017
|
throw new TypeError("Must be between 0 and 63: " + number);
|
|
6368
7018
|
};
|
|
6369
|
-
|
|
7019
|
+
exports3.decode = function(charCode) {
|
|
6370
7020
|
var bigA = 65;
|
|
6371
7021
|
var bigZ = 90;
|
|
6372
7022
|
var littleA = 97;
|
|
@@ -6395,7 +7045,7 @@ var require_node2 = __commonJS({
|
|
|
6395
7045
|
return -1;
|
|
6396
7046
|
};
|
|
6397
7047
|
});
|
|
6398
|
-
var require_base64_vlq = __commonJS2((
|
|
7048
|
+
var require_base64_vlq = __commonJS2((exports3) => {
|
|
6399
7049
|
var base64 = require_base64();
|
|
6400
7050
|
var VLQ_BASE_SHIFT = 5;
|
|
6401
7051
|
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
@@ -6409,7 +7059,7 @@ var require_node2 = __commonJS({
|
|
|
6409
7059
|
var shifted = aValue >> 1;
|
|
6410
7060
|
return isNegative ? -shifted : shifted;
|
|
6411
7061
|
}
|
|
6412
|
-
|
|
7062
|
+
exports3.encode = function base64VLQ_encode(aValue) {
|
|
6413
7063
|
var encoded = "";
|
|
6414
7064
|
var digit;
|
|
6415
7065
|
var vlq = toVLQSigned(aValue);
|
|
@@ -6423,7 +7073,7 @@ var require_node2 = __commonJS({
|
|
|
6423
7073
|
} while (vlq > 0);
|
|
6424
7074
|
return encoded;
|
|
6425
7075
|
};
|
|
6426
|
-
|
|
7076
|
+
exports3.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
|
6427
7077
|
var strLen = aStr.length;
|
|
6428
7078
|
var result = 0;
|
|
6429
7079
|
var shift = 0;
|
|
@@ -6445,7 +7095,7 @@ var require_node2 = __commonJS({
|
|
|
6445
7095
|
aOutParam.rest = aIndex;
|
|
6446
7096
|
};
|
|
6447
7097
|
});
|
|
6448
|
-
var require_util = __commonJS2((
|
|
7098
|
+
var require_util = __commonJS2((exports3) => {
|
|
6449
7099
|
function getArg(aArgs, aName, aDefaultValue) {
|
|
6450
7100
|
if (aName in aArgs) {
|
|
6451
7101
|
return aArgs[aName];
|
|
@@ -6455,7 +7105,7 @@ var require_node2 = __commonJS({
|
|
|
6455
7105
|
throw new Error('"' + aName + '" is a required argument.');
|
|
6456
7106
|
}
|
|
6457
7107
|
}
|
|
6458
|
-
|
|
7108
|
+
exports3.getArg = getArg;
|
|
6459
7109
|
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
|
6460
7110
|
var dataUrlRegexp = /^data:.+\,.+$/;
|
|
6461
7111
|
function urlParse(aUrl) {
|
|
@@ -6471,7 +7121,7 @@ var require_node2 = __commonJS({
|
|
|
6471
7121
|
path: match2[5]
|
|
6472
7122
|
};
|
|
6473
7123
|
}
|
|
6474
|
-
|
|
7124
|
+
exports3.urlParse = urlParse;
|
|
6475
7125
|
function urlGenerate(aParsedUrl) {
|
|
6476
7126
|
var url = "";
|
|
6477
7127
|
if (aParsedUrl.scheme) {
|
|
@@ -6492,7 +7142,7 @@ var require_node2 = __commonJS({
|
|
|
6492
7142
|
}
|
|
6493
7143
|
return url;
|
|
6494
7144
|
}
|
|
6495
|
-
|
|
7145
|
+
exports3.urlGenerate = urlGenerate;
|
|
6496
7146
|
function normalize(aPath) {
|
|
6497
7147
|
var path2 = aPath;
|
|
6498
7148
|
var url = urlParse(aPath);
|
|
@@ -6502,7 +7152,7 @@ var require_node2 = __commonJS({
|
|
|
6502
7152
|
}
|
|
6503
7153
|
path2 = url.path;
|
|
6504
7154
|
}
|
|
6505
|
-
var isAbsolute =
|
|
7155
|
+
var isAbsolute = exports3.isAbsolute(path2);
|
|
6506
7156
|
var parts = path2.split(/\/+/);
|
|
6507
7157
|
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
|
6508
7158
|
part = parts[i];
|
|
@@ -6530,7 +7180,7 @@ var require_node2 = __commonJS({
|
|
|
6530
7180
|
}
|
|
6531
7181
|
return path2;
|
|
6532
7182
|
}
|
|
6533
|
-
|
|
7183
|
+
exports3.normalize = normalize;
|
|
6534
7184
|
function join2(aRoot, aPath) {
|
|
6535
7185
|
if (aRoot === "") {
|
|
6536
7186
|
aRoot = ".";
|
|
@@ -6563,8 +7213,8 @@ var require_node2 = __commonJS({
|
|
|
6563
7213
|
}
|
|
6564
7214
|
return joined;
|
|
6565
7215
|
}
|
|
6566
|
-
|
|
6567
|
-
|
|
7216
|
+
exports3.join = join2;
|
|
7217
|
+
exports3.isAbsolute = function(aPath) {
|
|
6568
7218
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
6569
7219
|
};
|
|
6570
7220
|
function relative(aRoot, aPath) {
|
|
@@ -6586,7 +7236,7 @@ var require_node2 = __commonJS({
|
|
|
6586
7236
|
}
|
|
6587
7237
|
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
6588
7238
|
}
|
|
6589
|
-
|
|
7239
|
+
exports3.relative = relative;
|
|
6590
7240
|
var supportsNullProto = function() {
|
|
6591
7241
|
var obj = /* @__PURE__ */ Object.create(null);
|
|
6592
7242
|
return !("__proto__" in obj);
|
|
@@ -6600,14 +7250,14 @@ var require_node2 = __commonJS({
|
|
|
6600
7250
|
}
|
|
6601
7251
|
return aStr;
|
|
6602
7252
|
}
|
|
6603
|
-
|
|
7253
|
+
exports3.toSetString = supportsNullProto ? identity : toSetString;
|
|
6604
7254
|
function fromSetString(aStr) {
|
|
6605
7255
|
if (isProtoString(aStr)) {
|
|
6606
7256
|
return aStr.slice(1);
|
|
6607
7257
|
}
|
|
6608
7258
|
return aStr;
|
|
6609
7259
|
}
|
|
6610
|
-
|
|
7260
|
+
exports3.fromSetString = supportsNullProto ? identity : fromSetString;
|
|
6611
7261
|
function isProtoString(s) {
|
|
6612
7262
|
if (!s) {
|
|
6613
7263
|
return false;
|
|
@@ -6649,7 +7299,7 @@ var require_node2 = __commonJS({
|
|
|
6649
7299
|
}
|
|
6650
7300
|
return strcmp(mappingA.name, mappingB.name);
|
|
6651
7301
|
}
|
|
6652
|
-
|
|
7302
|
+
exports3.compareByOriginalPositions = compareByOriginalPositions;
|
|
6653
7303
|
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
|
6654
7304
|
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
6655
7305
|
if (cmp !== 0) {
|
|
@@ -6673,7 +7323,7 @@ var require_node2 = __commonJS({
|
|
|
6673
7323
|
}
|
|
6674
7324
|
return strcmp(mappingA.name, mappingB.name);
|
|
6675
7325
|
}
|
|
6676
|
-
|
|
7326
|
+
exports3.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
|
6677
7327
|
function strcmp(aStr1, aStr2) {
|
|
6678
7328
|
if (aStr1 === aStr2) {
|
|
6679
7329
|
return 0;
|
|
@@ -6712,11 +7362,11 @@ var require_node2 = __commonJS({
|
|
|
6712
7362
|
}
|
|
6713
7363
|
return strcmp(mappingA.name, mappingB.name);
|
|
6714
7364
|
}
|
|
6715
|
-
|
|
7365
|
+
exports3.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
|
6716
7366
|
function parseSourceMapInput(str) {
|
|
6717
7367
|
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
|
|
6718
7368
|
}
|
|
6719
|
-
|
|
7369
|
+
exports3.parseSourceMapInput = parseSourceMapInput;
|
|
6720
7370
|
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
|
6721
7371
|
sourceURL = sourceURL || "";
|
|
6722
7372
|
if (sourceRoot) {
|
|
@@ -6740,9 +7390,9 @@ var require_node2 = __commonJS({
|
|
|
6740
7390
|
}
|
|
6741
7391
|
return normalize(sourceURL);
|
|
6742
7392
|
}
|
|
6743
|
-
|
|
7393
|
+
exports3.computeSourceURL = computeSourceURL;
|
|
6744
7394
|
});
|
|
6745
|
-
var require_array_set = __commonJS2((
|
|
7395
|
+
var require_array_set = __commonJS2((exports3) => {
|
|
6746
7396
|
var util2 = require_util();
|
|
6747
7397
|
var has = Object.prototype.hasOwnProperty;
|
|
6748
7398
|
var hasNativeMap = typeof Map !== "undefined";
|
|
@@ -6806,9 +7456,9 @@ var require_node2 = __commonJS({
|
|
|
6806
7456
|
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
|
6807
7457
|
return this._array.slice();
|
|
6808
7458
|
};
|
|
6809
|
-
|
|
7459
|
+
exports3.ArraySet = ArraySet;
|
|
6810
7460
|
});
|
|
6811
|
-
var require_mapping_list = __commonJS2((
|
|
7461
|
+
var require_mapping_list = __commonJS2((exports3) => {
|
|
6812
7462
|
var util2 = require_util();
|
|
6813
7463
|
function generatedPositionAfter(mappingA, mappingB) {
|
|
6814
7464
|
var lineA = mappingA.generatedLine;
|
|
@@ -6841,9 +7491,9 @@ var require_node2 = __commonJS({
|
|
|
6841
7491
|
}
|
|
6842
7492
|
return this._array;
|
|
6843
7493
|
};
|
|
6844
|
-
|
|
7494
|
+
exports3.MappingList = MappingList;
|
|
6845
7495
|
});
|
|
6846
|
-
var require_source_map_generator = __commonJS2((
|
|
7496
|
+
var require_source_map_generator = __commonJS2((exports3) => {
|
|
6847
7497
|
var base64VLQ = require_base64_vlq();
|
|
6848
7498
|
var util2 = require_util();
|
|
6849
7499
|
var ArraySet = require_array_set().ArraySet;
|
|
@@ -7109,11 +7759,11 @@ var require_node2 = __commonJS({
|
|
|
7109
7759
|
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
|
|
7110
7760
|
return JSON.stringify(this.toJSON());
|
|
7111
7761
|
};
|
|
7112
|
-
|
|
7762
|
+
exports3.SourceMapGenerator = SourceMapGenerator;
|
|
7113
7763
|
});
|
|
7114
|
-
var require_binary_search = __commonJS2((
|
|
7115
|
-
|
|
7116
|
-
|
|
7764
|
+
var require_binary_search = __commonJS2((exports3) => {
|
|
7765
|
+
exports3.GREATEST_LOWER_BOUND = 1;
|
|
7766
|
+
exports3.LEAST_UPPER_BOUND = 2;
|
|
7117
7767
|
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
|
7118
7768
|
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
|
7119
7769
|
var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
|
@@ -7123,7 +7773,7 @@ var require_node2 = __commonJS({
|
|
|
7123
7773
|
if (aHigh - mid > 1) {
|
|
7124
7774
|
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
|
7125
7775
|
}
|
|
7126
|
-
if (aBias ==
|
|
7776
|
+
if (aBias == exports3.LEAST_UPPER_BOUND) {
|
|
7127
7777
|
return aHigh < aHaystack.length ? aHigh : -1;
|
|
7128
7778
|
} else {
|
|
7129
7779
|
return mid;
|
|
@@ -7132,18 +7782,18 @@ var require_node2 = __commonJS({
|
|
|
7132
7782
|
if (mid - aLow > 1) {
|
|
7133
7783
|
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
|
7134
7784
|
}
|
|
7135
|
-
if (aBias ==
|
|
7785
|
+
if (aBias == exports3.LEAST_UPPER_BOUND) {
|
|
7136
7786
|
return mid;
|
|
7137
7787
|
} else {
|
|
7138
7788
|
return aLow < 0 ? -1 : aLow;
|
|
7139
7789
|
}
|
|
7140
7790
|
}
|
|
7141
7791
|
}
|
|
7142
|
-
|
|
7792
|
+
exports3.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
|
7143
7793
|
if (aHaystack.length === 0) {
|
|
7144
7794
|
return -1;
|
|
7145
7795
|
}
|
|
7146
|
-
var index4 = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias ||
|
|
7796
|
+
var index4 = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports3.GREATEST_LOWER_BOUND);
|
|
7147
7797
|
if (index4 < 0) {
|
|
7148
7798
|
return -1;
|
|
7149
7799
|
}
|
|
@@ -7156,7 +7806,7 @@ var require_node2 = __commonJS({
|
|
|
7156
7806
|
return index4;
|
|
7157
7807
|
};
|
|
7158
7808
|
});
|
|
7159
|
-
var require_quick_sort = __commonJS2((
|
|
7809
|
+
var require_quick_sort = __commonJS2((exports3) => {
|
|
7160
7810
|
function swap(ary, x, y) {
|
|
7161
7811
|
var temp = ary[x];
|
|
7162
7812
|
ary[x] = ary[y];
|
|
@@ -7183,11 +7833,11 @@ var require_node2 = __commonJS({
|
|
|
7183
7833
|
doQuickSort(ary, comparator, q + 1, r);
|
|
7184
7834
|
}
|
|
7185
7835
|
}
|
|
7186
|
-
|
|
7836
|
+
exports3.quickSort = function(ary, comparator) {
|
|
7187
7837
|
doQuickSort(ary, comparator, 0, ary.length - 1);
|
|
7188
7838
|
};
|
|
7189
7839
|
});
|
|
7190
|
-
var require_source_map_consumer = __commonJS2((
|
|
7840
|
+
var require_source_map_consumer = __commonJS2((exports3) => {
|
|
7191
7841
|
var util2 = require_util();
|
|
7192
7842
|
var binarySearch = require_binary_search();
|
|
7193
7843
|
var ArraySet = require_array_set().ArraySet;
|
|
@@ -7304,7 +7954,7 @@ var require_node2 = __commonJS({
|
|
|
7304
7954
|
}
|
|
7305
7955
|
return mappings;
|
|
7306
7956
|
};
|
|
7307
|
-
|
|
7957
|
+
exports3.SourceMapConsumer = SourceMapConsumer;
|
|
7308
7958
|
function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
7309
7959
|
var sourceMap = aSourceMap;
|
|
7310
7960
|
if (typeof aSourceMap === "string") {
|
|
@@ -7600,7 +8250,7 @@ var require_node2 = __commonJS({
|
|
|
7600
8250
|
lastColumn: null
|
|
7601
8251
|
};
|
|
7602
8252
|
};
|
|
7603
|
-
|
|
8253
|
+
exports3.BasicSourceMapConsumer = BasicSourceMapConsumer;
|
|
7604
8254
|
function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
7605
8255
|
var sourceMap = aSourceMap;
|
|
7606
8256
|
if (typeof aSourceMap === "string") {
|
|
@@ -7752,9 +8402,9 @@ var require_node2 = __commonJS({
|
|
|
7752
8402
|
quickSort(this.__generatedMappings, util2.compareByGeneratedPositionsDeflated);
|
|
7753
8403
|
quickSort(this.__originalMappings, util2.compareByOriginalPositions);
|
|
7754
8404
|
};
|
|
7755
|
-
|
|
8405
|
+
exports3.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
|
|
7756
8406
|
});
|
|
7757
|
-
var require_source_node = __commonJS2((
|
|
8407
|
+
var require_source_node = __commonJS2((exports3) => {
|
|
7758
8408
|
var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
7759
8409
|
var util2 = require_util();
|
|
7760
8410
|
var REGEX_NEWLINE = /(\r?\n)/;
|
|
@@ -8004,14 +8654,14 @@ var require_node2 = __commonJS({
|
|
|
8004
8654
|
});
|
|
8005
8655
|
return { code: generated.code, map: map2 };
|
|
8006
8656
|
};
|
|
8007
|
-
|
|
8657
|
+
exports3.SourceNode = SourceNode;
|
|
8008
8658
|
});
|
|
8009
|
-
var require_source_map = __commonJS2((
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8659
|
+
var require_source_map = __commonJS2((exports3) => {
|
|
8660
|
+
exports3.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
8661
|
+
exports3.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
|
|
8662
|
+
exports3.SourceNode = require_source_node().SourceNode;
|
|
8013
8663
|
});
|
|
8014
|
-
var require_buffer_from = __commonJS2((
|
|
8664
|
+
var require_buffer_from = __commonJS2((exports3, module22) => {
|
|
8015
8665
|
var toString = Object.prototype.toString;
|
|
8016
8666
|
var isModern = typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
|
|
8017
8667
|
function isArrayBuffer(input) {
|
|
@@ -8056,7 +8706,7 @@ var require_node2 = __commonJS({
|
|
|
8056
8706
|
}
|
|
8057
8707
|
module22.exports = bufferFrom;
|
|
8058
8708
|
});
|
|
8059
|
-
var require_source_map_support = __commonJS2((
|
|
8709
|
+
var require_source_map_support = __commonJS2((exports3, module22) => {
|
|
8060
8710
|
var SourceMapConsumer = require_source_map().SourceMapConsumer;
|
|
8061
8711
|
var path2 = require("path");
|
|
8062
8712
|
var fs3;
|
|
@@ -8430,11 +9080,11 @@ var require_node2 = __commonJS({
|
|
|
8430
9080
|
}
|
|
8431
9081
|
var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
|
|
8432
9082
|
var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
9083
|
+
exports3.wrapCallSite = wrapCallSite;
|
|
9084
|
+
exports3.getErrorSource = getErrorSource;
|
|
9085
|
+
exports3.mapSourcePosition = mapSourcePosition;
|
|
9086
|
+
exports3.retrieveSourceMap = retrieveSourceMap;
|
|
9087
|
+
exports3.install = function(options) {
|
|
8438
9088
|
options = options || {};
|
|
8439
9089
|
if (options.environment) {
|
|
8440
9090
|
environment = options.environment;
|
|
@@ -8488,7 +9138,7 @@ var require_node2 = __commonJS({
|
|
|
8488
9138
|
}
|
|
8489
9139
|
}
|
|
8490
9140
|
};
|
|
8491
|
-
|
|
9141
|
+
exports3.resetRetrieveHandlers = function() {
|
|
8492
9142
|
retrieveFileHandlers.length = 0;
|
|
8493
9143
|
retrieveMapHandlers.length = 0;
|
|
8494
9144
|
retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
|
|
@@ -8497,16 +9147,16 @@ var require_node2 = __commonJS({
|
|
|
8497
9147
|
retrieveFile = handlerExec(retrieveFileHandlers);
|
|
8498
9148
|
};
|
|
8499
9149
|
});
|
|
8500
|
-
var require_node_modules_regexp = __commonJS2((
|
|
9150
|
+
var require_node_modules_regexp = __commonJS2((exports3, module22) => {
|
|
8501
9151
|
"use strict";
|
|
8502
9152
|
module22.exports = /^(?:.*[\\\/])?node_modules(?:[\\\/].*)?$/;
|
|
8503
9153
|
});
|
|
8504
|
-
var require_lib = __commonJS2((
|
|
9154
|
+
var require_lib = __commonJS2((exports3, module22) => {
|
|
8505
9155
|
"use strict";
|
|
8506
|
-
Object.defineProperty(
|
|
9156
|
+
Object.defineProperty(exports3, "__esModule", {
|
|
8507
9157
|
value: true
|
|
8508
9158
|
});
|
|
8509
|
-
|
|
9159
|
+
exports3.addHook = addHook2;
|
|
8510
9160
|
var _module = _interopRequireDefault(require("module"));
|
|
8511
9161
|
var _path = _interopRequireDefault(require("path"));
|
|
8512
9162
|
var _nodeModulesRegexp = _interopRequireDefault(require_node_modules_regexp());
|
|
@@ -8579,12 +9229,12 @@ var require_node2 = __commonJS({
|
|
|
8579
9229
|
};
|
|
8580
9230
|
}
|
|
8581
9231
|
});
|
|
8582
|
-
var require_lib2 = __commonJS2((
|
|
9232
|
+
var require_lib2 = __commonJS2((exports3, module22) => {
|
|
8583
9233
|
"use strict";
|
|
8584
|
-
Object.defineProperty(
|
|
9234
|
+
Object.defineProperty(exports3, "__esModule", {
|
|
8585
9235
|
value: true
|
|
8586
9236
|
});
|
|
8587
|
-
|
|
9237
|
+
exports3.default = void 0;
|
|
8588
9238
|
var _fs = _interopRequireDefault(require("fs"));
|
|
8589
9239
|
var _path = _interopRequireDefault(require("path"));
|
|
8590
9240
|
function _interopRequireDefault(obj) {
|
|
@@ -8592,13 +9242,13 @@ var require_node2 = __commonJS({
|
|
|
8592
9242
|
}
|
|
8593
9243
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8594
9244
|
try {
|
|
8595
|
-
var
|
|
8596
|
-
var value =
|
|
9245
|
+
var info2 = gen[key](arg);
|
|
9246
|
+
var value = info2.value;
|
|
8597
9247
|
} catch (error2) {
|
|
8598
9248
|
reject(error2);
|
|
8599
9249
|
return;
|
|
8600
9250
|
}
|
|
8601
|
-
if (
|
|
9251
|
+
if (info2.done) {
|
|
8602
9252
|
resolve(value);
|
|
8603
9253
|
} else {
|
|
8604
9254
|
Promise.resolve(value).then(_next, _throw);
|
|
@@ -8926,14 +9576,14 @@ var require_node2 = __commonJS({
|
|
|
8926
9576
|
return options;
|
|
8927
9577
|
}
|
|
8928
9578
|
};
|
|
8929
|
-
|
|
9579
|
+
exports3.default = JoyCon2;
|
|
8930
9580
|
module22.exports = JoyCon2;
|
|
8931
9581
|
module22.exports.default = JoyCon2;
|
|
8932
9582
|
});
|
|
8933
|
-
var require_filesystem = __commonJS2((
|
|
9583
|
+
var require_filesystem = __commonJS2((exports3) => {
|
|
8934
9584
|
"use strict";
|
|
8935
|
-
Object.defineProperty(
|
|
8936
|
-
|
|
9585
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
9586
|
+
exports3.removeExtension = exports3.fileExistsAsync = exports3.readJsonFromDiskAsync = exports3.readJsonFromDiskSync = exports3.fileExistsSync = void 0;
|
|
8937
9587
|
var fs3 = require("fs");
|
|
8938
9588
|
function fileExistsSync(path2) {
|
|
8939
9589
|
if (!fs3.existsSync(path2)) {
|
|
@@ -8946,14 +9596,14 @@ var require_node2 = __commonJS({
|
|
|
8946
9596
|
return false;
|
|
8947
9597
|
}
|
|
8948
9598
|
}
|
|
8949
|
-
|
|
9599
|
+
exports3.fileExistsSync = fileExistsSync;
|
|
8950
9600
|
function readJsonFromDiskSync(packageJsonPath) {
|
|
8951
9601
|
if (!fs3.existsSync(packageJsonPath)) {
|
|
8952
9602
|
return void 0;
|
|
8953
9603
|
}
|
|
8954
9604
|
return require(packageJsonPath);
|
|
8955
9605
|
}
|
|
8956
|
-
|
|
9606
|
+
exports3.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
8957
9607
|
function readJsonFromDiskAsync(path2, callback) {
|
|
8958
9608
|
fs3.readFile(path2, "utf8", function(err, result) {
|
|
8959
9609
|
if (err || !result) {
|
|
@@ -8963,7 +9613,7 @@ var require_node2 = __commonJS({
|
|
|
8963
9613
|
return callback(void 0, json);
|
|
8964
9614
|
});
|
|
8965
9615
|
}
|
|
8966
|
-
|
|
9616
|
+
exports3.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
8967
9617
|
function fileExistsAsync(path2, callback2) {
|
|
8968
9618
|
fs3.stat(path2, function(err, stats) {
|
|
8969
9619
|
if (err) {
|
|
@@ -8972,16 +9622,16 @@ var require_node2 = __commonJS({
|
|
|
8972
9622
|
callback2(void 0, stats ? stats.isFile() : false);
|
|
8973
9623
|
});
|
|
8974
9624
|
}
|
|
8975
|
-
|
|
9625
|
+
exports3.fileExistsAsync = fileExistsAsync;
|
|
8976
9626
|
function removeExtension(path2) {
|
|
8977
9627
|
return path2.substring(0, path2.lastIndexOf(".")) || path2;
|
|
8978
9628
|
}
|
|
8979
|
-
|
|
9629
|
+
exports3.removeExtension = removeExtension;
|
|
8980
9630
|
});
|
|
8981
|
-
var require_mapping_entry = __commonJS2((
|
|
9631
|
+
var require_mapping_entry = __commonJS2((exports3) => {
|
|
8982
9632
|
"use strict";
|
|
8983
|
-
Object.defineProperty(
|
|
8984
|
-
|
|
9633
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
9634
|
+
exports3.getAbsoluteMappingEntries = void 0;
|
|
8985
9635
|
var path2 = require("path");
|
|
8986
9636
|
function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
|
|
8987
9637
|
var sortedKeys = sortByLongestPrefix(Object.keys(paths));
|
|
@@ -9003,7 +9653,7 @@ var require_node2 = __commonJS({
|
|
|
9003
9653
|
}
|
|
9004
9654
|
return absolutePaths;
|
|
9005
9655
|
}
|
|
9006
|
-
|
|
9656
|
+
exports3.getAbsoluteMappingEntries = getAbsoluteMappingEntries;
|
|
9007
9657
|
function sortByLongestPrefix(arr) {
|
|
9008
9658
|
return arr.concat().sort(function(a, b) {
|
|
9009
9659
|
return getPrefixLength(b) - getPrefixLength(a);
|
|
@@ -9014,10 +9664,10 @@ var require_node2 = __commonJS({
|
|
|
9014
9664
|
return pattern.substr(0, prefixLength).length;
|
|
9015
9665
|
}
|
|
9016
9666
|
});
|
|
9017
|
-
var require_try_path = __commonJS2((
|
|
9667
|
+
var require_try_path = __commonJS2((exports3) => {
|
|
9018
9668
|
"use strict";
|
|
9019
|
-
Object.defineProperty(
|
|
9020
|
-
|
|
9669
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
9670
|
+
exports3.exhaustiveTypeException = exports3.getStrippedPath = exports3.getPathsToTry = void 0;
|
|
9021
9671
|
var path2 = require("path");
|
|
9022
9672
|
var path_1 = require("path");
|
|
9023
9673
|
var filesystem_1 = require_filesystem();
|
|
@@ -9053,15 +9703,15 @@ var require_node2 = __commonJS({
|
|
|
9053
9703
|
}
|
|
9054
9704
|
return pathsToTry.length === 0 ? void 0 : pathsToTry;
|
|
9055
9705
|
}
|
|
9056
|
-
|
|
9706
|
+
exports3.getPathsToTry = getPathsToTry;
|
|
9057
9707
|
function getStrippedPath(tryPath) {
|
|
9058
9708
|
return tryPath.type === "index" ? (0, path_1.dirname)(tryPath.path) : tryPath.type === "file" ? tryPath.path : tryPath.type === "extension" ? (0, filesystem_1.removeExtension)(tryPath.path) : tryPath.type === "package" ? tryPath.path : exhaustiveTypeException(tryPath.type);
|
|
9059
9709
|
}
|
|
9060
|
-
|
|
9710
|
+
exports3.getStrippedPath = getStrippedPath;
|
|
9061
9711
|
function exhaustiveTypeException(check) {
|
|
9062
9712
|
throw new Error("Unknown type ".concat(check));
|
|
9063
9713
|
}
|
|
9064
|
-
|
|
9714
|
+
exports3.exhaustiveTypeException = exhaustiveTypeException;
|
|
9065
9715
|
function matchStar(pattern, search) {
|
|
9066
9716
|
if (search.length < pattern.length) {
|
|
9067
9717
|
return void 0;
|
|
@@ -9084,10 +9734,10 @@ var require_node2 = __commonJS({
|
|
|
9084
9734
|
return search.substr(star2, search.length - part2.length);
|
|
9085
9735
|
}
|
|
9086
9736
|
});
|
|
9087
|
-
var require_match_path_sync = __commonJS2((
|
|
9737
|
+
var require_match_path_sync = __commonJS2((exports3) => {
|
|
9088
9738
|
"use strict";
|
|
9089
|
-
Object.defineProperty(
|
|
9090
|
-
|
|
9739
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
9740
|
+
exports3.matchFromAbsolutePaths = exports3.createMatchPath = void 0;
|
|
9091
9741
|
var path2 = require("path");
|
|
9092
9742
|
var Filesystem = require_filesystem();
|
|
9093
9743
|
var MappingEntry = require_mapping_entry();
|
|
@@ -9104,7 +9754,7 @@ var require_node2 = __commonJS({
|
|
|
9104
9754
|
return matchFromAbsolutePaths(absolutePaths, requestedModule, readJson, fileExists, extensions, mainFields);
|
|
9105
9755
|
};
|
|
9106
9756
|
}
|
|
9107
|
-
|
|
9757
|
+
exports3.createMatchPath = createMatchPath2;
|
|
9108
9758
|
function matchFromAbsolutePaths(absolutePathMappings, requestedModule, readJson, fileExists, extensions, mainFields) {
|
|
9109
9759
|
if (readJson === void 0) {
|
|
9110
9760
|
readJson = Filesystem.readJsonFromDiskSync;
|
|
@@ -9124,7 +9774,7 @@ var require_node2 = __commonJS({
|
|
|
9124
9774
|
}
|
|
9125
9775
|
return findFirstExistingPath(tryPaths, readJson, fileExists, mainFields);
|
|
9126
9776
|
}
|
|
9127
|
-
|
|
9777
|
+
exports3.matchFromAbsolutePaths = matchFromAbsolutePaths;
|
|
9128
9778
|
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExists) {
|
|
9129
9779
|
for (var index4 = 0; index4 < mainFields.length; index4++) {
|
|
9130
9780
|
var mainFieldSelector = mainFields[index4];
|
|
@@ -9168,10 +9818,10 @@ var require_node2 = __commonJS({
|
|
|
9168
9818
|
return void 0;
|
|
9169
9819
|
}
|
|
9170
9820
|
});
|
|
9171
|
-
var require_match_path_async = __commonJS2((
|
|
9821
|
+
var require_match_path_async = __commonJS2((exports3) => {
|
|
9172
9822
|
"use strict";
|
|
9173
|
-
Object.defineProperty(
|
|
9174
|
-
|
|
9823
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
9824
|
+
exports3.matchFromAbsolutePathsAsync = exports3.createMatchPathAsync = void 0;
|
|
9175
9825
|
var path2 = require("path");
|
|
9176
9826
|
var TryPath = require_try_path();
|
|
9177
9827
|
var MappingEntry = require_mapping_entry();
|
|
@@ -9188,7 +9838,7 @@ var require_node2 = __commonJS({
|
|
|
9188
9838
|
return matchFromAbsolutePathsAsync(absolutePaths, requestedModule, readJson, fileExists, extensions, callback, mainFields);
|
|
9189
9839
|
};
|
|
9190
9840
|
}
|
|
9191
|
-
|
|
9841
|
+
exports3.createMatchPathAsync = createMatchPathAsync;
|
|
9192
9842
|
function matchFromAbsolutePathsAsync(absolutePathMappings, requestedModule, readJson, fileExists, extensions, callback, mainFields) {
|
|
9193
9843
|
if (readJson === void 0) {
|
|
9194
9844
|
readJson = Filesystem.readJsonFromDiskAsync;
|
|
@@ -9208,7 +9858,7 @@ var require_node2 = __commonJS({
|
|
|
9208
9858
|
}
|
|
9209
9859
|
findFirstExistingPath(tryPaths, readJson, fileExists, callback, 0, mainFields);
|
|
9210
9860
|
}
|
|
9211
|
-
|
|
9861
|
+
exports3.matchFromAbsolutePathsAsync = matchFromAbsolutePathsAsync;
|
|
9212
9862
|
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index4) {
|
|
9213
9863
|
if (index4 === void 0) {
|
|
9214
9864
|
index4 = 0;
|
|
@@ -9281,12 +9931,12 @@ var require_node2 = __commonJS({
|
|
|
9281
9931
|
}
|
|
9282
9932
|
}
|
|
9283
9933
|
});
|
|
9284
|
-
var require_unicode = __commonJS2((
|
|
9934
|
+
var require_unicode = __commonJS2((exports3, module22) => {
|
|
9285
9935
|
module22.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
9286
9936
|
module22.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
|
|
9287
9937
|
module22.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
|
|
9288
9938
|
});
|
|
9289
|
-
var require_util2 = __commonJS2((
|
|
9939
|
+
var require_util2 = __commonJS2((exports3, module22) => {
|
|
9290
9940
|
var unicode = require_unicode();
|
|
9291
9941
|
module22.exports = {
|
|
9292
9942
|
isSpaceSeparator(c) {
|
|
@@ -9306,7 +9956,7 @@ var require_node2 = __commonJS({
|
|
|
9306
9956
|
}
|
|
9307
9957
|
};
|
|
9308
9958
|
});
|
|
9309
|
-
var require_parse = __commonJS2((
|
|
9959
|
+
var require_parse = __commonJS2((exports3, module22) => {
|
|
9310
9960
|
var util2 = require_util2();
|
|
9311
9961
|
var source;
|
|
9312
9962
|
var parseState;
|
|
@@ -10149,7 +10799,7 @@ var require_node2 = __commonJS({
|
|
|
10149
10799
|
return err;
|
|
10150
10800
|
}
|
|
10151
10801
|
});
|
|
10152
|
-
var require_stringify = __commonJS2((
|
|
10802
|
+
var require_stringify = __commonJS2((exports3, module22) => {
|
|
10153
10803
|
var util2 = require_util2();
|
|
10154
10804
|
module22.exports = function stringify(value, replacer, space) {
|
|
10155
10805
|
const stack = [];
|
|
@@ -10364,7 +11014,7 @@ var require_node2 = __commonJS({
|
|
|
10364
11014
|
}
|
|
10365
11015
|
};
|
|
10366
11016
|
});
|
|
10367
|
-
var require_lib3 = __commonJS2((
|
|
11017
|
+
var require_lib3 = __commonJS2((exports3, module22) => {
|
|
10368
11018
|
var parse = require_parse();
|
|
10369
11019
|
var stringify = require_stringify();
|
|
10370
11020
|
var JSON5 = {
|
|
@@ -10373,7 +11023,7 @@ var require_node2 = __commonJS({
|
|
|
10373
11023
|
};
|
|
10374
11024
|
module22.exports = JSON5;
|
|
10375
11025
|
});
|
|
10376
|
-
var require_strip_bom = __commonJS2((
|
|
11026
|
+
var require_strip_bom = __commonJS2((exports3, module22) => {
|
|
10377
11027
|
"use strict";
|
|
10378
11028
|
module22.exports = (x) => {
|
|
10379
11029
|
if (typeof x !== "string") {
|
|
@@ -10385,9 +11035,9 @@ var require_node2 = __commonJS({
|
|
|
10385
11035
|
return x;
|
|
10386
11036
|
};
|
|
10387
11037
|
});
|
|
10388
|
-
var require_tsconfig_loader = __commonJS2((
|
|
11038
|
+
var require_tsconfig_loader = __commonJS2((exports3) => {
|
|
10389
11039
|
"use strict";
|
|
10390
|
-
var __assign =
|
|
11040
|
+
var __assign = exports3 && exports3.__assign || function() {
|
|
10391
11041
|
__assign = Object.assign || function(t) {
|
|
10392
11042
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10393
11043
|
s = arguments[i];
|
|
@@ -10399,8 +11049,8 @@ var require_node2 = __commonJS({
|
|
|
10399
11049
|
};
|
|
10400
11050
|
return __assign.apply(this, arguments);
|
|
10401
11051
|
};
|
|
10402
|
-
Object.defineProperty(
|
|
10403
|
-
|
|
11052
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
11053
|
+
exports3.loadTsconfig = exports3.walkForTsConfig = exports3.tsConfigLoader = void 0;
|
|
10404
11054
|
var path2 = require("path");
|
|
10405
11055
|
var fs3 = require("fs");
|
|
10406
11056
|
var JSON5 = require_lib3();
|
|
@@ -10412,7 +11062,7 @@ var require_node2 = __commonJS({
|
|
|
10412
11062
|
var loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL);
|
|
10413
11063
|
return loadResult;
|
|
10414
11064
|
}
|
|
10415
|
-
|
|
11065
|
+
exports3.tsConfigLoader = tsConfigLoader;
|
|
10416
11066
|
function loadSyncDefault(cwd, filename, baseUrl) {
|
|
10417
11067
|
var configPath = resolveConfigPath(cwd, filename);
|
|
10418
11068
|
if (!configPath) {
|
|
@@ -10458,7 +11108,7 @@ var require_node2 = __commonJS({
|
|
|
10458
11108
|
}
|
|
10459
11109
|
return walkForTsConfig(parentDirectory, readdirSync);
|
|
10460
11110
|
}
|
|
10461
|
-
|
|
11111
|
+
exports3.walkForTsConfig = walkForTsConfig;
|
|
10462
11112
|
function loadTsconfig(configFilePath, existsSync, readFileSync) {
|
|
10463
11113
|
if (existsSync === void 0) {
|
|
10464
11114
|
existsSync = fs3.existsSync;
|
|
@@ -10493,7 +11143,7 @@ var require_node2 = __commonJS({
|
|
|
10493
11143
|
}
|
|
10494
11144
|
return config;
|
|
10495
11145
|
}
|
|
10496
|
-
|
|
11146
|
+
exports3.loadTsconfig = loadTsconfig;
|
|
10497
11147
|
function loadTsconfigFromExtends(configFilePath, extendedConfigValue, existsSync, readFileSync) {
|
|
10498
11148
|
var _a;
|
|
10499
11149
|
if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
|
|
@@ -10517,10 +11167,10 @@ var require_node2 = __commonJS({
|
|
|
10517
11167
|
return __assign(__assign(__assign({}, base), config), { compilerOptions: __assign(__assign({}, base.compilerOptions), config.compilerOptions) });
|
|
10518
11168
|
}
|
|
10519
11169
|
});
|
|
10520
|
-
var require_config_loader = __commonJS2((
|
|
11170
|
+
var require_config_loader = __commonJS2((exports3) => {
|
|
10521
11171
|
"use strict";
|
|
10522
|
-
Object.defineProperty(
|
|
10523
|
-
|
|
11172
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
11173
|
+
exports3.configLoader = exports3.loadConfig = void 0;
|
|
10524
11174
|
var TsConfigLoader2 = require_tsconfig_loader();
|
|
10525
11175
|
var path2 = require("path");
|
|
10526
11176
|
function loadConfig2(cwd) {
|
|
@@ -10529,7 +11179,7 @@ var require_node2 = __commonJS({
|
|
|
10529
11179
|
}
|
|
10530
11180
|
return configLoader({ cwd });
|
|
10531
11181
|
}
|
|
10532
|
-
|
|
11182
|
+
exports3.loadConfig = loadConfig2;
|
|
10533
11183
|
function configLoader(_a) {
|
|
10534
11184
|
var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
|
|
10535
11185
|
if (explicitParams) {
|
|
@@ -10565,9 +11215,9 @@ var require_node2 = __commonJS({
|
|
|
10565
11215
|
addMatchAll: loadResult.baseUrl !== void 0
|
|
10566
11216
|
};
|
|
10567
11217
|
}
|
|
10568
|
-
|
|
11218
|
+
exports3.configLoader = configLoader;
|
|
10569
11219
|
});
|
|
10570
|
-
var require_minimist = __commonJS2((
|
|
11220
|
+
var require_minimist = __commonJS2((exports3, module22) => {
|
|
10571
11221
|
"use strict";
|
|
10572
11222
|
function hasKey(obj, keys) {
|
|
10573
11223
|
var o = obj;
|
|
@@ -10785,9 +11435,9 @@ var require_node2 = __commonJS({
|
|
|
10785
11435
|
return argv;
|
|
10786
11436
|
};
|
|
10787
11437
|
});
|
|
10788
|
-
var require_register = __commonJS2((
|
|
11438
|
+
var require_register = __commonJS2((exports3) => {
|
|
10789
11439
|
"use strict";
|
|
10790
|
-
var __spreadArray =
|
|
11440
|
+
var __spreadArray = exports3 && exports3.__spreadArray || function(to, from, pack) {
|
|
10791
11441
|
if (pack || arguments.length === 2)
|
|
10792
11442
|
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
10793
11443
|
if (ar || !(i in from)) {
|
|
@@ -10798,8 +11448,8 @@ var require_node2 = __commonJS({
|
|
|
10798
11448
|
}
|
|
10799
11449
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10800
11450
|
};
|
|
10801
|
-
Object.defineProperty(
|
|
10802
|
-
|
|
11451
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
11452
|
+
exports3.register = void 0;
|
|
10803
11453
|
var match_path_sync_1 = require_match_path_sync();
|
|
10804
11454
|
var config_loader_1 = require_config_loader();
|
|
10805
11455
|
var noOp2 = function() {
|
|
@@ -10887,32 +11537,32 @@ var require_node2 = __commonJS({
|
|
|
10887
11537
|
Module._resolveFilename = originalResolveFilename;
|
|
10888
11538
|
};
|
|
10889
11539
|
}
|
|
10890
|
-
|
|
11540
|
+
exports3.register = register2;
|
|
10891
11541
|
});
|
|
10892
|
-
var require_lib4 = __commonJS2((
|
|
11542
|
+
var require_lib4 = __commonJS2((exports3) => {
|
|
10893
11543
|
"use strict";
|
|
10894
|
-
Object.defineProperty(
|
|
10895
|
-
|
|
11544
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
11545
|
+
exports3.loadConfig = exports3.register = exports3.matchFromAbsolutePathsAsync = exports3.createMatchPathAsync = exports3.matchFromAbsolutePaths = exports3.createMatchPath = void 0;
|
|
10896
11546
|
var match_path_sync_1 = require_match_path_sync();
|
|
10897
|
-
Object.defineProperty(
|
|
11547
|
+
Object.defineProperty(exports3, "createMatchPath", { enumerable: true, get: function() {
|
|
10898
11548
|
return match_path_sync_1.createMatchPath;
|
|
10899
11549
|
} });
|
|
10900
|
-
Object.defineProperty(
|
|
11550
|
+
Object.defineProperty(exports3, "matchFromAbsolutePaths", { enumerable: true, get: function() {
|
|
10901
11551
|
return match_path_sync_1.matchFromAbsolutePaths;
|
|
10902
11552
|
} });
|
|
10903
11553
|
var match_path_async_1 = require_match_path_async();
|
|
10904
|
-
Object.defineProperty(
|
|
11554
|
+
Object.defineProperty(exports3, "createMatchPathAsync", { enumerable: true, get: function() {
|
|
10905
11555
|
return match_path_async_1.createMatchPathAsync;
|
|
10906
11556
|
} });
|
|
10907
|
-
Object.defineProperty(
|
|
11557
|
+
Object.defineProperty(exports3, "matchFromAbsolutePathsAsync", { enumerable: true, get: function() {
|
|
10908
11558
|
return match_path_async_1.matchFromAbsolutePathsAsync;
|
|
10909
11559
|
} });
|
|
10910
11560
|
var register_1 = require_register();
|
|
10911
|
-
Object.defineProperty(
|
|
11561
|
+
Object.defineProperty(exports3, "register", { enumerable: true, get: function() {
|
|
10912
11562
|
return register_1.register;
|
|
10913
11563
|
} });
|
|
10914
11564
|
var config_loader_1 = require_config_loader();
|
|
10915
|
-
Object.defineProperty(
|
|
11565
|
+
Object.defineProperty(exports3, "loadConfig", { enumerable: true, get: function() {
|
|
10916
11566
|
return config_loader_1.loadConfig;
|
|
10917
11567
|
} });
|
|
10918
11568
|
});
|
|
@@ -11178,17 +11828,16 @@ var require_node2 = __commonJS({
|
|
|
11178
11828
|
}
|
|
11179
11829
|
};
|
|
11180
11830
|
}
|
|
11181
|
-
|
|
11831
|
+
exports2.register = register;
|
|
11182
11832
|
}
|
|
11183
11833
|
});
|
|
11184
11834
|
|
|
11185
11835
|
// src/cli/commands/utils.ts
|
|
11186
|
-
var import_hanji2, assertES5, safeRegister;
|
|
11836
|
+
var import_hanji2, assertES5, safeRegister, migrateCliParams, migrateConfig;
|
|
11187
11837
|
var init_utils2 = __esm({
|
|
11188
11838
|
"src/cli/commands/utils.ts"() {
|
|
11189
11839
|
"use strict";
|
|
11190
11840
|
init_serializer();
|
|
11191
|
-
init_source();
|
|
11192
11841
|
init_views();
|
|
11193
11842
|
import_hanji2 = __toESM(require_hanji());
|
|
11194
11843
|
init_global();
|
|
@@ -11196,8 +11845,11 @@ var init_utils2 = __esm({
|
|
|
11196
11845
|
init_pg();
|
|
11197
11846
|
init_sqlite();
|
|
11198
11847
|
init_common();
|
|
11848
|
+
init_schemaValidator();
|
|
11199
11849
|
init_cli();
|
|
11200
11850
|
init_outputs();
|
|
11851
|
+
init_studio();
|
|
11852
|
+
init_lib();
|
|
11201
11853
|
assertES5 = async (unregister) => {
|
|
11202
11854
|
try {
|
|
11203
11855
|
init_es5();
|
|
@@ -11239,6 +11891,17 @@ var init_utils2 = __esm({
|
|
|
11239
11891
|
await assertES5(res.unregister);
|
|
11240
11892
|
return res;
|
|
11241
11893
|
};
|
|
11894
|
+
migrateCliParams = objectType({
|
|
11895
|
+
config: stringType().optional()
|
|
11896
|
+
});
|
|
11897
|
+
migrateConfig = objectType({
|
|
11898
|
+
dialect: dialect3,
|
|
11899
|
+
out: stringType().optional().default("drizzle"),
|
|
11900
|
+
migrations: objectType({
|
|
11901
|
+
table: stringType().optional(),
|
|
11902
|
+
schema: stringType().optional()
|
|
11903
|
+
}).optional()
|
|
11904
|
+
});
|
|
11242
11905
|
}
|
|
11243
11906
|
});
|
|
11244
11907
|
|
|
@@ -11250,11 +11913,11 @@ var init_pgImports = __esm({
|
|
|
11250
11913
|
import_pg_core = require("drizzle-orm/pg-core");
|
|
11251
11914
|
import_drizzle_orm = require("drizzle-orm");
|
|
11252
11915
|
init_utils2();
|
|
11253
|
-
prepareFromExports = (
|
|
11916
|
+
prepareFromExports = (exports2) => {
|
|
11254
11917
|
const tables = [];
|
|
11255
11918
|
const enums = [];
|
|
11256
11919
|
const schemas = [];
|
|
11257
|
-
const i0values = Object.values(
|
|
11920
|
+
const i0values = Object.values(exports2);
|
|
11258
11921
|
i0values.forEach((t) => {
|
|
11259
11922
|
if ((0, import_pg_core.isPgEnum)(t)) {
|
|
11260
11923
|
enums.push(t);
|
|
@@ -11501,7 +12164,7 @@ ${withStyle.errorWarning(
|
|
|
11501
12164
|
);
|
|
11502
12165
|
return {
|
|
11503
12166
|
version: "6",
|
|
11504
|
-
dialect: "
|
|
12167
|
+
dialect: "postgresql",
|
|
11505
12168
|
tables: result,
|
|
11506
12169
|
enums: enumsToReturn,
|
|
11507
12170
|
schemas: schemasObject,
|
|
@@ -11708,7 +12371,7 @@ ${withStyle.errorWarning(
|
|
|
11708
12371
|
const columnName = columnResponse.attname;
|
|
11709
12372
|
const columnAdditionalDT = columnResponse.additional_dt;
|
|
11710
12373
|
const columnDimensions = columnResponse.array_dimensions;
|
|
11711
|
-
const
|
|
12374
|
+
const enumType3 = columnResponse.enum_name;
|
|
11712
12375
|
let columnType = columnResponse.data_type;
|
|
11713
12376
|
const primaryKey = tableConstraints.filter(
|
|
11714
12377
|
(mapRow) => columnName === mapRow.column_name && mapRow.constraint_type === "PRIMARY KEY"
|
|
@@ -11772,8 +12435,8 @@ ${withStyle.errorWarning(
|
|
|
11772
12435
|
columnTypeMapped = trimChar(columnTypeMapped, '"');
|
|
11773
12436
|
columnToReturn[columnName] = {
|
|
11774
12437
|
name: columnName,
|
|
11775
|
-
type: columnAdditionalDT === "USER-DEFINED" ?
|
|
11776
|
-
typeSchema: enumsToReturn[`${tableSchema}.${
|
|
12438
|
+
type: columnAdditionalDT === "USER-DEFINED" ? enumType3 : columnTypeMapped,
|
|
12439
|
+
typeSchema: enumsToReturn[`${tableSchema}.${enumType3}`] !== void 0 ? enumsToReturn[`${tableSchema}.${enumType3}`].schema : void 0,
|
|
11777
12440
|
primaryKey: primaryKey.length === 1 && cprimaryKey.length < 2,
|
|
11778
12441
|
// default: isSerial ? undefined : defaultValue,
|
|
11779
12442
|
notNull: columnResponse.is_nullable === "NO"
|
|
@@ -11856,7 +12519,7 @@ ${withStyle.errorWarning(
|
|
|
11856
12519
|
const schemasObject = Object.fromEntries([...schemas].map((it) => [it, it]));
|
|
11857
12520
|
return {
|
|
11858
12521
|
version: "6",
|
|
11859
|
-
dialect: "
|
|
12522
|
+
dialect: "postgresql",
|
|
11860
12523
|
tables: result,
|
|
11861
12524
|
enums: enumsToReturn,
|
|
11862
12525
|
schemas: schemasObject,
|
|
@@ -11948,7 +12611,7 @@ var init_migrationPreparator = __esm({
|
|
|
11948
12611
|
|
|
11949
12612
|
// node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
|
|
11950
12613
|
var require_balanced_match = __commonJS({
|
|
11951
|
-
"node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(
|
|
12614
|
+
"node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports2, module2) {
|
|
11952
12615
|
"use strict";
|
|
11953
12616
|
module2.exports = balanced;
|
|
11954
12617
|
function balanced(a, b, str) {
|
|
@@ -12008,7 +12671,7 @@ var require_balanced_match = __commonJS({
|
|
|
12008
12671
|
|
|
12009
12672
|
// node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
|
|
12010
12673
|
var require_brace_expansion = __commonJS({
|
|
12011
|
-
"node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(
|
|
12674
|
+
"node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports2, module2) {
|
|
12012
12675
|
var balanced = require_balanced_match();
|
|
12013
12676
|
module2.exports = expandTop;
|
|
12014
12677
|
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
@@ -12157,10 +12820,10 @@ var require_brace_expansion = __commonJS({
|
|
|
12157
12820
|
}
|
|
12158
12821
|
});
|
|
12159
12822
|
|
|
12160
|
-
// node_modules/.pnpm/minimatch@7.4.
|
|
12823
|
+
// node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/brace-expressions.js
|
|
12161
12824
|
var posixClasses, braceEscape, regexpEscape, rangesToString, parseClass;
|
|
12162
12825
|
var init_brace_expressions = __esm({
|
|
12163
|
-
"node_modules/.pnpm/minimatch@7.4.
|
|
12826
|
+
"node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/brace-expressions.js"() {
|
|
12164
12827
|
posixClasses = {
|
|
12165
12828
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
12166
12829
|
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
@@ -12272,30 +12935,30 @@ var init_brace_expressions = __esm({
|
|
|
12272
12935
|
}
|
|
12273
12936
|
});
|
|
12274
12937
|
|
|
12275
|
-
// node_modules/.pnpm/minimatch@7.4.
|
|
12938
|
+
// node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/escape.js
|
|
12276
12939
|
var escape;
|
|
12277
12940
|
var init_escape = __esm({
|
|
12278
|
-
"node_modules/.pnpm/minimatch@7.4.
|
|
12941
|
+
"node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/escape.js"() {
|
|
12279
12942
|
escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
12280
12943
|
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
12281
12944
|
};
|
|
12282
12945
|
}
|
|
12283
12946
|
});
|
|
12284
12947
|
|
|
12285
|
-
// node_modules/.pnpm/minimatch@7.4.
|
|
12948
|
+
// node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/unescape.js
|
|
12286
12949
|
var unescape;
|
|
12287
12950
|
var init_unescape = __esm({
|
|
12288
|
-
"node_modules/.pnpm/minimatch@7.4.
|
|
12951
|
+
"node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/unescape.js"() {
|
|
12289
12952
|
unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
12290
12953
|
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
12291
12954
|
};
|
|
12292
12955
|
}
|
|
12293
12956
|
});
|
|
12294
12957
|
|
|
12295
|
-
// node_modules/.pnpm/minimatch@7.4.
|
|
12958
|
+
// node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/index.js
|
|
12296
12959
|
var import_brace_expansion, minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform, path, sep, GLOBSTAR, plTypes, qmark, star, twoStarDot, twoStarNoDot, charSet, reSpecials, addPatternStartSet, filter, ext, defaults, braceExpand, MAX_PATTERN_LENGTH, assertValidPattern, makeRe, match, globUnescape, globMagic, regExpEscape, Minimatch;
|
|
12297
12960
|
var init_mjs = __esm({
|
|
12298
|
-
"node_modules/.pnpm/minimatch@7.4.
|
|
12961
|
+
"node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/index.js"() {
|
|
12299
12962
|
import_brace_expansion = __toESM(require_brace_expansion(), 1);
|
|
12300
12963
|
init_brace_expressions();
|
|
12301
12964
|
init_escape();
|
|
@@ -15087,7 +15750,7 @@ var init_snapshotsDiffer = __esm({
|
|
|
15087
15750
|
const jsonTableAlternations = alteredTables.map((it) => {
|
|
15088
15751
|
return preparePgAlterColumns(it.name, it.schema, it.altered, json2);
|
|
15089
15752
|
}).flat();
|
|
15090
|
-
const
|
|
15753
|
+
const jsonCreateIndexesFoAlteredTables = alteredTables.map((it) => {
|
|
15091
15754
|
return prepareCreateIndexesJson(
|
|
15092
15755
|
it.name,
|
|
15093
15756
|
it.schema,
|
|
@@ -15116,14 +15779,21 @@ var init_snapshotsDiffer = __esm({
|
|
|
15116
15779
|
},
|
|
15117
15780
|
{}
|
|
15118
15781
|
);
|
|
15119
|
-
|
|
15782
|
+
jsonCreateIndexesFoAlteredTables.push(
|
|
15120
15783
|
...prepareCreateIndexesJson(it.name, it.schema, createdIndexes || {})
|
|
15121
15784
|
);
|
|
15122
15785
|
jsonDropIndexesForAllAlteredTables.push(
|
|
15123
15786
|
...prepareDropIndexesJson(it.name, it.schema, droppedIndexes || {})
|
|
15124
15787
|
);
|
|
15125
15788
|
});
|
|
15126
|
-
const
|
|
15789
|
+
const jsonCreateReferencesForCreatedTables = createdTables.map((it) => {
|
|
15790
|
+
return prepareCreateReferencesJson(
|
|
15791
|
+
it.name,
|
|
15792
|
+
it.schema,
|
|
15793
|
+
it.foreignKeys
|
|
15794
|
+
);
|
|
15795
|
+
}).flat();
|
|
15796
|
+
const jsonReferencesForAlteredTables = alteredTables.map((it) => {
|
|
15127
15797
|
const forAdded = prepareCreateReferencesJson(
|
|
15128
15798
|
it.name,
|
|
15129
15799
|
it.schema,
|
|
@@ -15141,10 +15811,10 @@ var init_snapshotsDiffer = __esm({
|
|
|
15141
15811
|
);
|
|
15142
15812
|
return [...forAdded, ...forAltered, ...alteredFKs];
|
|
15143
15813
|
}).flat();
|
|
15144
|
-
const jsonCreatedReferencesForAlteredTables =
|
|
15814
|
+
const jsonCreatedReferencesForAlteredTables = jsonReferencesForAlteredTables.filter(
|
|
15145
15815
|
(t) => t.type === "create_reference"
|
|
15146
15816
|
);
|
|
15147
|
-
const jsonDroppedReferencesForAlteredTables =
|
|
15817
|
+
const jsonDroppedReferencesForAlteredTables = jsonReferencesForAlteredTables.filter(
|
|
15148
15818
|
(t) => t.type === "delete_reference"
|
|
15149
15819
|
);
|
|
15150
15820
|
const createEnums = createdEnums.map((it) => {
|
|
@@ -15171,7 +15841,7 @@ var init_snapshotsDiffer = __esm({
|
|
|
15171
15841
|
const dropSchemas = prepareDeleteSchemasJson(
|
|
15172
15842
|
deletedSchemas.map((it) => it.name)
|
|
15173
15843
|
);
|
|
15174
|
-
const
|
|
15844
|
+
const createTables = createdTables.map((it) => {
|
|
15175
15845
|
return preparePgCreateTableJson(it, curFull);
|
|
15176
15846
|
});
|
|
15177
15847
|
jsonStatements.push(...createSchemas);
|
|
@@ -15180,7 +15850,7 @@ var init_snapshotsDiffer = __esm({
|
|
|
15180
15850
|
jsonStatements.push(...moveEnums);
|
|
15181
15851
|
jsonStatements.push(...renameEnums);
|
|
15182
15852
|
jsonStatements.push(...jsonAlterEnumsWithAddedValues);
|
|
15183
|
-
jsonStatements.push(...
|
|
15853
|
+
jsonStatements.push(...createTables);
|
|
15184
15854
|
jsonStatements.push(...jsonDropTables);
|
|
15185
15855
|
jsonStatements.push(...jsonSetTableSchemas);
|
|
15186
15856
|
jsonStatements.push(...jsonRenameTables);
|
|
@@ -15191,15 +15861,16 @@ var init_snapshotsDiffer = __esm({
|
|
|
15191
15861
|
jsonStatements.push(...jsonTableAlternations);
|
|
15192
15862
|
jsonStatements.push(...jsonAddedCompositePKs);
|
|
15193
15863
|
jsonStatements.push(...jsonAddColumnsStatemets);
|
|
15864
|
+
jsonStatements.push(...jsonCreateReferencesForCreatedTables);
|
|
15194
15865
|
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
|
15195
|
-
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
|
15196
15866
|
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
|
15867
|
+
jsonStatements.push(...jsonCreateIndexesFoAlteredTables);
|
|
15197
15868
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
|
15198
15869
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
|
15199
15870
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
|
15200
15871
|
jsonStatements.push(...dropEnums);
|
|
15201
15872
|
jsonStatements.push(...dropSchemas);
|
|
15202
|
-
const sqlStatements = fromJson(jsonStatements, "
|
|
15873
|
+
const sqlStatements = fromJson(jsonStatements, "postgresql");
|
|
15203
15874
|
const uniqueSqlStatements = [];
|
|
15204
15875
|
sqlStatements.forEach((ss) => {
|
|
15205
15876
|
if (!uniqueSqlStatements.includes(ss)) {
|
|
@@ -15337,8 +16008,8 @@ var init_snapshotsDiffer = __esm({
|
|
|
15337
16008
|
const jsonDeletedUniqueConstraints = [];
|
|
15338
16009
|
const jsonAlteredUniqueConstraints = [];
|
|
15339
16010
|
const jsonRenameColumnsStatements = columnRenames.map((it) => prepareRenameColumns(it.table, "", it.renames)).flat();
|
|
16011
|
+
const jsonAddColumnsStatemets = columnCreates.map((it) => _prepareAddColumns(it.table, "", it.columns)).flat();
|
|
15340
16012
|
const jsonDropColumnsStatemets = columnDeletes.map((it) => _prepareDropColumns(it.table, "", it.columns)).flat();
|
|
15341
|
-
const jsonAddColumnsStatemets = columnDeletes.map((it) => _prepareAddColumns(it.table, "", it.columns)).flat();
|
|
15342
16013
|
alteredTables.forEach((it) => {
|
|
15343
16014
|
let addedColumns = [];
|
|
15344
16015
|
for (const addedPkName of Object.keys(it.addedCompositePKs)) {
|
|
@@ -15452,6 +16123,13 @@ var init_snapshotsDiffer = __esm({
|
|
|
15452
16123
|
...prepareDropIndexesJson(it.name, it.schema, droppedIndexes || {})
|
|
15453
16124
|
);
|
|
15454
16125
|
});
|
|
16126
|
+
const jsonCreateReferencesForCreatedTables = createdTables.map((it) => {
|
|
16127
|
+
return prepareCreateReferencesJson(
|
|
16128
|
+
it.name,
|
|
16129
|
+
it.schema,
|
|
16130
|
+
it.foreignKeys
|
|
16131
|
+
);
|
|
16132
|
+
}).flat();
|
|
15455
16133
|
const jsonReferencesForAllAlteredTables = alteredTables.map((it) => {
|
|
15456
16134
|
const forAdded = prepareCreateReferencesJson(
|
|
15457
16135
|
it.name,
|
|
@@ -15492,9 +16170,10 @@ var init_snapshotsDiffer = __esm({
|
|
|
15492
16170
|
jsonStatements.push(...jsonAddedUniqueConstraints);
|
|
15493
16171
|
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
|
15494
16172
|
jsonStatements.push(...jsonAddColumnsStatemets);
|
|
16173
|
+
jsonStatements.push(...jsonCreateReferencesForCreatedTables);
|
|
15495
16174
|
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
|
15496
|
-
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
|
15497
16175
|
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
|
16176
|
+
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
|
15498
16177
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
|
15499
16178
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
|
15500
16179
|
jsonStatements.push(...jsonAddedUniqueConstraints);
|
|
@@ -16079,7 +16758,7 @@ var init_sqlgenerator = __esm({
|
|
|
16079
16758
|
};
|
|
16080
16759
|
PgCreateTableConvertor = class extends Convertor {
|
|
16081
16760
|
can(statement, dialect7) {
|
|
16082
|
-
return statement.type === "create_table" && dialect7 === "
|
|
16761
|
+
return statement.type === "create_table" && dialect7 === "postgresql";
|
|
16083
16762
|
}
|
|
16084
16763
|
convert(st) {
|
|
16085
16764
|
const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints } = st;
|
|
@@ -16221,7 +16900,7 @@ var init_sqlgenerator = __esm({
|
|
|
16221
16900
|
};
|
|
16222
16901
|
PgAlterTableAddUniqueConstraintConvertor = class extends Convertor {
|
|
16223
16902
|
can(statement, dialect7) {
|
|
16224
|
-
return statement.type === "create_unique_constraint" && dialect7 === "
|
|
16903
|
+
return statement.type === "create_unique_constraint" && dialect7 === "postgresql";
|
|
16225
16904
|
}
|
|
16226
16905
|
convert(statement) {
|
|
16227
16906
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
|
@@ -16231,7 +16910,7 @@ var init_sqlgenerator = __esm({
|
|
|
16231
16910
|
};
|
|
16232
16911
|
PgAlterTableDropUniqueConstraintConvertor = class extends Convertor {
|
|
16233
16912
|
can(statement, dialect7) {
|
|
16234
|
-
return statement.type === "delete_unique_constraint" && dialect7 === "
|
|
16913
|
+
return statement.type === "delete_unique_constraint" && dialect7 === "postgresql";
|
|
16235
16914
|
}
|
|
16236
16915
|
convert(statement) {
|
|
16237
16916
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
|
@@ -16320,7 +16999,7 @@ var init_sqlgenerator = __esm({
|
|
|
16320
16999
|
};
|
|
16321
17000
|
PgDropTableConvertor = class extends Convertor {
|
|
16322
17001
|
can(statement, dialect7) {
|
|
16323
|
-
return statement.type === "drop_table" && dialect7 === "
|
|
17002
|
+
return statement.type === "drop_table" && dialect7 === "postgresql";
|
|
16324
17003
|
}
|
|
16325
17004
|
convert(statement) {
|
|
16326
17005
|
const { tableName, schema: schema4 } = statement;
|
|
@@ -16348,7 +17027,7 @@ var init_sqlgenerator = __esm({
|
|
|
16348
17027
|
};
|
|
16349
17028
|
PgRenameTableConvertor = class extends Convertor {
|
|
16350
17029
|
can(statement, dialect7) {
|
|
16351
|
-
return statement.type === "rename_table" && dialect7 === "
|
|
17030
|
+
return statement.type === "rename_table" && dialect7 === "postgresql";
|
|
16352
17031
|
}
|
|
16353
17032
|
convert(statement) {
|
|
16354
17033
|
const { tableNameFrom, tableNameTo, toSchema, fromSchema } = statement;
|
|
@@ -16379,7 +17058,7 @@ var init_sqlgenerator = __esm({
|
|
|
16379
17058
|
};
|
|
16380
17059
|
PgAlterTableRenameColumnConvertor = class extends Convertor {
|
|
16381
17060
|
can(statement, dialect7) {
|
|
16382
|
-
return statement.type === "alter_table_rename_column" && dialect7 === "
|
|
17061
|
+
return statement.type === "alter_table_rename_column" && dialect7 === "postgresql";
|
|
16383
17062
|
}
|
|
16384
17063
|
convert(statement) {
|
|
16385
17064
|
const { tableName, oldColumnName, newColumnName, schema: schema4 } = statement;
|
|
@@ -16407,7 +17086,7 @@ var init_sqlgenerator = __esm({
|
|
|
16407
17086
|
};
|
|
16408
17087
|
PgAlterTableDropColumnConvertor = class extends Convertor {
|
|
16409
17088
|
can(statement, dialect7) {
|
|
16410
|
-
return statement.type === "alter_table_drop_column" && dialect7 === "
|
|
17089
|
+
return statement.type === "alter_table_drop_column" && dialect7 === "postgresql";
|
|
16411
17090
|
}
|
|
16412
17091
|
convert(statement) {
|
|
16413
17092
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16435,7 +17114,7 @@ var init_sqlgenerator = __esm({
|
|
|
16435
17114
|
};
|
|
16436
17115
|
PgAlterTableAddColumnConvertor = class extends Convertor {
|
|
16437
17116
|
can(statement, dialect7) {
|
|
16438
|
-
return statement.type === "alter_table_add_column" && dialect7 === "
|
|
17117
|
+
return statement.type === "alter_table_add_column" && dialect7 === "postgresql";
|
|
16439
17118
|
}
|
|
16440
17119
|
convert(statement) {
|
|
16441
17120
|
const { tableName, column: column4, schema: schema4 } = statement;
|
|
@@ -16480,7 +17159,7 @@ var init_sqlgenerator = __esm({
|
|
|
16480
17159
|
};
|
|
16481
17160
|
PgAlterTableAlterColumnSetTypeConvertor = class extends Convertor {
|
|
16482
17161
|
can(statement, dialect7) {
|
|
16483
|
-
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "
|
|
17162
|
+
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "postgresql";
|
|
16484
17163
|
}
|
|
16485
17164
|
convert(statement) {
|
|
16486
17165
|
const { tableName, columnName, newDataType, schema: schema4 } = statement;
|
|
@@ -16505,7 +17184,7 @@ var init_sqlgenerator = __esm({
|
|
|
16505
17184
|
};
|
|
16506
17185
|
PgAlterTableAlterColumnSetDefaultConvertor = class extends Convertor {
|
|
16507
17186
|
can(statement, dialect7) {
|
|
16508
|
-
return statement.type === "alter_table_alter_column_set_default" && dialect7 === "
|
|
17187
|
+
return statement.type === "alter_table_alter_column_set_default" && dialect7 === "postgresql";
|
|
16509
17188
|
}
|
|
16510
17189
|
convert(statement) {
|
|
16511
17190
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16530,7 +17209,7 @@ var init_sqlgenerator = __esm({
|
|
|
16530
17209
|
};
|
|
16531
17210
|
PgAlterTableAlterColumnDropDefaultConvertor = class extends Convertor {
|
|
16532
17211
|
can(statement, dialect7) {
|
|
16533
|
-
return statement.type === "alter_table_alter_column_drop_default" && dialect7 === "
|
|
17212
|
+
return statement.type === "alter_table_alter_column_drop_default" && dialect7 === "postgresql";
|
|
16534
17213
|
}
|
|
16535
17214
|
convert(statement) {
|
|
16536
17215
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16642,7 +17321,7 @@ var init_sqlgenerator = __esm({
|
|
|
16642
17321
|
};
|
|
16643
17322
|
PgAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
|
|
16644
17323
|
can(statement, dialect7) {
|
|
16645
|
-
return statement.type === "create_composite_pk" && dialect7 === "
|
|
17324
|
+
return statement.type === "create_composite_pk" && dialect7 === "postgresql";
|
|
16646
17325
|
}
|
|
16647
17326
|
convert(statement) {
|
|
16648
17327
|
const { name, columns } = PgSquasher.unsquashPK(statement.data);
|
|
@@ -16652,7 +17331,7 @@ var init_sqlgenerator = __esm({
|
|
|
16652
17331
|
};
|
|
16653
17332
|
PgAlterTableDeleteCompositePrimaryKeyConvertor = class extends Convertor {
|
|
16654
17333
|
can(statement, dialect7) {
|
|
16655
|
-
return statement.type === "delete_composite_pk" && dialect7 === "
|
|
17334
|
+
return statement.type === "delete_composite_pk" && dialect7 === "postgresql";
|
|
16656
17335
|
}
|
|
16657
17336
|
convert(statement) {
|
|
16658
17337
|
const { name, columns } = PgSquasher.unsquashPK(statement.data);
|
|
@@ -16662,7 +17341,7 @@ var init_sqlgenerator = __esm({
|
|
|
16662
17341
|
};
|
|
16663
17342
|
PgAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
|
|
16664
17343
|
can(statement, dialect7) {
|
|
16665
|
-
return statement.type === "alter_composite_pk" && dialect7 === "
|
|
17344
|
+
return statement.type === "alter_composite_pk" && dialect7 === "postgresql";
|
|
16666
17345
|
}
|
|
16667
17346
|
convert(statement) {
|
|
16668
17347
|
const { name, columns } = PgSquasher.unsquashPK(statement.old);
|
|
@@ -16785,7 +17464,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16785
17464
|
};
|
|
16786
17465
|
PgAlterTableAlterColumnSetPrimaryKeyConvertor = class extends Convertor {
|
|
16787
17466
|
can(statement, dialect7) {
|
|
16788
|
-
return statement.type === "alter_table_alter_column_set_pk" && dialect7 === "
|
|
17467
|
+
return statement.type === "alter_table_alter_column_set_pk" && dialect7 === "postgresql";
|
|
16789
17468
|
}
|
|
16790
17469
|
convert(statement) {
|
|
16791
17470
|
const { tableName, columnName } = statement;
|
|
@@ -16795,7 +17474,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16795
17474
|
};
|
|
16796
17475
|
PgAlterTableAlterColumnDropPrimaryKeyConvertor = class extends Convertor {
|
|
16797
17476
|
can(statement, dialect7) {
|
|
16798
|
-
return statement.type === "alter_table_alter_column_drop_pk" && dialect7 === "
|
|
17477
|
+
return statement.type === "alter_table_alter_column_drop_pk" && dialect7 === "postgresql";
|
|
16799
17478
|
}
|
|
16800
17479
|
convert(statement) {
|
|
16801
17480
|
const { tableName, columnName, schema: schema4 } = statement;
|
|
@@ -16819,7 +17498,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16819
17498
|
};
|
|
16820
17499
|
PgAlterTableAlterColumnSetNotNullConvertor = class extends Convertor {
|
|
16821
17500
|
can(statement, dialect7) {
|
|
16822
|
-
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "
|
|
17501
|
+
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "postgresql";
|
|
16823
17502
|
}
|
|
16824
17503
|
convert(statement) {
|
|
16825
17504
|
const { tableName, columnName } = statement;
|
|
@@ -16874,7 +17553,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16874
17553
|
};
|
|
16875
17554
|
PgAlterTableAlterColumnDropNotNullConvertor = class extends Convertor {
|
|
16876
17555
|
can(statement, dialect7) {
|
|
16877
|
-
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "
|
|
17556
|
+
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "postgresql";
|
|
16878
17557
|
}
|
|
16879
17558
|
convert(statement) {
|
|
16880
17559
|
const { tableName, columnName } = statement;
|
|
@@ -16899,7 +17578,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16899
17578
|
};
|
|
16900
17579
|
PgCreateForeignKeyConvertor = class extends Convertor {
|
|
16901
17580
|
can(statement, dialect7) {
|
|
16902
|
-
return statement.type === "create_reference" && dialect7 === "
|
|
17581
|
+
return statement.type === "create_reference" && dialect7 === "postgresql";
|
|
16903
17582
|
}
|
|
16904
17583
|
convert(statement) {
|
|
16905
17584
|
const {
|
|
@@ -16919,12 +17598,12 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16919
17598
|
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${tableFrom}"` : `"${tableFrom}"`;
|
|
16920
17599
|
const tableToNameWithSchema = schemaTo ? `"${schemaTo}"."${tableTo}"` : `"${tableTo}"`;
|
|
16921
17600
|
const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}`;
|
|
16922
|
-
let
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
|
|
16926
|
-
|
|
16927
|
-
return
|
|
17601
|
+
let sql = "DO $$ BEGIN\n";
|
|
17602
|
+
sql += " " + alterStatement + ";\n";
|
|
17603
|
+
sql += "EXCEPTION\n";
|
|
17604
|
+
sql += " WHEN duplicate_object THEN null;\n";
|
|
17605
|
+
sql += "END $$;\n";
|
|
17606
|
+
return sql;
|
|
16928
17607
|
}
|
|
16929
17608
|
};
|
|
16930
17609
|
SqliteCreateForeignKeyConvertor = class extends Convertor {
|
|
@@ -16964,13 +17643,13 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16964
17643
|
};
|
|
16965
17644
|
PgAlterForeignKeyConvertor = class extends Convertor {
|
|
16966
17645
|
can(statement, dialect7) {
|
|
16967
|
-
return statement.type === "alter_reference" && dialect7 === "
|
|
17646
|
+
return statement.type === "alter_reference" && dialect7 === "postgresql";
|
|
16968
17647
|
}
|
|
16969
17648
|
convert(statement) {
|
|
16970
17649
|
const newFk = PgSquasher.unsquashFK(statement.data);
|
|
16971
17650
|
const oldFk = PgSquasher.unsquashFK(statement.oldFkey);
|
|
16972
17651
|
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${oldFk.tableFrom}"` : `"${oldFk.tableFrom}"`;
|
|
16973
|
-
let
|
|
17652
|
+
let sql = `ALTER TABLE ${tableNameWithSchema} DROP CONSTRAINT "${oldFk.name}";
|
|
16974
17653
|
`;
|
|
16975
17654
|
const onDeleteStatement = newFk.onDelete ? ` ON DELETE ${newFk.onDelete}` : "";
|
|
16976
17655
|
const onUpdateStatement = newFk.onUpdate ? ` ON UPDATE ${newFk.onUpdate}` : "";
|
|
@@ -16979,12 +17658,12 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
16979
17658
|
const tableFromNameWithSchema = oldFk.schemaTo ? `"${oldFk.schemaTo}"."${oldFk.tableFrom}"` : `"${oldFk.tableFrom}"`;
|
|
16980
17659
|
const tableToNameWithSchema = newFk.schemaTo ? `"${newFk.schemaTo}"."${newFk.tableFrom}"` : `"${newFk.tableFrom}"`;
|
|
16981
17660
|
const alterStatement = `ALTER TABLE ${tableFromNameWithSchema} ADD CONSTRAINT "${newFk.name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}`;
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
return
|
|
17661
|
+
sql += "DO $$ BEGIN\n";
|
|
17662
|
+
sql += " " + alterStatement + ";\n";
|
|
17663
|
+
sql += "EXCEPTION\n";
|
|
17664
|
+
sql += " WHEN duplicate_object THEN null;\n";
|
|
17665
|
+
sql += "END $$;\n";
|
|
17666
|
+
return sql;
|
|
16988
17667
|
}
|
|
16989
17668
|
};
|
|
16990
17669
|
SqliteAlterForeignKeyConvertor = class extends Convertor {
|
|
@@ -17003,7 +17682,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17003
17682
|
};
|
|
17004
17683
|
PgDeleteForeignKeyConvertor = class extends Convertor {
|
|
17005
17684
|
can(statement, dialect7) {
|
|
17006
|
-
return statement.type === "delete_reference" && dialect7 === "
|
|
17685
|
+
return statement.type === "delete_reference" && dialect7 === "postgresql";
|
|
17007
17686
|
}
|
|
17008
17687
|
convert(statement) {
|
|
17009
17688
|
const tableFrom = statement.tableName;
|
|
@@ -17040,7 +17719,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17040
17719
|
};
|
|
17041
17720
|
CreatePgIndexConvertor = class extends Convertor {
|
|
17042
17721
|
can(statement, dialect7) {
|
|
17043
|
-
return statement.type === "create_index" && dialect7 === "
|
|
17722
|
+
return statement.type === "create_index" && dialect7 === "postgresql";
|
|
17044
17723
|
}
|
|
17045
17724
|
convert(statement) {
|
|
17046
17725
|
const { name, columns, isUnique } = PgSquasher.unsquashIdx(statement.data);
|
|
@@ -17079,7 +17758,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17079
17758
|
};
|
|
17080
17759
|
PgDropIndexConvertor = class extends Convertor {
|
|
17081
17760
|
can(statement, dialect7) {
|
|
17082
|
-
return statement.type === "drop_index" && dialect7 === "
|
|
17761
|
+
return statement.type === "drop_index" && dialect7 === "postgresql";
|
|
17083
17762
|
}
|
|
17084
17763
|
convert(statement) {
|
|
17085
17764
|
const { name } = PgSquasher.unsquashIdx(statement.data);
|
|
@@ -17088,7 +17767,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17088
17767
|
};
|
|
17089
17768
|
PgCreateSchemaConvertor = class extends Convertor {
|
|
17090
17769
|
can(statement, dialect7) {
|
|
17091
|
-
return statement.type === "create_schema" && dialect7 === "
|
|
17770
|
+
return statement.type === "create_schema" && dialect7 === "postgresql";
|
|
17092
17771
|
}
|
|
17093
17772
|
convert(statement) {
|
|
17094
17773
|
const { name } = statement;
|
|
@@ -17098,7 +17777,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17098
17777
|
};
|
|
17099
17778
|
PgRenameSchemaConvertor = class extends Convertor {
|
|
17100
17779
|
can(statement, dialect7) {
|
|
17101
|
-
return statement.type === "rename_schema" && dialect7 === "
|
|
17780
|
+
return statement.type === "rename_schema" && dialect7 === "postgresql";
|
|
17102
17781
|
}
|
|
17103
17782
|
convert(statement) {
|
|
17104
17783
|
const { from, to } = statement;
|
|
@@ -17108,7 +17787,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17108
17787
|
};
|
|
17109
17788
|
PgDropSchemaConvertor = class extends Convertor {
|
|
17110
17789
|
can(statement, dialect7) {
|
|
17111
|
-
return statement.type === "drop_schema" && dialect7 === "
|
|
17790
|
+
return statement.type === "drop_schema" && dialect7 === "postgresql";
|
|
17112
17791
|
}
|
|
17113
17792
|
convert(statement) {
|
|
17114
17793
|
const { name } = statement;
|
|
@@ -17118,7 +17797,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17118
17797
|
};
|
|
17119
17798
|
PgAlterTableSetSchemaConvertor = class extends Convertor {
|
|
17120
17799
|
can(statement, dialect7) {
|
|
17121
|
-
return statement.type === "alter_table_set_schema" && dialect7 === "
|
|
17800
|
+
return statement.type === "alter_table_set_schema" && dialect7 === "postgresql";
|
|
17122
17801
|
}
|
|
17123
17802
|
convert(statement) {
|
|
17124
17803
|
const { tableName, schemaFrom, schemaTo } = statement;
|
|
@@ -17128,7 +17807,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17128
17807
|
};
|
|
17129
17808
|
PgAlterTableSetNewSchemaConvertor = class extends Convertor {
|
|
17130
17809
|
can(statement, dialect7) {
|
|
17131
|
-
return statement.type === "alter_table_set_new_schema" && dialect7 === "
|
|
17810
|
+
return statement.type === "alter_table_set_new_schema" && dialect7 === "postgresql";
|
|
17132
17811
|
}
|
|
17133
17812
|
convert(statement) {
|
|
17134
17813
|
const { tableName, to, from } = statement;
|
|
@@ -17139,7 +17818,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
|
17139
17818
|
};
|
|
17140
17819
|
PgAlterTableRemoveFromSchemaConvertor = class extends Convertor {
|
|
17141
17820
|
can(statement, dialect7) {
|
|
17142
|
-
return statement.type === "alter_table_remove_from_schema" && dialect7 === "
|
|
17821
|
+
return statement.type === "alter_table_remove_from_schema" && dialect7 === "postgresql";
|
|
17143
17822
|
}
|
|
17144
17823
|
convert(statement) {
|
|
17145
17824
|
const { tableName, schema: schema4 } = statement;
|
|
@@ -17351,7 +18030,9 @@ function mapSqlToSqliteType(sqlType) {
|
|
|
17351
18030
|
return "text";
|
|
17352
18031
|
} else if (lowered.startsWith("blob")) {
|
|
17353
18032
|
return "blob";
|
|
17354
|
-
} else if (["real", "double", "double precision", "float"].some(
|
|
18033
|
+
} else if (["real", "double", "double precision", "float"].some(
|
|
18034
|
+
(it) => lowered.startsWith(it)
|
|
18035
|
+
)) {
|
|
17355
18036
|
return "real";
|
|
17356
18037
|
} else {
|
|
17357
18038
|
return "numeric";
|
|
@@ -17538,7 +18219,7 @@ The unique constraint ${source_default.underline.blue(
|
|
|
17538
18219
|
`SELECT
|
|
17539
18220
|
m.name as "tableName", p.name as "columnName", p.type as "columnType", p."notnull" as "notNull", p.dflt_value as "defaultValue", p.pk as pk
|
|
17540
18221
|
FROM sqlite_master AS m JOIN pragma_table_info(m.name) AS p
|
|
17541
|
-
WHERE m.type = 'table' and m.tbl_name != 'sqlite_sequence' and m.tbl_name != 'sqlite_stat1' and m.tbl_name != '_litestream_seq' and m.tbl_name != '_litestream_lock' and m.tbl_name != 'libsql_wasm_func_table';
|
|
18222
|
+
WHERE m.type = 'table' and m.tbl_name != 'sqlite_sequence' and m.tbl_name != 'sqlite_stat1' and m.tbl_name != '_litestream_seq' and m.tbl_name != '_litestream_lock' and m.tbl_name != 'libsql_wasm_func_table' and m.tbl_name != '__drizzle_migrations';
|
|
17542
18223
|
`
|
|
17543
18224
|
);
|
|
17544
18225
|
const tablesWithSeq = [];
|
|
@@ -18252,9 +18933,9 @@ var init_sqliteImports = __esm({
|
|
|
18252
18933
|
import_sqlite_core2 = require("drizzle-orm/sqlite-core");
|
|
18253
18934
|
import_drizzle_orm6 = require("drizzle-orm");
|
|
18254
18935
|
init_utils2();
|
|
18255
|
-
prepareFromExports2 = (
|
|
18936
|
+
prepareFromExports2 = (exports2) => {
|
|
18256
18937
|
const tables = [];
|
|
18257
|
-
const i0values = Object.values(
|
|
18938
|
+
const i0values = Object.values(exports2);
|
|
18258
18939
|
i0values.forEach((t) => {
|
|
18259
18940
|
if ((0, import_drizzle_orm6.is)(t, import_sqlite_core2.SQLiteTable)) {
|
|
18260
18941
|
tables.push(t);
|
|
@@ -18290,9 +18971,9 @@ var init_mysqlImports = __esm({
|
|
|
18290
18971
|
import_mysql_core3 = require("drizzle-orm/mysql-core");
|
|
18291
18972
|
import_drizzle_orm7 = require("drizzle-orm");
|
|
18292
18973
|
init_utils2();
|
|
18293
|
-
prepareFromExports3 = (
|
|
18974
|
+
prepareFromExports3 = (exports2) => {
|
|
18294
18975
|
const tables = [];
|
|
18295
|
-
const i0values = Object.values(
|
|
18976
|
+
const i0values = Object.values(exports2);
|
|
18296
18977
|
i0values.forEach((t) => {
|
|
18297
18978
|
if ((0, import_drizzle_orm7.is)(t, import_mysql_core3.MySqlTable)) {
|
|
18298
18979
|
tables.push(t);
|
|
@@ -18919,7 +19600,7 @@ var pgSuggestions = async (db, statements) => {
|
|
|
18919
19600
|
}
|
|
18920
19601
|
}
|
|
18921
19602
|
}
|
|
18922
|
-
const stmnt = fromJson([statement], "
|
|
19603
|
+
const stmnt = fromJson([statement], "postgresql")[0];
|
|
18923
19604
|
if (typeof stmnt !== "undefined") {
|
|
18924
19605
|
if (statement.type === "drop_table") {
|
|
18925
19606
|
statementsToExecute.push(
|
|
@@ -19047,6 +19728,9 @@ String.prototype.squashSpaces = function() {
|
|
|
19047
19728
|
String.prototype.camelCase = function() {
|
|
19048
19729
|
return camelCase(String(this));
|
|
19049
19730
|
};
|
|
19731
|
+
String.prototype.capitalise = function() {
|
|
19732
|
+
return this && this.length > 0 ? `${this[0].toUpperCase()}${this.slice(1)}` : String(this);
|
|
19733
|
+
};
|
|
19050
19734
|
String.prototype.concatIf = function(it, condition) {
|
|
19051
19735
|
return condition ? `${this}${it}` : String(this);
|
|
19052
19736
|
};
|
|
@@ -19357,7 +20041,6 @@ var logSuggestionsAndReturn = async (connection, statements, json1, json2, meta)
|
|
|
19357
20041
|
init_mysqlSerializer();
|
|
19358
20042
|
init_global();
|
|
19359
20043
|
init_migrate();
|
|
19360
|
-
var import_drizzle_orm8 = require("drizzle-orm");
|
|
19361
20044
|
var generateDrizzleJson = (imports, prevId) => {
|
|
19362
20045
|
const prepared = prepareFromExports(imports);
|
|
19363
20046
|
const id = (0, import_crypto.randomUUID)();
|
|
@@ -19392,9 +20075,10 @@ var generateMigration = async (prev, cur) => {
|
|
|
19392
20075
|
};
|
|
19393
20076
|
var pushSchema = async (imports, drizzleInstance) => {
|
|
19394
20077
|
const { applyPgSnapshotsDiff: applyPgSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
|
20078
|
+
const { sql } = await import("drizzle-orm");
|
|
19395
20079
|
const db = {
|
|
19396
20080
|
query: async (query, params) => {
|
|
19397
|
-
const res = await drizzleInstance.execute(
|
|
20081
|
+
const res = await drizzleInstance.execute(sql.raw(query));
|
|
19398
20082
|
return res.rows;
|
|
19399
20083
|
}
|
|
19400
20084
|
};
|
|
@@ -19453,13 +20137,14 @@ var generateSQLiteMigration = async (prev, cur) => {
|
|
|
19453
20137
|
};
|
|
19454
20138
|
var pushSQLiteSchema = async (imports, drizzleInstance) => {
|
|
19455
20139
|
const { applySqliteSnapshotsDiff: applySqliteSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
|
20140
|
+
const { sql } = await import("drizzle-orm");
|
|
19456
20141
|
const db = {
|
|
19457
20142
|
query: async (query, params) => {
|
|
19458
|
-
const res = drizzleInstance.all(
|
|
20143
|
+
const res = drizzleInstance.all(sql.raw(query));
|
|
19459
20144
|
return res;
|
|
19460
20145
|
},
|
|
19461
20146
|
run: async (query) => {
|
|
19462
|
-
return Promise.resolve(drizzleInstance.run(
|
|
20147
|
+
return Promise.resolve(drizzleInstance.run(sql.raw(query))).then(
|
|
19463
20148
|
() => {
|
|
19464
20149
|
}
|
|
19465
20150
|
);
|
|
@@ -19526,9 +20211,10 @@ var pushMySQLSchema = async (imports, drizzleInstance, databaseName) => {
|
|
|
19526
20211
|
const { applyMysqlSnapshotsDiff: applyMysqlSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
|
19527
20212
|
const { logSuggestionsAndReturn: logSuggestionsAndReturn3 } = await Promise.resolve().then(() => (init_mysqlPushUtils(), mysqlPushUtils_exports));
|
|
19528
20213
|
const { mysqlPushIntrospect: mysqlPushIntrospect2 } = await Promise.resolve().then(() => (init_mysqlIntrospect(), mysqlIntrospect_exports));
|
|
20214
|
+
const { sql } = await import("drizzle-orm");
|
|
19529
20215
|
const db = {
|
|
19530
20216
|
query: async (query, params) => {
|
|
19531
|
-
const res = await drizzleInstance.execute(
|
|
20217
|
+
const res = await drizzleInstance.execute(sql.raw(query));
|
|
19532
20218
|
return res[0];
|
|
19533
20219
|
}
|
|
19534
20220
|
};
|