(value: unknown)
| 1301 | const parseOptions: SchemaAST.ParseOptions = { errors: "all", ...options?.parseOptions } |
| 1302 | const formatter = SchemaIssue.makeFormatterStandardSchemaV1(options) |
| 1303 | const validate: StandardSchemaV1<S["Encoded"], S["Type"]>["~standard"]["validate"] = (value: unknown) => { |
| 1304 | const scheduler = new Scheduler.MixedScheduler("sync") |
| 1305 | const fiber = Effect.runFork( |
| 1306 | Effect.match(decodeUnknownEffect(value, parseOptions), { |
| 1307 | onFailure: formatter, |
| 1308 | onSuccess: (value): StandardSchemaV1.Result<S["Type"]> => ({ value }) |
| 1309 | }), |
| 1310 | { scheduler } |
| 1311 | ) |
| 1312 | fiber.currentDispatcher?.flush() |
| 1313 | const exit = fiber.pollUnsafe() |
| 1314 | if (exit) { |
| 1315 | return makeStandardResult(exit) |
| 1316 | } |
| 1317 | return new Promise((resolve) => { |
| 1318 | fiber.addObserver((exit) => { |
| 1319 | resolve(makeStandardResult(exit)) |
| 1320 | }) |
| 1321 | }) |
| 1322 | } |
| 1323 | if ("~standard" in self) { |
| 1324 | const out = self as any |
| 1325 | if ("validate" in out["~standard"]) return out |
nothing calls this directly
no test coverage detected