( name: string, to: To, fromBytes: (bytes: globalThis.Uint8Array) => Effect.Effect<To["Type"], CryptoError_.CryptoError>, toBytes: ((key: To["Type"]) => Effect.Effect<globalThis.Uint8Array, CryptoError_.CryptoError>) | undefined )
| 14466 | type CryptoKeyOptions = { readonly allowEncode?: boolean | undefined } |
| 14467 | |
| 14468 | const cryptoKeyFromBytes = <To extends Codec<any>>( |
| 14469 | name: string, |
| 14470 | to: To, |
| 14471 | fromBytes: (bytes: globalThis.Uint8Array) => Effect.Effect<To["Type"], CryptoError_.CryptoError>, |
| 14472 | toBytes: ((key: To["Type"]) => Effect.Effect<globalThis.Uint8Array, CryptoError_.CryptoError>) | undefined |
| 14473 | ): decodeTo<To, Uint8Array> => |
| 14474 | Uint8Array.pipe(decodeTo( |
| 14475 | to, |
| 14476 | SchemaTransformation.transformEffect({ |
| 14477 | decode: (bytes, options) => Effect.mapError(fromBytes(bytes), (error) => cryptoIssue(error, bytes, options)), |
| 14478 | encode: (key, options) => |
| 14479 | toBytes === undefined |
| 14480 | ? cryptoForbiddenEncode(name, key, options) |
| 14481 | : Effect.mapError(toBytes(key), (error) => cryptoIssue(error, key, options)) |
| 14482 | }) |
| 14483 | )) |
| 14484 | |
| 14485 | const CryptoJsonWebKeyMember = optionalKey(String) |
| 14486 |
no test coverage detected