src/resolvable.js
function resolveItem(arg) {
  if (Array.isArray(arg)) {
    return resolveArray(arg);
  } else if (Object.prototype.toString.call(arg) === '[object Function]') {
    //is a function
    return Promise.method(arg)().then(resolveItem);
  } else if (isThenable(arg)) {
    //is a promise
    return arg.then(resolveItem);
  } else if (arg && typeof arg === 'object') {
    //is an object
    if (typeof arg.toString === 'function') {
      var value = arg.toString();
      if (value !== '[object Object]') {
        //with a valid toString
        return Promise.resolve(value);
      }
    }
    return resolveObject(arg);
  } else {
    //Yeah! a value
    return Promise.resolve(arg);
  }
}
function resolveItem(arg) {
  if (Array.isArray(arg)) {
    return resolveArray(arg);
  } else if (Object.prototype.toString.call(arg) === '[object Function]') {
    //is a function
    return Promise.method(arg)().then(resolveItem);
  } else if (isThenable(arg)) {
    //is a promise
    return arg.then(resolveItem);
  } else if (arg && typeof arg === 'object') {
    //is an object
    if (typeof arg.toString === 'function') {
      var value = arg.toString();
      if (value !== '[object Object]') {
        //with a valid toString
        return Promise.resolve(value);
      }
    }
    return resolveObject(arg);
  } else {
    //Yeah! a value
    return Promise.resolve(arg);
  }
}
function resolveItem ( arg ) { if ( Array . isArray ( arg ) ) { return resolveArray ( arg ) ; } else if ( Object . prototype . toString . call ( arg ) === '[object Function]' ) { //is a function return Promise . method ( arg ) ( ) . then ( resolveItem ) ; } else if ( isThenable ( arg ) ) { //is a promise return arg . then ( resolveItem ) ; } else if ( arg && typeof arg === 'object' ) { //is an object if ( typeof arg . toString === 'function' ) { var value = arg . toString ( ) ; if ( value !== '[object Object]' ) { //with a valid toString return Promise . resolve ( value ) ; } } return resolveObject ( arg ) ; } else { //Yeah! a value return Promise . resolve ( arg ) ; } }
Resolves something resolvable

@private
@param {*} arg The argument to resolve
@returns {Promise} The resolved
Resolves something resolvable