MCPcopy
hub / github.com/colinhacks/zod / finalizeSet

Method finalizeSet

packages/zod/src/v3/types.ts:3734–3742  ·  view source on GitHub ↗
(elements: SyncParseReturnType<any>[])

Source from the content-addressed store, hash-verified

3732 const valueType = this._def.valueType;
3733
3734 function finalizeSet(elements: SyncParseReturnType<any>[]) {
3735 const parsedSet = new Set();
3736 for (const element of elements) {
3737 if (element.status === "aborted") return INVALID;
3738 if (element.status === "dirty") status.dirty();
3739 parsedSet.add(element.value);
3740 }
3741 return { status: status.value, value: parsedSet };
3742 }
3743
3744 const elements = [...(ctx.data as Set<unknown>).values()].map((item, i) =>
3745 valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))

Callers

nothing calls this directly

Calls 2

dirtyMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected