UNPKG
types-json
Version:
latest (4.0.1)
4.0.1
4.0.0
3.2.0
3.1.2
3.1.1
3.1.0
3.0.0
2.0.2
2.0.1
2.0.0
1.2.2
1.2.1
1.2.0
1.1.0
1.0.8
1.0.7
1.0.6
Type checking for JSON values
github.com/bconnorwhite/types-json
bconnorwhite/types-json
types-json
/
.auto
/
build
/
utils.js
8 lines
(7 loc)
•
180 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
import
{ validate }
from
"is-zod"
;
export
const
is = validate;
export
function
parse
(
schema
) {
return
(
value
)=>
{
return
is
(schema)(value) ? value :
undefined
; }; }