MCPcopy
hub / github.com/Effect-TS/effect / validate

Method validate

packages/effect/src/Schema.ts:205–224  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

203 version: 1,
204 vendor: "effect",
205 validate(value) {
206 const scheduler = new scheduler_.SyncScheduler()
207 const fiber = Effect.runFork(
208 Effect.matchEffect(decodeUnknown(value, overrideOptions), {
209 onFailure: makeStandardFailureFromParseIssue,
210 onSuccess: (value) => Effect.succeed({ value })
211 }),
212 { scheduler }
213 )
214 scheduler.flush()
215 const exit = fiber.unsafePoll()
216 if (exit) {
217 return makeStandardResult(exit)
218 }
219 return new Promise((resolve) => {
220 fiber.addObserver((exit) => {
221 resolve(makeStandardResult(exit))
222 })
223 })
224 }
225 }
226 }
227}

Callers 15

Args.test.tsFile · 0.80
Primitive.test.tsFile · 0.80
simplePrimitiveTestSuiteFunction · 0.80
validateInternalFunction · 0.80
parseInternalFunction · 0.80
validatePrimitiveFunction · 0.80
parseUserDefinedArgsFunction · 0.80
handleProcessFunction · 0.80
handleProcessFunction · 0.80
handleProcessIntegerFunction · 0.80
handleProcessFloatFunction · 0.80
getSchemasFunction · 0.80

Calls 6

flushMethod · 0.95
makeStandardResultFunction · 0.85
resolveFunction · 0.85
decodeUnknownFunction · 0.70
unsafePollMethod · 0.65
addObserverMethod · 0.65

Tested by 2

simplePrimitiveTestSuiteFunction · 0.64
validateFunction · 0.64