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

Method partial

out/cli.cjs:31453–31467  ·  view source on GitHub ↗
(mask)

Source from the content-addressed store, hash-verified

31451 return deepPartialify(this);
31452 }
31453 partial(mask) {
31454 const newShape = {};
31455 util_1.util.objectKeys(this.shape).forEach((key) => {
31456 const fieldSchema = this.shape[key];
31457 if (mask && !mask[key]) {
31458 newShape[key] = fieldSchema;
31459 } else {
31460 newShape[key] = fieldSchema.optional();
31461 }
31462 });
31463 return new _ZodObject({
31464 ...this._def,
31465 shape: () => newShape
31466 });
31467 }
31468 required(mask) {
31469 const newShape = {};
31470 util_1.util.objectKeys(this.shape).forEach((key) => {

Callers

nothing calls this directly

Calls 2

optionalMethod · 0.80
forEachMethod · 0.45

Tested by

no test coverage detected