File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import JSZip from 'jszip' ;
77import { BaseValidator } from './baseValidator' ;
88import { ValidationResult } from './validationTypes' ;
9- import * as fs from 'fs' ;
10- import * as path from 'path' ;
9+ import { getFs , getPath , readBinaryFromInput } from '../utils/io' ;
1110
1211const OBF_FORMAT = 'open-board-0.1' ;
1312const OBF_FORMAT_CURRENT_VERSION = 0.1 ;
@@ -25,9 +24,9 @@ export class ObfValidator extends BaseValidator {
2524 */
2625 static async validateFile ( filePath : string ) : Promise < ValidationResult > {
2726 const validator = new ObfValidator ( ) ;
28- const content = fs . readFileSync ( filePath ) ;
29- const stats = fs . statSync ( filePath ) ;
30- return validator . validate ( content , path . basename ( filePath ) , stats . size ) ;
27+ const content = readBinaryFromInput ( filePath ) ;
28+ const stats = getFs ( ) . statSync ( filePath ) ;
29+ return validator . validate ( content , getPath ( ) . basename ( filePath ) , stats . size ) ;
3130 }
3231
3332 /**
You can’t perform that action at this time.
0 commit comments