File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ export {
3535} from "./@types" ;
3636
3737export function inferType ( value : unknown ) : JSONValueType {
38- if ( value === null ) {
39- return { name : "null" , value } ;
38+ if ( value == null ) {
39+ return { name : "null" , value : null } ;
4040 }
4141
4242 if ( typeof value === "boolean" ) {
@@ -51,14 +51,6 @@ export function inferType(value: unknown): JSONValueType {
5151 }
5252 }
5353
54- if ( typeof value === "string" ) {
55- return {
56- name : "string" ,
57- value,
58- format : inferFormat ( value ) ,
59- } ;
60- }
61-
6254 if ( typeof value === "object" ) {
6355 if ( Array . isArray ( value ) ) {
6456 return {
@@ -74,5 +66,13 @@ export function inferType(value: unknown): JSONValueType {
7466 } ;
7567 }
7668
69+ if ( typeof value === "string" ) {
70+ return {
71+ name : "string" ,
72+ value,
73+ format : inferFormat ( value ) ,
74+ } ;
75+ }
76+
7777 return { name : "null" , value : null } ;
7878}
You can’t perform that action at this time.
0 commit comments