File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed
Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change 1- import { SimpleCodeFile } from "./updateCodeFile.ts" ;
2-
3- /** objectがSimpleCodeFile型かどうかを判別する */
4- export function isSimpleCodeFile ( obj : unknown ) : obj is SimpleCodeFile {
5- if ( Array . isArray ( obj ) || ! ( obj instanceof Object ) ) return false ;
6- const code = obj as SimpleCodeFile ;
7- const { filename, content, lang } = code ;
8- return (
9- typeof filename == "string" &&
10- ( typeof content == "string" ||
11- ( Array . isArray ( content ) &&
12- ( content . length == 0 || typeof content [ 0 ] == "string" ) ) ) &&
13- ( typeof lang == "string" || lang === undefined )
14- ) ;
15- }
1+ import { SimpleCodeFile } from "./updateCodeFile.ts" ;
2+
3+ /** objectがSimpleCodeFile型かどうかを判別する */
4+ export function isSimpleCodeFile ( obj : unknown ) : obj is SimpleCodeFile {
5+ if ( Array . isArray ( obj ) || ! ( obj instanceof Object ) ) return false ;
6+ const code = obj as SimpleCodeFile ;
7+ const { filename, content, lang } = code ;
8+ return (
9+ typeof filename == "string" &&
10+ ( typeof content == "string" ||
11+ ( Array . isArray ( content ) &&
12+ ( content . length == 0 || typeof content [ 0 ] == "string" ) ) ) &&
13+ ( typeof lang == "string" || lang === undefined )
14+ ) ;
15+ }
You can’t perform that action at this time.
0 commit comments