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-5.0.7 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-5.0.6 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-5.0.5 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-5.0.4 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-5.0.3 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-5.0.2 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-5.0.1 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.3.5 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-5.0.0 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.3.4 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.3.3 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.3.2 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.3.1 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.3 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.2.3 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.2.2 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.2.1 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.2 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.1.9 node_modules/yaml/browser/dist/tags/failsafe/seq.js
trusty-cms-4.1.8 node_modules/yaml/browser/dist/tags/failsafe/seq.js