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

Function makeRun

packages/effect/src/ui/Query.ts:3972–3990  ·  view source on GitHub ↗
(decoding: boolean)

Source from the content-addressed store, hash-verified

3970 u[SnapshotMapTypeId].def.name === def.name &&
3971 u[SnapshotMapTypeId].label === label
3972 const makeRun = (decoding: boolean) => (typeParameters: ReadonlyArray<SchemaAST.AST>) => {
3973 const one = snapshotRun(def, label, decoding)(typeParameters)
3974 return (
3975 input: unknown,
3976 ast: SchemaAST.Declaration,
3977 options: SchemaAST.ParseOptions
3978 ): Effect.Effect<SnapshotMapImpl, SchemaIssue.Issue> => {
3979 if (!is(input)) {
3980 return Effect.fail(new SchemaIssue.InvalidType(ast, input, options))
3981 }
3982 return Effect.map(
3983 Effect.forEach(
3984 input[SnapshotMapTypeId].entries.values(),
3985 (snapshot) => one(snapshot, ast, options)
3986 ),
3987 (snapshots) => makeSnapshotMap(def, label, snapshots)
3988 )
3989 }
3990 }
3991 const toCodecJson = (typeParameters: ReadonlyArray<Schema.Top>) => {
3992 const wire = snapshotWire(def, label, typeParameters, log)
3993 return Schema.link<SnapshotMapImpl>()(

Callers 1

snapshotMapSchemaFunction · 0.85

Calls 7

snapshotRunFunction · 0.85
makeSnapshotMapFunction · 0.85
isFunction · 0.70
failMethod · 0.65
forEachMethod · 0.65
oneFunction · 0.50
mapMethod · 0.45

Tested by

no test coverage detected