MCPcopy Create free account
hub / github.com/Effect-TS/effect / tag

Method tag

packages/effect/src/Optic.ts:1024–1036  ·  view source on GitHub ↗
(tag: string)

Source from the content-addressed store, hash-verified

1022 return make(compose(this.node, [new CheckNode([SchemaAST.makeFilterByGuard(refinement, annotations)])]))
1023 }
1024 tag(tag: string): any {
1025 const err = Result.fail(new SchemaIssue.InvalidValue({ expected: `${JSON.stringify(tag)} tag` }))
1026 return make(
1027 compose(
1028 this.node,
1029 primitiveNode(
1030 "Prism",
1031 (s) => s._tag === tag ? Result.succeed(s) : err,
1032 identity
1033 )
1034 )
1035 )
1036 }
1037 at(key: PropertyKey, ..._rest: Array<any>): any {
1038 const err = Result.fail(
1039 new SchemaIssue.Pointer([key], new SchemaIssue.MissingKey(undefined))

Callers

nothing calls this directly

Calls 5

primitiveNodeFunction · 0.85
makeFunction · 0.70
composeFunction · 0.70
failMethod · 0.45
succeedMethod · 0.45

Tested by

no test coverage detected