UEA-PRODEM
This commit is contained in:
+7
-7
@@ -28,7 +28,7 @@ const core = __importStar(require("./core.cjs"));
|
||||
const errors = __importStar(require("./errors.cjs"));
|
||||
const util = __importStar(require("./util.cjs"));
|
||||
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
||||
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
||||
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
||||
const result = schema._zod.run({ value, issues: [] }, ctx);
|
||||
if (result instanceof Promise) {
|
||||
throw new core.$ZodAsyncError();
|
||||
@@ -43,7 +43,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
||||
exports._parse = _parse;
|
||||
exports.parse = (0, exports._parse)(errors.$ZodRealError);
|
||||
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
||||
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
||||
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
||||
let result = schema._zod.run({ value, issues: [] }, ctx);
|
||||
if (result instanceof Promise)
|
||||
result = await result;
|
||||
@@ -72,7 +72,7 @@ const _safeParse = (_Err) => (schema, value, _ctx) => {
|
||||
exports._safeParse = _safeParse;
|
||||
exports.safeParse = (0, exports._safeParse)(errors.$ZodRealError);
|
||||
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
||||
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
||||
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
||||
let result = schema._zod.run({ value, issues: [] }, ctx);
|
||||
if (result instanceof Promise)
|
||||
result = await result;
|
||||
@@ -86,7 +86,7 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
||||
exports._safeParseAsync = _safeParseAsync;
|
||||
exports.safeParseAsync = (0, exports._safeParseAsync)(errors.$ZodRealError);
|
||||
const _encode = (_Err) => (schema, value, _ctx) => {
|
||||
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
||||
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
||||
return (0, exports._parse)(_Err)(schema, value, ctx);
|
||||
};
|
||||
exports._encode = _encode;
|
||||
@@ -97,7 +97,7 @@ const _decode = (_Err) => (schema, value, _ctx) => {
|
||||
exports._decode = _decode;
|
||||
exports.decode = (0, exports._decode)(errors.$ZodRealError);
|
||||
const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
||||
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
||||
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
||||
return (0, exports._parseAsync)(_Err)(schema, value, ctx);
|
||||
};
|
||||
exports._encodeAsync = _encodeAsync;
|
||||
@@ -108,7 +108,7 @@ const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
|
||||
exports._decodeAsync = _decodeAsync;
|
||||
exports.decodeAsync = (0, exports._decodeAsync)(errors.$ZodRealError);
|
||||
const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
||||
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
||||
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
||||
return (0, exports._safeParse)(_Err)(schema, value, ctx);
|
||||
};
|
||||
exports._safeEncode = _safeEncode;
|
||||
@@ -119,7 +119,7 @@ const _safeDecode = (_Err) => (schema, value, _ctx) => {
|
||||
exports._safeDecode = _safeDecode;
|
||||
exports.safeDecode = (0, exports._safeDecode)(errors.$ZodRealError);
|
||||
const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
||||
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
||||
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
||||
return (0, exports._safeParseAsync)(_Err)(schema, value, ctx);
|
||||
};
|
||||
exports._safeEncodeAsync = _safeEncodeAsync;
|
||||
|
||||
Reference in New Issue
Block a user