Sha256: 8ac442b4dd281aae3816613baaf64e2db12a41e1311e832f761fa295d64e584b

Contents?: true

Size: 1.07 KB

Versions: 27

Compression:

Stored size: 1.07 KB

Contents

import parseSeq from '../../schema/parseSeq';
import YAMLSeq from '../../schema/Seq';

function createSeq(schema, obj, ctx) {
  var seq = new YAMLSeq(schema);

  if (obj && obj[Symbol.iterator]) {
    var _iteratorNormalCompletion = true;
    var _didIteratorError = false;
    var _iteratorError = undefined;

    try {
      for (var _iterator = obj[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
        var it = _step.value;
        var v = schema.createNode(it, ctx.wrapScalars, null, ctx);
        seq.items.push(v);
      }
    } catch (err) {
      _didIteratorError = true;
      _iteratorError = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion && _iterator.return != null) {
          _iterator.return();
        }
      } finally {
        if (_didIteratorError) {
          throw _iteratorError;
        }
      }
    }
  }

  return seq;
}

export default {
  createNode: createSeq,
  default: true,
  nodeClass: YAMLSeq,
  tag: 'tag:yaml.org,2002:seq',
  resolve: parseSeq
};

Version data entries

27 entries across 23 versions & 1 rubygems

Version Path
trusty-cms-4.1.8 spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.1.7 spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.1.7 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.1.6 spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.1.6 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.1.5 spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.1.5 node_modules/yaml/browser/dist/tags/failsafe/seq.js