How to use the iterall.createIterator function in iterall

To help you get started, we’ve selected a few iterall examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphql / graphql-js / src / execution / values.js View on Github external
if (_value === null) {
      return; // Intentionally return no value.
    }
    return coerceValue(type.ofType, _value);
  }

  if (_value === null) {
    // Intentionally return the value null.
    return null;
  }

  if (type instanceof GraphQLList) {
    const itemType = type.ofType;
    if (isCollection(_value)) {
      const coercedValues = [];
      const valueIter = createIterator((_value: any));
      if (!valueIter) {
        return; // Intentionally return no value.
      }
      let step;
      while (!(step = valueIter.next()).done) {
        const itemValue = coerceValue(itemType, step.value);
        if (isInvalid(itemValue)) {
          return; // Intentionally return no value.
        }
        coercedValues.push(itemValue);
      }
      return coercedValues;
    }
    const coercedValue = coerceValue(itemType, _value);
    if (isInvalid(coercedValue)) {
      return; // Intentionally return no value.
github scaphold-io / graphql-extended / src / execution / values.ts View on Github external
if (_value === null) {
      return // Intentionally return no value.
    }
    return coerceValue(type.ofType, _value)
  }

  if (_value === null) {
    // Intentionally return the value null.
    return null
  }

  if (type instanceof GraphQLList) {
    const itemType = type.ofType
    if (isCollection(_value)) {
      const coercedValues = []
      const valueIter = createIterator(_value)
      if (!valueIter) {
        return // Intentionally return no value.
      }
      let step
      /* tslint:disable */
      while (!(step = valueIter.next()).done) {
      /* tslint:enable */
        const itemValue = coerceValue(itemType, step.value)
        if (isInvalid(itemValue)) {
          return // Intentionally return no value.
        }
        coercedValues.push(itemValue)
      }
      return coercedValues
    }
    const coercedValue = coerceValue(itemType, _value)