@@ -43,18 +43,6 @@ export const validateConfig = (config: Partial<Config>): Partial<Config> => {
4343 const editorIds : EditorId [ ] = [ 'markup' , 'style' , 'script' ] ;
4444 const zoomLevels : Array < Config [ 'zoom' ] > = [ 1 , 0.5 , 0.25 ] ;
4545
46- const isEditor = ( x : any ) =>
47- is ( x , 'object' ) &&
48- ( is ( x . language , 'string' ) ||
49- is ( x . title , 'string' ) ||
50- is ( x . content , 'string' ) ||
51- is ( x . contentUrl , 'string' ) ||
52- is ( x . hiddenContent , 'string' ) ||
53- is ( x . hiddenContentUrl , 'string' ) ||
54- is ( x . foldedLines , 'array' , 'object' ) ||
55- is ( x . order , 'number' ) ||
56- is ( x . selector , 'string' ) ) ;
57-
5846 const isFoldedLines = ( x : any ) => is ( x , 'object' ) && ( is ( x . from , 'number' ) || is ( x . to , 'number' ) ) ;
5947
6048 const fixSfcLanguage = ( lang : Language , editorId : EditorId ) =>
@@ -150,13 +138,13 @@ export const validateConfig = (config: Partial<Config>): Partial<Config> => {
150138 ...( is ( config . languages , 'array' , 'string' )
151139 ? { languages : removeDuplicates ( config . languages ) }
152140 : { } ) ,
153- ...( isEditor ( config . markup )
141+ ...( is ( config . markup , 'object' )
154142 ? { markup : validateEditorProps ( config . markup as Editor , 'markup' ) }
155143 : { } ) ,
156- ...( isEditor ( config . style )
144+ ...( is ( config . style , 'object' )
157145 ? { style : validateEditorProps ( config . style as Editor , 'style' ) }
158146 : { } ) ,
159- ...( isEditor ( config . script )
147+ ...( is ( config . script , 'object' )
160148 ? { script : validateEditorProps ( config . script as Editor , 'script' ) }
161149 : { } ) ,
162150 ...( is ( config . tools , 'object' )
0 commit comments