Sha256: 0cfa72dba4100ce113b3f4f909a85d021fdc13a5abd4e990519bcaed84ef6648

Contents?: true

Size: 981 Bytes

Versions: 28

Compression:

Stored size: 981 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.resolveString = void 0;

var _stringify = require("../../stringify");

var _options = require("../options");

const resolveString = (doc, node) => {
  // on error, will return { str: string, errors: Error[] }
  const res = node.strValue;
  if (!res) return '';
  if (typeof res === 'string') return res;
  res.errors.forEach(error => {
    if (!error.source) error.source = node;
    doc.errors.push(error);
  });
  return res.str;
};

exports.resolveString = resolveString;
var _default = {
  identify: value => typeof value === 'string',
  default: true,
  tag: 'tag:yaml.org,2002:str',
  resolve: resolveString,

  stringify(item, ctx, onComment, onChompKeep) {
    ctx = Object.assign({
      actualString: true
    }, ctx);
    return (0, _stringify.stringifyString)(item, ctx, onComment, onChompKeep);
  },

  options: _options.strOptions
};
exports.default = _default;

Version data entries

28 entries across 24 versions & 2 rubygems

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