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

Version Path
trusty-cms-5.0.7 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-5.0.6 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-5.0.5 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-5.0.4 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-5.0.3 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-5.0.2 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-5.0.1 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.3.5 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-5.0.0 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.3.4 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.3.3 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.3.2 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.3.1 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.3 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.2.3 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.2.2 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.2.1 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.2 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.1.9 node_modules/yaml/dist/tags/failsafe/map.js
trusty-cms-4.1.8 node_modules/yaml/dist/tags/failsafe/map.js