seq.js 440 B

1234567891011121314151617
  1. import { isSeq } from '../../nodes/identity.js';
  2. import { YAMLSeq } from '../../nodes/YAMLSeq.js';
  3. const seq = {
  4. collection: 'seq',
  5. default: true,
  6. nodeClass: YAMLSeq,
  7. tag: 'tag:yaml.org,2002:seq',
  8. resolve(seq, onError) {
  9. if (!isSeq(seq))
  10. onError('Expected a sequence for this tag');
  11. return seq;
  12. },
  13. createNode: (schema, obj, ctx) => YAMLSeq.from(schema, obj, ctx)
  14. };
  15. export { seq };