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

Function makeFilterByGuard

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

Source from the content-addressed store, hash-verified

3225
3226/** @internal */
3227export function makeFilterByGuard<T extends E, E>(
3228 is: (value: E) => value is T,
3229 annotations?: Schema.Annotations.Filter
3230): Filter<any> {
3231 return new Filter(
3232 (input: E, _ast, options) => is(input) ? undefined : new SchemaIssue.InvalidValue(undefined, input, options),
3233 annotations,
3234 true // after a guard, we always want to abort
3235 )
3236}
3237
3238/** @internal */
3239export function isFinite(annotations?: Schema.Annotations.Filter) {

Callers

nothing calls this directly

Calls 1

isFunction · 0.70

Tested by

no test coverage detected