node_modules/await-busboy/result.js
/**
   * Requests the next value, wrapped in a promise.
   * If no more values are available and the Result
   * is closed, a Promise resolved to undefined is returned.
   * Else, the returned promise will resolve or reject
   * when the next value is added.
   *
   * @param {Function} res
   * @param {Function} rej
   * @return {Promise}
   */
Requests the next value, wrapped in a promise.
If no more values are available and the Result
is closed, a Promise resolved to undefined is returned.
Else, the returned promise will resolve or reject
when the next value is added.

@param {Function} res
@param {Function} rej
@return {Promise}
Requests the next value wrapped in a promise . If no more values are available and the Result is closed a Promise resolved to undefined is returned . Else the returned promise will resolve or reject when the next value is added . @param { Function } res @param { Function } rej @return { Promise }
then (res, rej) {
    if (this.hasValues) {
      const val = this._pendingVals.shift()
      const method = val instanceof Error ? 'reject' : 'resolve'
      return Promise[method](val).then(res, rej)
    }
    if (this.isClosed) {
      return CLOSED.then(res, rej)
    }
    const p = new Promise((resolve, reject) => {
      this._pendingPromises.push({ resolve, reject })
    })
    return p.then(res, rej)
  }
then ( res , rej ) { if ( this . hasValues ) { const val = this . _pendingVals . shift ( ) const method = val instanceof Error ? 'reject' : 'resolve' return Promise [ method ] ( val ) . then ( res , rej ) } if ( this . isClosed ) { return CLOSED . then ( res , rej ) } const p = new Promise ( ( resolve , reject ) => { this . _pendingPromises . push ( { resolve , reject } ) } ) return p . then ( res , rej ) }
Requests the next value, wrapped in a promise.
Requests the next value wrapped in a promise .
// no more values will ever be available