export default function pify < T > ( fn ) { return new Promise ( ( resolve , reject ) => { const handler = ( err , res ) => { if ( err ) { return reject ( err ) ; } return resolve ( res ) ; } ; fn ( handler ) ; } ) ; }