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

Function makeFilterByGuard

packages/effect/src/SchemaAST.ts:4247–4256  ·  view source on GitHub ↗
(
  is: (value: E) => value is T,
  annotations?: Schema.Annotations.Filter
)

Source from the content-addressed store, hash-verified

4245
4246/** @internal */
4247export function makeFilterByGuard<T extends E, E>(
4248 is: (value: E) => value is T,
4249 annotations?: Schema.Annotations.Filter
4250): Filter<any> {
4251 return new Filter(
4252 (input: E, _ast, options) => is(input) ? undefined : new SchemaIssue.InvalidValue(undefined, input, options),
4253 annotations,
4254 true // after a guard, we always want to abort
4255 )
4256}
4257
4258/** @internal */
4259export function isFinite(annotations?: Schema.Annotations.Filter) {

Callers

nothing calls this directly

Calls 1

isFunction · 0.50

Tested by

no test coverage detected