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

Method safeParse

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

Source from the content-addressed store, hash-verified

29651 throw result.error;
29652 }
29653 safeParse(data, params) {
29654 var _a5;
29655 const ctx = {
29656 common: {
29657 issues: [],
29658 async: (_a5 = params === null || params === void 0 ? void 0 : params.async) !== null && _a5 !== void 0 ? _a5 : false,
29659 contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
29660 },
29661 path: (params === null || params === void 0 ? void 0 : params.path) || [],
29662 schemaErrorMap: this._def.errorMap,
29663 parent: null,
29664 data,
29665 parsedType: (0, util_1.getParsedType)(data)
29666 };
29667 const result = this._parseSync({ data, path: ctx.path, parent: ctx });
29668 return handleResult(ctx, result);
29669 }
29670 async parseAsync(data, params) {
29671 const result = await this.safeParseAsync(data, params);
29672 if (result.success)

Callers 4

parseMethod · 0.80
isOptionalMethod · 0.80
isNullableMethod · 0.80
_parseMethod · 0.80

Calls 2

handleResultFunction · 0.85
_parseSyncMethod · 0.80

Tested by

no test coverage detected