ohctechv3/.svn/pristine/6e/6ed8b7bb89ee15849874d280027b815e0b755a82.svn-base
2024-10-28 15:03:36 +05:30

20 lines
483 B
Plaintext

'use strict';
var identity = require('../../nodes/identity.js');
var YAMLMap = require('../../nodes/YAMLMap.js');
const map = {
collection: 'map',
default: true,
nodeClass: YAMLMap.YAMLMap,
tag: 'tag:yaml.org,2002:map',
resolve(map, onError) {
if (!identity.isMap(map))
onError('Expected a mapping for this tag');
return map;
},
createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
};
exports.map = map;