MCPcopy
hub / github.com/di-sukharev/opencommit / safeParseAsync

Method safeParseAsync

out/cli.cjs:29676–29692  ·  view source on GitHub ↗
(data, params)

Source from the content-addressed store, hash-verified

29674 throw result.error;
29675 }
29676 async safeParseAsync(data, params) {
29677 const ctx = {
29678 common: {
29679 issues: [],
29680 contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
29681 async: true
29682 },
29683 path: (params === null || params === void 0 ? void 0 : params.path) || [],
29684 schemaErrorMap: this._def.errorMap,
29685 parent: null,
29686 data,
29687 parsedType: (0, util_1.getParsedType)(data)
29688 };
29689 const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
29690 const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
29691 return handleResult(ctx, result);
29692 }
29693 refine(check, message) {
29694 const getIssueProperties = (val) => {
29695 if (typeof message === "string" || typeof message === "undefined") {

Callers 1

parseAsyncMethod · 0.80

Calls 2

handleResultFunction · 0.85
_parseMethod · 0.45

Tested by

no test coverage detected