( tag: string, schema: Schema.ConstraintDecoder<T, Environment> )
| 117 | }) |
| 118 | |
| 119 | const makeSchemaPrimitive = <T>( |
| 120 | tag: string, |
| 121 | schema: Schema.ConstraintDecoder<T, Environment> |
| 122 | ): Primitive<T> => { |
| 123 | const toCodecStringTree = Schema.toCodecStringTree(schema) |
| 124 | const decode = Schema.decodeUnknownEffect(toCodecStringTree) |
| 125 | return makePrimitive(tag, (value) => Effect.mapError(decode(value), (error) => error.message)) |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Creates a primitive that parses boolean values from string input. |
no test coverage detected