(schema: Schema.Schema<A, I, R>, options?: ParseOptions | undefined)
| 284 | * @category schema |
| 285 | */ |
| 286 | export const schemaJson = <A, I, R>(schema: Schema.Schema<A, I, R>, options?: ParseOptions | undefined): { |
| 287 | ( |
| 288 | field: string |
| 289 | ): (self: UrlParams) => Effect.Effect<A, ParseResult.ParseError, R> |
| 290 | ( |
| 291 | self: UrlParams, |
| 292 | field: string |
| 293 | ): Effect.Effect<A, ParseResult.ParseError, R> |
| 294 | } => { |
| 295 | const parse = Schema.decodeUnknown(Schema.parseJson(schema), options) |
| 296 | return dual< |
| 297 | (field: string) => (self: UrlParams) => Effect.Effect<A, ParseResult.ParseError, R>, |
| 298 | (self: UrlParams, field: string) => Effect.Effect<A, ParseResult.ParseError, R> |
| 299 | >(2, (self, field) => parse(Option.getOrElse(getLast(self, field), () => ""))) |
| 300 | } |
| 301 | |
| 302 | /** |
| 303 | * Extract schema from all key-value pairs in the given `UrlParams`. |
nothing calls this directly
no test coverage detected
searching dependent graphs…