UNPKG
assistan-ts
Version:
latest (0.0.15)
0.0.15
0.0.11
0.0.10
0.0.9
0.0.6
0.0.5
0.0.4
0.0.2
0.0.1
A typesafe and code-first library to define and run OpenAI assistants
assistan-ts
/
src
/
lib
/
typebox.ts
12 lines
(9 loc)
•
288 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
{
Kind
,
TSchema
,
Type
}
from
"@sinclair/typebox"
;
const
NULL_TYPES_KINDS
:
string
[] = [
Type
.
Void
()[
Kind
],
Type
.
Undefined
()[
Kind
],
Type
.
Null
()[
Kind
], ];
export
const
isNullType = (
obj
?:
TSchema
):
boolean
=>
{
return
obj ==
null
||
NULL_TYPES_KINDS
.
includes
(obj[
Kind
]); };