Resolve options object
@param {Accumulator} accumulator
@param {Function} resolveReducer
@return {Promise<Accumulator>}
778264
function resolveOptions (accumulator, resolveReducer) {
  const url = resolveUrl(accumulator)
  const specOptions = accumulator.reducer.spec.options
  return resolveReducer(accumulator, specOptions).then(acc => {
    const options = getRequestOptions(url, acc.value)
    return utils.assign(accumulator, { options })
  })
}
899010
function resolve_object_value(
	nextql,
	value,
	valueModel,
	valueQuery,
	info,
	context
) {
	if (value == undefined) {
		set(info.result, info.path, null);
		return Promise.resolve();
	}

	if (isPrimitive(value)) {
		return Promise.reject(
			new NextQLError("Cannot query scalar as " + valueModel.name, info)
		);
	}

	return Promise.all(
		Object.keys(valueQuery).map(path => {
			if (path == "$params") return;
			const fieldName = path.split(nextql.aliasSeparator, 1)[0];

			//Conditional query?
			if (fieldName[0] === "?") {
				return execute_conditional(
					nextql,
					value,
					valueModel,
					fieldName,
					valueQuery[path],
					info,
					context
				);
			}

			const newInfo = info_append_path(info, path);
			return valueModel
				.get(
					value,
					fieldName,
					valueQuery[path].$params,
					context,
					newInfo
				)
				.then(fieldValue => {
					let fieldDef;
					if (valueModel.computed[fieldName]) {
						fieldDef = valueModel.fields[fieldName] || 1;
					} else {
						fieldDef = valueModel.fields[fieldName];
					}

					return resolve_value(
						nextql,
						fieldValue,
						fieldDef,
						valueQuery[path],
						newInfo,
						context
					);
				});
		})
	);
}
1050613
function AssimilateTask(then, thenable, resolver) {
			this._then = then;
			this.thenable = thenable;
			this.resolver = resolver;
		}
337785
function(executor) {
            /*  optionally support non-constructor/plain-function call  */
            if (!(this instanceof Promise)) return new Promise(executor);
            /*  initialize object  */
            this.id = "Thenable/1.0.7";
            this.state = STATE_PENDING;
            /*  initial state  */
            this.fulfillValue = undefined;
            /*  initial value  */
            /*  [Promises/A+ 1.3, 2.1.2.2]  */
            this.rejectReason = undefined;
            /*  initial reason */
            /*  [Promises/A+ 1.5, 2.1.3.2]  */
            this.onFulfilled = [];
            /*  initial handlers  */
            this.onRejected = [];
            /*  initial handlers  */
            /*  support optional executor function  */
            if (typeof executor === "function") executor.call(this, this.fulfill.bind(this), this.reject.bind(this));
        }
452885
function resolve (specs, opts) {
  const err = validate(specs)
  if (err) {
    return Promise.reject(err)
  }
  const options = opts || {}
  const dir = options.dir || '.'
  const dest = options.dest || 'public'
  return Promise.all(normalize(specs))
    .map((spec) => {
      return Promise.resolve(globby(spec.files, { cwd: dir, nodir: true }))
        .map(filename => createFileUsingSpec(filename, spec, dest))
    }).then(flatten)
}
54668
async function parallel(resolvers, limit=-1){
    // set default limit
    if (limit < 1){
        limit = 1000;
    }

    // buffer
    const results = [];

    // calculate chunk size
    // limit step size to input array size
    const chunkSize = Math.min(limit, resolvers.length);

    // process resolvers in chunks
    for (let i=0;i<resolvers.length;i=i+chunkSize){

        // extract current chunk
        const chunk = resolvers.slice(i, Math.min(i+chunkSize, resolvers.length));

        // resolve current chunk
        const intermediateResults = await Promise.all(chunk.map((r) => r.resolve()));

        // push results into buffer
        results.push(...intermediateResults);
    }

    // return results
    return results;
}
954264
function resolveSelectorHelper(selector, opts, resultArr) {
  if (selector !== null && typeof selector === 'object') {
    if (typeof selector._resolveSelectorHelper === 'function') {
      selector._resolveSelectorHelper(opts, resultArr);
      return;
    }
    if (Array.isArray(selector)) {
      for (var i = 0; i < selector.length; i++) {
        resolveSelectorHelper(selector[i], opts, resultArr);
      }
      return;
    }
  }

  // Handle scalar case
  var intInds;
  switch (opts.resolveMode) {
    case RESOLVE_MODE.INT:
      resultArr.push(resolveIntIdx(selector, opts.maxLen));
      break;
    case RESOLVE_MODE.COL:
      if (isNumber(selector)) {
        resultArr.push(resolveIntIdx(selector, opts.maxLen));
      } else if (isString(selector) || selector === null) {
        intInds = opts.index.lookupKey([selector]);
        processLookupResults(intInds, selector, opts, resultArr);
      } else {
        throw new Error('expected integer or string selector but got: ' +
          selector);
      }
      break;
    case RESOLVE_MODE.KEY:
      if (opts.index.arity === 1) {
        var expectedDtype = opts.index.initVectors[0].dtype;
        validateScalarIsDtype(selector, expectedDtype);
        intInds = opts.index.lookupKey([selector]);
        processLookupResults(intInds, selector, opts, resultArr);
      } else {
        // TODO
        throw new Error('unimplemented case (TODO)');
      }
      break;
    default:
      throw new Error('Unrecognized RESOLVE_MODE: ' + opts.resolveMode);
  }
}
397624
function resolvePromise(promise, state, value) {
        var onceWrapper = once();
        if (promise === value) {
            throw new TypeError(TYPE_ERROR);
        }
        if (promise[symbolState] === UNRESOLVED) {
            // should only get value.then once based on promise spec.
            var then = null;
            try {
                if (typeof value === 'object' || typeof value === 'function') {
                    then = value && value.then;
                }
            }
            catch (err) {
                onceWrapper(function () {
                    resolvePromise(promise, false, err);
                })();
                return promise;
            }
            // if (value instanceof ZoneAwarePromise) {
            if (state !== REJECTED && value instanceof ZoneAwarePromise &&
                value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) &&
                value[symbolState] !== UNRESOLVED) {
                clearRejectedNoCatch(value);
                resolvePromise(promise, value[symbolState], value[symbolValue]);
            }
            else if (state !== REJECTED && typeof then === 'function') {
                try {
                    then.call(value, onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false)));
                }
                catch (err) {
                    onceWrapper(function () {
                        resolvePromise(promise, false, err);
                    })();
                }
            }
            else {
                promise[symbolState] = state;
                var queue = promise[symbolValue];
                promise[symbolValue] = value;
                if (promise[symbolFinally] === symbolFinally) {
                    // the promise is generated by Promise.prototype.finally
                    if (state === RESOLVED) {
                        // the state is resolved, should ignore the value
                        // and use parent promise value
                        promise[symbolState] = promise[symbolParentPromiseState];
                        promise[symbolValue] = promise[symbolParentPromiseValue];
                    }
                }
                // record task information in value when error occurs, so we can
                // do some additional work such as render longStackTrace
                if (state === REJECTED && value instanceof Error) {
                    // check if longStackTraceZone is here
                    var trace = Zone.currentTask && Zone.currentTask.data &&
                        Zone.currentTask.data[creationTrace];
                    if (trace) {
                        // only keep the long stack trace into error when in longStackTraceZone
                        ObjectDefineProperty(value, CURRENT_TASK_TRACE_SYMBOL, { configurable: true, enumerable: false, writable: true, value: trace });
                    }
                }
                for (var i = 0; i < queue.length;) {
                    scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);
                }
                if (queue.length == 0 && state == REJECTED) {
                    promise[symbolState] = REJECTED_NO_CATCH;
                    try {
                        // try to print more readable error log
                        throw new Error('Uncaught (in promise): ' + readableObjectToString(value) +
                            (value && value.stack ? '\n' + value.stack : ''));
                    }
                    catch (err) {
                        var error_1 = err;
                        error_1.rejection = value;
                        error_1.promise = promise;
                        error_1.zone = Zone.current;
                        error_1.task = Zone.currentTask;
                        _uncaughtPromiseErrors.push(error_1);
                        api.scheduleMicroTask(); // to make sure that it is running
                    }
                }
            }
        }
        // Resolving an already resolved promise is a noop.
        return promise;
    }
117403
function Resolver(readerType) {
  // Add all fields here so that all resolvers share the same hidden class.
  this._readerType = readerType;
  this._read = null;
  this.itemsType = null;
  this.size = 0;
  this.symbols = null;
  this.valuesType = null;
}
596452
function createPromise(resolver) {
        return {
            'then': function (onFulfilled, onRejected) {
                return then(resolver, onFulfilled, onRejected);
            },

            'catch': function (onRejected) {
                return then(resolver, null, onRejected);
            }
        };
    }
870316
function resolve() {
    var promises = [];
    var args = flatten(arguments);
    for (var i = 0; i < args.length; i ++) {
      promises.push(Esquire.resolve(args[i], true, true));
    }

    /* Await for resolution of dependencies */
    return Promise.all(promises).then(function(result) {
      var modules = {};
      for (var i = 0; i < result.length; i ++) {
        var resolved = result[i];
        for (var name in resolved) {
          var module = resolved[name];
          if (module.$$dynamic) continue;
          modules[name] = resolved[name];
        }
      }
      return modules;
    });
  }
1314991
function _makeReducer (step) {
    return function (arrayLike, accumulator, initialValue) {
        var len = _toArrayLength(arrayLike.length);
        var idx = step === 1 ? 0 : len - 1;
        var nCalls;
        var result;

        if (arguments.length === 3) {
            nCalls = len;
            result = initialValue;
        } else {
            if (len === 0) {
                throw new TypeError("Reduce of empty array-like with no initial value");
            }

            result = arrayLike[idx];
            idx += step;
            nCalls = len - 1;
        }

        for (; nCalls--; idx += step) {
            result = accumulator(result, arrayLike[idx], idx, arrayLike);
        }

        return result;
    };
}
731007
function resolveAddresses(provider, value, paramType) {
    if (Array.isArray(paramType)) {
        var promises_1 = [];
        paramType.forEach(function (paramType, index) {
            var v = null;
            if (Array.isArray(value)) {
                v = value[index];
            }
            else {
                v = value[paramType.name];
            }
            promises_1.push(resolveAddresses(provider, v, paramType));
        });
        return Promise.all(promises_1);
    }
    if (paramType.type === 'address') {
        return provider.resolveName(value);
    }
    if (paramType.type === 'tuple') {
        return resolveAddresses(provider, value, paramType.components);
    }
    // Strips one level of array indexing off the end to recuse into
    var isArrayMatch = paramType.type.match(/(.*)(\[[0-9]*\]$)/);
    if (isArrayMatch) {
        if (!Array.isArray(value)) {
            throw new Error('invalid value for array');
        }
        var promises = [];
        var subParamType = {
            components: paramType.components,
            type: isArrayMatch[1],
        };
        value.forEach(function (v) {
            promises.push(resolveAddresses(provider, v, subParamType));
        });
        return Promise.all(promises);
    }
    return Promise.resolve(value);
}
53993
function resolveOptions (options) {
  const {
    versions = undefined, // the versions to build - leave undefined to use the versions from @versionedPage
    filenameModifier = defaultFilenameModifier,
    outputLatest = true
  } = options || {}

  return { versions, filenameModifier, outputLatest }
}
1152254
function (iterator, accumulator, context) {
        return _.reduce(this.members, _.isFunction(iterator) ? iterator.bind(context || this) : iterator, accumulator);
    }
546898
function resolve(opts, done) {
  debug('resolving paths for globs:\n', JSON.stringify(opts.globs));
  var tasks = opts.globs.map(function(pattern) {
    return function(cb) {
      debug('resolving `%s`...', pattern);
      glob(pattern, {}, function(err, files) {
        if (err) {
          return cb(err);
        }
        debug('resolved %d file(s) for `%s`', files.length, pattern);
        if (files.length > 0) {
          opts.files.push.apply(opts.files, files);
        }
        cb();
      });
    };
  });
  async.parallel(tasks, function(err) {
    if (err) {
      return done(err);
    }
    debug('checking and removing duplicate paths...');
    opts.files = unique(opts.files);
    debug('final result has `%d` files', opts.files.length);
    done(null, opts.files);
  });
}
430263
function Resolver(readerType) {
  // Add all fields here so that all resolvers share the same hidden class.
  this._readerType = readerType;
  this._items = null;
  this._read = null;
  this._size = 0;
  this._symbols = null;
  this._values = null;
}