UNPKG
lean4-code-actions
Version:
latest (1.1.32)
1.1.32
Refactorings and snippets for Lean 4
lean4-code-actions
/
libs
/
generic
/
models
/
OptionBoolMap
/
index.ts
7 lines
(5 loc)
•
274 B
text/typescript
View Raw
1
2
3
4
5
6
7
import
{
boolean
, map,
ZodSchema
}
from
'zod'
import
{
ZodTypeDef
}
from
'zod/lib/types'
export
const
OptionBoolMap
= <
Output
=
unknown
,
Def
extends
ZodTypeDef
=
ZodTypeDef
,
Input
=
Output
>
(
key
:
ZodSchema
<
Output
,
Def
,
Input
>
) =>
{
return
map
(key,
boolean
().
optional
()) }