license import fs = require ( 'fs' ) ; /**
 * Synchronously determines whether the given file exists.
 */ function safeStatSync ( fn ) { try { return fs . statSync ( fn ) ; } catch ( _ ) { return undefined ; } } /**
 * Synchronously determines whether the given file exists.
 */ export function existsSync ( fn ) { return safeStatSync ( fn ) !== undefined ; } /**
 * Synchronously determines whether the given file exists.
 */ export function isDirSync ( fn ) { const stats = safeStatSync ( fn ) ; if ( stats === undefined ) { return false ; } return stats . isDirectory ( ) ; }