drizzle-kit 0.31.0-e2b296d → 0.31.0-f677fb2
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/api.d.mts +384 -384
- package/api.d.ts +384 -384
- package/api.js +3783 -2880
- package/api.mjs +3786 -2883
- package/bin.cjs +19760 -20541
- package/index.js +3 -3
- package/package.json +3 -1
- package/utils.js +51 -181
- package/utils.mjs +51 -181
package/utils.mjs
CHANGED
@@ -556,7 +556,7 @@ var require_hanji = __commonJS({
|
|
556
556
|
}
|
557
557
|
});
|
558
558
|
|
559
|
-
// ../node_modules/.pnpm/chalk@5.
|
559
|
+
// ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
560
560
|
var ANSI_BACKGROUND_OFFSET = 10;
|
561
561
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
562
562
|
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
@@ -742,7 +742,7 @@ function assembleStyles() {
|
|
742
742
|
var ansiStyles = assembleStyles();
|
743
743
|
var ansi_styles_default = ansiStyles;
|
744
744
|
|
745
|
-
// ../node_modules/.pnpm/chalk@5.
|
745
|
+
// ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
|
746
746
|
import process2 from "node:process";
|
747
747
|
import os from "node:os";
|
748
748
|
import tty from "node:tty";
|
@@ -816,10 +816,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
816
816
|
return 1;
|
817
817
|
}
|
818
818
|
if ("CI" in env) {
|
819
|
-
if (
|
819
|
+
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
820
820
|
return 3;
|
821
821
|
}
|
822
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
822
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
823
823
|
return 1;
|
824
824
|
}
|
825
825
|
return min;
|
@@ -868,7 +868,7 @@ var supportsColor = {
|
|
868
868
|
};
|
869
869
|
var supports_color_default = supportsColor;
|
870
870
|
|
871
|
-
// ../node_modules/.pnpm/chalk@5.
|
871
|
+
// ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
|
872
872
|
function stringReplaceAll(string, substring, replacer) {
|
873
873
|
let index6 = string.indexOf(substring);
|
874
874
|
if (index6 === -1) {
|
@@ -898,7 +898,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index6) {
|
|
898
898
|
return returnValue;
|
899
899
|
}
|
900
900
|
|
901
|
-
// ../node_modules/.pnpm/chalk@5.
|
901
|
+
// ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
|
902
902
|
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
903
903
|
var GENERATOR = Symbol("GENERATOR");
|
904
904
|
var STYLER = Symbol("STYLER");
|
@@ -1063,7 +1063,7 @@ function assertUnreachable(x) {
|
|
1063
1063
|
throw new Error("Didn't expect to get here");
|
1064
1064
|
}
|
1065
1065
|
|
1066
|
-
// ../node_modules/.pnpm/zod@3.
|
1066
|
+
// ../node_modules/.pnpm/zod@3.23.7/node_modules/zod/lib/index.mjs
|
1067
1067
|
var util;
|
1068
1068
|
(function(util2) {
|
1069
1069
|
util2.assertEqual = (val) => val;
|
@@ -1214,9 +1214,6 @@ var ZodIssueCode = util.arrayToEnum([
|
|
1214
1214
|
"not_finite"
|
1215
1215
|
]);
|
1216
1216
|
var ZodError = class _ZodError extends Error {
|
1217
|
-
get errors() {
|
1218
|
-
return this.issues;
|
1219
|
-
}
|
1220
1217
|
constructor(issues) {
|
1221
1218
|
super();
|
1222
1219
|
this.issues = [];
|
@@ -1235,6 +1232,9 @@ var ZodError = class _ZodError extends Error {
|
|
1235
1232
|
this.name = "ZodError";
|
1236
1233
|
this.issues = issues;
|
1237
1234
|
}
|
1235
|
+
get errors() {
|
1236
|
+
return this.issues;
|
1237
|
+
}
|
1238
1238
|
format(_mapper) {
|
1239
1239
|
const mapper = _mapper || function(issue) {
|
1240
1240
|
return issue.message;
|
@@ -1441,11 +1441,8 @@ function addIssueToContext(ctx, issueData) {
|
|
1441
1441
|
path: ctx.path,
|
1442
1442
|
errorMaps: [
|
1443
1443
|
ctx.common.contextualErrorMap,
|
1444
|
-
// contextual error map is first priority
|
1445
1444
|
ctx.schemaErrorMap,
|
1446
|
-
// then schema-bound map if available
|
1447
1445
|
overrideMap,
|
1448
|
-
// then global override map
|
1449
1446
|
overrideMap === errorMap ? void 0 : errorMap
|
1450
1447
|
// then global default map
|
1451
1448
|
].filter((x) => !!x)
|
@@ -1596,6 +1593,34 @@ function processCreateParams(params) {
|
|
1596
1593
|
return { errorMap: customMap, description };
|
1597
1594
|
}
|
1598
1595
|
var ZodType = class {
|
1596
|
+
constructor(def) {
|
1597
|
+
this.spa = this.safeParseAsync;
|
1598
|
+
this._def = def;
|
1599
|
+
this.parse = this.parse.bind(this);
|
1600
|
+
this.safeParse = this.safeParse.bind(this);
|
1601
|
+
this.parseAsync = this.parseAsync.bind(this);
|
1602
|
+
this.safeParseAsync = this.safeParseAsync.bind(this);
|
1603
|
+
this.spa = this.spa.bind(this);
|
1604
|
+
this.refine = this.refine.bind(this);
|
1605
|
+
this.refinement = this.refinement.bind(this);
|
1606
|
+
this.superRefine = this.superRefine.bind(this);
|
1607
|
+
this.optional = this.optional.bind(this);
|
1608
|
+
this.nullable = this.nullable.bind(this);
|
1609
|
+
this.nullish = this.nullish.bind(this);
|
1610
|
+
this.array = this.array.bind(this);
|
1611
|
+
this.promise = this.promise.bind(this);
|
1612
|
+
this.or = this.or.bind(this);
|
1613
|
+
this.and = this.and.bind(this);
|
1614
|
+
this.transform = this.transform.bind(this);
|
1615
|
+
this.brand = this.brand.bind(this);
|
1616
|
+
this.default = this.default.bind(this);
|
1617
|
+
this.catch = this.catch.bind(this);
|
1618
|
+
this.describe = this.describe.bind(this);
|
1619
|
+
this.pipe = this.pipe.bind(this);
|
1620
|
+
this.readonly = this.readonly.bind(this);
|
1621
|
+
this.isNullable = this.isNullable.bind(this);
|
1622
|
+
this.isOptional = this.isOptional.bind(this);
|
1623
|
+
}
|
1599
1624
|
get description() {
|
1600
1625
|
return this._def.description;
|
1601
1626
|
}
|
@@ -1659,43 +1684,6 @@ var ZodType = class {
|
|
1659
1684
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
1660
1685
|
return handleResult(ctx, result);
|
1661
1686
|
}
|
1662
|
-
"~validate"(data) {
|
1663
|
-
var _a, _b;
|
1664
|
-
const ctx = {
|
1665
|
-
common: {
|
1666
|
-
issues: [],
|
1667
|
-
async: !!this["~standard"].async
|
1668
|
-
},
|
1669
|
-
path: [],
|
1670
|
-
schemaErrorMap: this._def.errorMap,
|
1671
|
-
parent: null,
|
1672
|
-
data,
|
1673
|
-
parsedType: getParsedType(data)
|
1674
|
-
};
|
1675
|
-
if (!this["~standard"].async) {
|
1676
|
-
try {
|
1677
|
-
const result = this._parseSync({ data, path: [], parent: ctx });
|
1678
|
-
return isValid(result) ? {
|
1679
|
-
value: result.value
|
1680
|
-
} : {
|
1681
|
-
issues: ctx.common.issues
|
1682
|
-
};
|
1683
|
-
} catch (err) {
|
1684
|
-
if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
|
1685
|
-
this["~standard"].async = true;
|
1686
|
-
}
|
1687
|
-
ctx.common = {
|
1688
|
-
issues: [],
|
1689
|
-
async: true
|
1690
|
-
};
|
1691
|
-
}
|
1692
|
-
}
|
1693
|
-
return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
|
1694
|
-
value: result.value
|
1695
|
-
} : {
|
1696
|
-
issues: ctx.common.issues
|
1697
|
-
});
|
1698
|
-
}
|
1699
1687
|
async parseAsync(data, params) {
|
1700
1688
|
const result = await this.safeParseAsync(data, params);
|
1701
1689
|
if (result.success)
|
@@ -1773,39 +1761,6 @@ var ZodType = class {
|
|
1773
1761
|
superRefine(refinement) {
|
1774
1762
|
return this._refinement(refinement);
|
1775
1763
|
}
|
1776
|
-
constructor(def) {
|
1777
|
-
this.spa = this.safeParseAsync;
|
1778
|
-
this._def = def;
|
1779
|
-
this.parse = this.parse.bind(this);
|
1780
|
-
this.safeParse = this.safeParse.bind(this);
|
1781
|
-
this.parseAsync = this.parseAsync.bind(this);
|
1782
|
-
this.safeParseAsync = this.safeParseAsync.bind(this);
|
1783
|
-
this.spa = this.spa.bind(this);
|
1784
|
-
this.refine = this.refine.bind(this);
|
1785
|
-
this.refinement = this.refinement.bind(this);
|
1786
|
-
this.superRefine = this.superRefine.bind(this);
|
1787
|
-
this.optional = this.optional.bind(this);
|
1788
|
-
this.nullable = this.nullable.bind(this);
|
1789
|
-
this.nullish = this.nullish.bind(this);
|
1790
|
-
this.array = this.array.bind(this);
|
1791
|
-
this.promise = this.promise.bind(this);
|
1792
|
-
this.or = this.or.bind(this);
|
1793
|
-
this.and = this.and.bind(this);
|
1794
|
-
this.transform = this.transform.bind(this);
|
1795
|
-
this.brand = this.brand.bind(this);
|
1796
|
-
this.default = this.default.bind(this);
|
1797
|
-
this.catch = this.catch.bind(this);
|
1798
|
-
this.describe = this.describe.bind(this);
|
1799
|
-
this.pipe = this.pipe.bind(this);
|
1800
|
-
this.readonly = this.readonly.bind(this);
|
1801
|
-
this.isNullable = this.isNullable.bind(this);
|
1802
|
-
this.isOptional = this.isOptional.bind(this);
|
1803
|
-
this["~standard"] = {
|
1804
|
-
version: 1,
|
1805
|
-
vendor: "zod",
|
1806
|
-
validate: (data) => this["~validate"](data)
|
1807
|
-
};
|
1808
|
-
}
|
1809
1764
|
optional() {
|
1810
1765
|
return ZodOptional.create(this, this._def);
|
1811
1766
|
}
|
@@ -1816,7 +1771,7 @@ var ZodType = class {
|
|
1816
1771
|
return this.nullable().optional();
|
1817
1772
|
}
|
1818
1773
|
array() {
|
1819
|
-
return ZodArray.create(this);
|
1774
|
+
return ZodArray.create(this, this._def);
|
1820
1775
|
}
|
1821
1776
|
promise() {
|
1822
1777
|
return ZodPromise.create(this, this._def);
|
@@ -1882,20 +1837,16 @@ var ZodType = class {
|
|
1882
1837
|
};
|
1883
1838
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
1884
1839
|
var cuid2Regex = /^[0-9a-z]+$/;
|
1885
|
-
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}
|
1840
|
+
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
1886
1841
|
var 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;
|
1887
1842
|
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
1888
|
-
var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
1889
1843
|
var 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)?)??$/;
|
1890
1844
|
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
1891
1845
|
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
1892
1846
|
var emojiRegex;
|
1893
1847
|
var 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])$/;
|
1894
|
-
var
|
1895
|
-
var ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
|
1896
|
-
var ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
1848
|
+
var 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})))$/;
|
1897
1849
|
var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
1898
|
-
var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
1899
1850
|
var 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])))`;
|
1900
1851
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
1901
1852
|
function timeRegexSource(args) {
|
@@ -1928,33 +1879,6 @@ function isValidIP(ip, version) {
|
|
1928
1879
|
}
|
1929
1880
|
return false;
|
1930
1881
|
}
|
1931
|
-
function isValidJWT(jwt, alg) {
|
1932
|
-
if (!jwtRegex.test(jwt))
|
1933
|
-
return false;
|
1934
|
-
try {
|
1935
|
-
const [header] = jwt.split(".");
|
1936
|
-
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
1937
|
-
const decoded = JSON.parse(atob(base64));
|
1938
|
-
if (typeof decoded !== "object" || decoded === null)
|
1939
|
-
return false;
|
1940
|
-
if (!decoded.typ || !decoded.alg)
|
1941
|
-
return false;
|
1942
|
-
if (alg && decoded.alg !== alg)
|
1943
|
-
return false;
|
1944
|
-
return true;
|
1945
|
-
} catch (_a) {
|
1946
|
-
return false;
|
1947
|
-
}
|
1948
|
-
}
|
1949
|
-
function isValidCidr(ip, version) {
|
1950
|
-
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
|
1951
|
-
return true;
|
1952
|
-
}
|
1953
|
-
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
|
1954
|
-
return true;
|
1955
|
-
}
|
1956
|
-
return false;
|
1957
|
-
}
|
1958
1882
|
var ZodString = class _ZodString extends ZodType {
|
1959
1883
|
_parse(input) {
|
1960
1884
|
if (this._def.coerce) {
|
@@ -2211,26 +2135,6 @@ var ZodString = class _ZodString extends ZodType {
|
|
2211
2135
|
});
|
2212
2136
|
status.dirty();
|
2213
2137
|
}
|
2214
|
-
} else if (check.kind === "jwt") {
|
2215
|
-
if (!isValidJWT(input.data, check.alg)) {
|
2216
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2217
|
-
addIssueToContext(ctx, {
|
2218
|
-
validation: "jwt",
|
2219
|
-
code: ZodIssueCode.invalid_string,
|
2220
|
-
message: check.message
|
2221
|
-
});
|
2222
|
-
status.dirty();
|
2223
|
-
}
|
2224
|
-
} else if (check.kind === "cidr") {
|
2225
|
-
if (!isValidCidr(input.data, check.version)) {
|
2226
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2227
|
-
addIssueToContext(ctx, {
|
2228
|
-
validation: "cidr",
|
2229
|
-
code: ZodIssueCode.invalid_string,
|
2230
|
-
message: check.message
|
2231
|
-
});
|
2232
|
-
status.dirty();
|
2233
|
-
}
|
2234
2138
|
} else if (check.kind === "base64") {
|
2235
2139
|
if (!base64Regex.test(input.data)) {
|
2236
2140
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -2241,16 +2145,6 @@ var ZodString = class _ZodString extends ZodType {
|
|
2241
2145
|
});
|
2242
2146
|
status.dirty();
|
2243
2147
|
}
|
2244
|
-
} else if (check.kind === "base64url") {
|
2245
|
-
if (!base64urlRegex.test(input.data)) {
|
2246
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2247
|
-
addIssueToContext(ctx, {
|
2248
|
-
validation: "base64url",
|
2249
|
-
code: ZodIssueCode.invalid_string,
|
2250
|
-
message: check.message
|
2251
|
-
});
|
2252
|
-
status.dirty();
|
2253
|
-
}
|
2254
2148
|
} else {
|
2255
2149
|
util.assertNever(check);
|
2256
2150
|
}
|
@@ -2297,21 +2191,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
2297
2191
|
base64(message) {
|
2298
2192
|
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
2299
2193
|
}
|
2300
|
-
base64url(message) {
|
2301
|
-
return this._addCheck({
|
2302
|
-
kind: "base64url",
|
2303
|
-
...errorUtil.errToObj(message)
|
2304
|
-
});
|
2305
|
-
}
|
2306
|
-
jwt(options) {
|
2307
|
-
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
|
2308
|
-
}
|
2309
2194
|
ip(options) {
|
2310
2195
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
2311
2196
|
}
|
2312
|
-
cidr(options) {
|
2313
|
-
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
2314
|
-
}
|
2315
2197
|
datetime(options) {
|
2316
2198
|
var _a, _b;
|
2317
2199
|
if (typeof options === "string") {
|
@@ -2402,7 +2284,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
2402
2284
|
});
|
2403
2285
|
}
|
2404
2286
|
/**
|
2405
|
-
*
|
2287
|
+
* @deprecated Use z.string().min(1) instead.
|
2288
|
+
* @see {@link ZodString.min}
|
2406
2289
|
*/
|
2407
2290
|
nonempty(message) {
|
2408
2291
|
return this.min(1, errorUtil.errToObj(message));
|
@@ -2464,15 +2347,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
2464
2347
|
get isIP() {
|
2465
2348
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
2466
2349
|
}
|
2467
|
-
get isCIDR() {
|
2468
|
-
return !!this._def.checks.find((ch) => ch.kind === "cidr");
|
2469
|
-
}
|
2470
2350
|
get isBase64() {
|
2471
2351
|
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
2472
2352
|
}
|
2473
|
-
get isBase64url() {
|
2474
|
-
return !!this._def.checks.find((ch) => ch.kind === "base64url");
|
2475
|
-
}
|
2476
2353
|
get minLength() {
|
2477
2354
|
let min = null;
|
2478
2355
|
for (const ch of this._def.checks) {
|
@@ -2750,15 +2627,17 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
2750
2627
|
}
|
2751
2628
|
_parse(input) {
|
2752
2629
|
if (this._def.coerce) {
|
2753
|
-
|
2754
|
-
input.data = BigInt(input.data);
|
2755
|
-
} catch (_a) {
|
2756
|
-
return this._getInvalidInput(input);
|
2757
|
-
}
|
2630
|
+
input.data = BigInt(input.data);
|
2758
2631
|
}
|
2759
2632
|
const parsedType = this._getType(input);
|
2760
2633
|
if (parsedType !== ZodParsedType.bigint) {
|
2761
|
-
|
2634
|
+
const ctx2 = this._getOrReturnCtx(input);
|
2635
|
+
addIssueToContext(ctx2, {
|
2636
|
+
code: ZodIssueCode.invalid_type,
|
2637
|
+
expected: ZodParsedType.bigint,
|
2638
|
+
received: ctx2.parsedType
|
2639
|
+
});
|
2640
|
+
return INVALID;
|
2762
2641
|
}
|
2763
2642
|
let ctx = void 0;
|
2764
2643
|
const status = new ParseStatus();
|
@@ -2805,15 +2684,6 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
2805
2684
|
}
|
2806
2685
|
return { status: status.value, value: input.data };
|
2807
2686
|
}
|
2808
|
-
_getInvalidInput(input) {
|
2809
|
-
const ctx = this._getOrReturnCtx(input);
|
2810
|
-
addIssueToContext(ctx, {
|
2811
|
-
code: ZodIssueCode.invalid_type,
|
2812
|
-
expected: ZodParsedType.bigint,
|
2813
|
-
received: ctx.parsedType
|
2814
|
-
});
|
2815
|
-
return INVALID;
|
2816
|
-
}
|
2817
2687
|
gte(value, message) {
|
2818
2688
|
return this.setLimit("min", value, true, errorUtil.toString(message));
|
2819
2689
|
}
|