src/utils/co.js
function promisify(func) {
  return function(...args) {
    return new Promise((resolve, reject) => {
      args.push(wrap(resolve, reject));
      func.call(this, ...args);
    });
  };
}
function promisify(func) {
  return function(...args) {
    return new Promise((resolve, reject) => {
      args.push(wrap(resolve, reject));
      func.call(this, ...args);
    });
  };
}
function promisify ( func ) { return function ( ... args ) { return new Promise ( ( resolve , reject ) => { args . push ( wrap ( resolve , reject ) ) ; func . call ( this , ... args ) ; } ) ; } ; }
Wrap a function that accepts node.js
style callbacks into a function that
returns a promise.
@param {Function} func
@returns {AsyncFunction}
Wrap a function that accepts node . js style callbacks into a function that returns a promise .