1- import { Dictionary } from '@stoplight/types' ;
1+ import { Dictionary , Optional } from '@stoplight/types' ;
22import cn from 'classnames' ;
33import { JSONSchema4TypeName } from 'json-schema' ;
44import * as React from 'react' ;
@@ -9,8 +9,8 @@ import { JSONSchema4CombinerName } from '../../types';
99 * TYPE
1010 */
1111export interface IType {
12- type : JSONSchema4TypeName | JSONSchema4CombinerName | 'binary' | ' $ref';
13- subtype ?: JSONSchema4TypeName ;
12+ type : JSONSchema4TypeName | JSONSchema4CombinerName | '$ref' ;
13+ subtype : Optional < JSONSchema4TypeName | JSONSchema4TypeName [ ] > ;
1414 className ?: string ;
1515}
1616
@@ -30,12 +30,12 @@ Type.displayName = 'JsonSchemaViewer.Type';
3030 */
3131interface ITypes {
3232 className ?: string ;
33- type ?: JSONSchema4TypeName | JSONSchema4TypeName [ ] | JSONSchema4CombinerName | '$ref' ;
34- subtype ?: JSONSchema4TypeName ;
33+ type : Optional < JSONSchema4TypeName | JSONSchema4TypeName [ ] | JSONSchema4CombinerName | '$ref' > ;
34+ subtype : Optional < JSONSchema4TypeName | JSONSchema4TypeName [ ] > ;
3535}
3636
3737export const Types : React . FunctionComponent < ITypes > = ( { className, type, subtype, children } ) => {
38- if ( ! type ) return null ;
38+ if ( type === void 0 ) return null ;
3939
4040 if ( ! Array . isArray ( type ) ) {
4141 return < Type className = { className } type = { type } subtype = { subtype } children = { children } /> ;
@@ -75,7 +75,7 @@ export const PropertyTypeColors: Dictionary<string, IType['type']> = {
7575 integer : 'text-red-7 dark:text-red-6' ,
7676 number : 'text-red-7 dark:text-red-6' ,
7777 boolean : 'text-red-4' ,
78- binary : 'text-green-4' ,
78+ // binary: 'text-green-4',
7979 string : 'text-green-7 dark:text-green-5' ,
8080 $ref : 'text-purple-6 dark:text-purple-4' ,
8181} ;
0 commit comments