File tree 1 file changed +10
-10
lines changed
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ export {
35
35
} from "./@types" ;
36
36
37
37
export function inferType ( value : unknown ) : JSONValueType {
38
- if ( value === null ) {
39
- return { name : "null" , value } ;
38
+ if ( value == null ) {
39
+ return { name : "null" , value : null } ;
40
40
}
41
41
42
42
if ( typeof value === "boolean" ) {
@@ -51,14 +51,6 @@ export function inferType(value: unknown): JSONValueType {
51
51
}
52
52
}
53
53
54
- if ( typeof value === "string" ) {
55
- return {
56
- name : "string" ,
57
- value,
58
- format : inferFormat ( value ) ,
59
- } ;
60
- }
61
-
62
54
if ( typeof value === "object" ) {
63
55
if ( Array . isArray ( value ) ) {
64
56
return {
@@ -74,5 +66,13 @@ export function inferType(value: unknown): JSONValueType {
74
66
} ;
75
67
}
76
68
69
+ if ( typeof value === "string" ) {
70
+ return {
71
+ name : "string" ,
72
+ value,
73
+ format : inferFormat ( value ) ,
74
+ } ;
75
+ }
76
+
77
77
return { name : "null" , value : null } ;
78
78
}
You can’t perform that action at this time.
0 commit comments