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

Function makeGuard

packages/effect/src/SchemaAST.ts:76–78  ·  view source on GitHub ↗
(tag: T)

Source from the content-addressed store, hash-verified

74 | Suspend
75
76function makeGuard<T extends AST["_tag"]>(tag: T) {
77 return (ast: AST): ast is Extract<AST, { _tag: T }> => ast._tag === tag
78}
79
80/**
81 * Returns `true` if the value is an {@link AST} node (any variant).

Callers 1

SchemaAST.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected