Sha256: 56b7caef69e79cef6409bfd40442a8183dad561f11497cca37cdfa51530195bd
Contents?: true
Size: 982 Bytes
Versions: 27
Compression:
Stored size: 982 Bytes
Contents
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _Map = _interopRequireDefault(require("../../schema/Map")); var _parseMap = _interopRequireDefault(require("../../schema/parseMap")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function createMap(schema, obj, ctx) { const map = new _Map.default(schema); if (obj instanceof Map) { for (const [key, value] of obj) map.items.push(schema.createPair(key, value, ctx)); } else if (obj && typeof obj === 'object') { for (const key of Object.keys(obj)) map.items.push(schema.createPair(key, obj[key], ctx)); } if (typeof schema.sortMapEntries === 'function') { map.items.sort(schema.sortMapEntries); } return map; } var _default = { createNode: createMap, default: true, nodeClass: _Map.default, tag: 'tag:yaml.org,2002:map', resolve: _parseMap.default }; exports.default = _default;
Version data entries
27 entries across 23 versions & 1 rubygems