type NullableError = Error | null ; export function promisify ( fn ) { return ( ... args ) => { return new Promise ( ( resolve , reject ) => { const nodeCallback = ( err , result ) => { if ( err ) reject ( err ) ; else resolve ( result ) ; } ; fn . apply ( null , [ ... args , nodeCallback ] ) ; } ) ; } ; }