diff --git a/dist/index.js b/dist/index.js index 614812e..551caef 100644 --- a/dist/index.js +++ b/dist/index.js @@ -57388,7 +57388,7 @@ var import_process = require("process"); var import_fs = require("fs"); var core = __toESM(require_core()); -// node_modules/.pnpm/zod@3.22.2/node_modules/zod/lib/index.mjs +// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs var util; (function(util4) { util4.assertEqual = (val) => val; @@ -58129,10 +58129,11 @@ var ZodType = class { }; var cuidRegex = /^c[^\s-]{8,}$/i; var cuid2Regex = /^[a-z][a-z0-9]*$/; -var ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/; +var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/; 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; -var emailRegex = /^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; -var emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u; +var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; +var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +var emojiRegex; var ipv4Regex = /^(((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}))$/; 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})))$/; var datetimeRegex = (args) => { @@ -58166,27 +58167,6 @@ function isValidIP(ip, version3) { return false; } var ZodString = class _ZodString extends ZodType { - constructor() { - super(...arguments); - this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), { - validation, - code: ZodIssueCode.invalid_string, - ...errorUtil.errToObj(message) - }); - this.nonempty = (message) => this.min(1, errorUtil.errToObj(message)); - this.trim = () => new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "trim" }] - }); - this.toLowerCase = () => new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toLowerCase" }] - }); - this.toUpperCase = () => new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toUpperCase" }] - }); - } _parse(input) { if (this._def.coerce) { input.data = String(input.data); @@ -58271,6 +58251,9 @@ var ZodString = class _ZodString extends ZodType { status.dirty(); } } else if (check.kind === "emoji") { + if (!emojiRegex) { + emojiRegex = new RegExp(_emojiRegex, "u"); + } if (!emojiRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { @@ -58407,6 +58390,13 @@ var ZodString = class _ZodString extends ZodType { } return { status: status.value, value: input.data }; } + _regex(regex, validation, message) { + return this.refinement((data) => regex.test(data), { + validation, + code: ZodIssueCode.invalid_string, + ...errorUtil.errToObj(message) + }); + } _addCheck(check) { return new _ZodString({ ...this._def, @@ -58504,6 +58494,31 @@ var ZodString = class _ZodString extends ZodType { ...errorUtil.errToObj(message) }); } + /** + * @deprecated Use z.string().min(1) instead. + * @see {@link ZodString.min} + */ + nonempty(message) { + return this.min(1, errorUtil.errToObj(message)); + } + trim() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "trim" }] + }); + } + toLowerCase() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toLowerCase" }] + }); + } + toUpperCase() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toUpperCase" }] + }); + } get isDatetime() { return !!this._def.checks.find((ch) => ch.kind === "datetime"); } diff --git a/dist/post.js b/dist/post.js index 5f1dcfc..7da3843 100644 --- a/dist/post.js +++ b/dist/post.js @@ -2255,7 +2255,7 @@ var import_process = require("process"); var import_fs = require("fs"); var core = __toESM(require_core()); -// node_modules/.pnpm/zod@3.22.2/node_modules/zod/lib/index.mjs +// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs var util; (function(util2) { util2.assertEqual = (val) => val; @@ -2996,10 +2996,11 @@ var ZodType = class { }; var cuidRegex = /^c[^\s-]{8,}$/i; var cuid2Regex = /^[a-z][a-z0-9]*$/; -var ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/; +var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/; 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; -var emailRegex = /^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; -var emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u; +var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; +var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +var emojiRegex; var ipv4Regex = /^(((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}))$/; 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})))$/; var datetimeRegex = (args) => { @@ -3033,27 +3034,6 @@ function isValidIP(ip, version2) { return false; } var ZodString = class _ZodString extends ZodType { - constructor() { - super(...arguments); - this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), { - validation, - code: ZodIssueCode.invalid_string, - ...errorUtil.errToObj(message) - }); - this.nonempty = (message) => this.min(1, errorUtil.errToObj(message)); - this.trim = () => new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "trim" }] - }); - this.toLowerCase = () => new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toLowerCase" }] - }); - this.toUpperCase = () => new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toUpperCase" }] - }); - } _parse(input) { if (this._def.coerce) { input.data = String(input.data); @@ -3138,6 +3118,9 @@ var ZodString = class _ZodString extends ZodType { status.dirty(); } } else if (check.kind === "emoji") { + if (!emojiRegex) { + emojiRegex = new RegExp(_emojiRegex, "u"); + } if (!emojiRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { @@ -3274,6 +3257,13 @@ var ZodString = class _ZodString extends ZodType { } return { status: status.value, value: input.data }; } + _regex(regex, validation, message) { + return this.refinement((data) => regex.test(data), { + validation, + code: ZodIssueCode.invalid_string, + ...errorUtil.errToObj(message) + }); + } _addCheck(check) { return new _ZodString({ ...this._def, @@ -3371,6 +3361,31 @@ var ZodString = class _ZodString extends ZodType { ...errorUtil.errToObj(message) }); } + /** + * @deprecated Use z.string().min(1) instead. + * @see {@link ZodString.min} + */ + nonempty(message) { + return this.min(1, errorUtil.errToObj(message)); + } + trim() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "trim" }] + }); + } + toLowerCase() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toLowerCase" }] + }); + } + toUpperCase() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toUpperCase" }] + }); + } get isDatetime() { return !!this._def.checks.find((ch) => ch.kind === "datetime"); } diff --git a/package.json b/package.json index 22320e0..e272c75 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.1", "untildify": "^5.0.0", - "zod": "^3.22.2" + "zod": "^3.22.4" }, "devDependencies": { "@types/node": "^20.8.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ecb2835..f2c41da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ dependencies: specifier: ^5.0.0 version: 5.0.0 zod: - specifier: ^3.22.2 - version: 3.22.2 + specifier: ^3.22.4 + version: 3.22.4 devDependencies: '@types/node': @@ -2852,6 +2852,6 @@ packages: engines: {node: '>=10'} dev: true - /zod@3.22.2: - resolution: {integrity: sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==} + /zod@3.22.4: + resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false