Sha256: 879e2705f9efa10b9c2fd33785c29db01a4a3bcf2ab21ed220f0293acfdf7faa
Contents?: true
Size: 846 Bytes
Versions: 27
Compression:
Stored size: 846 Bytes
Contents
import { stringifyString } from '../../stringify'; import { strOptions } from '../options'; export var resolveString = function resolveString(doc, node) { // on error, will return { str: string, errors: Error[] } var res = node.strValue; if (!res) return ''; if (typeof res === 'string') return res; res.errors.forEach(function (error) { if (!error.source) error.source = node; doc.errors.push(error); }); return res.str; }; export default { identify: function identify(value) { return typeof value === 'string'; }, default: true, tag: 'tag:yaml.org,2002:str', resolve: resolveString, stringify: function stringify(item, ctx, onComment, onChompKeep) { ctx = Object.assign({ actualString: true }, ctx); return stringifyString(item, ctx, onComment, onChompKeep); }, options: strOptions };
Version data entries
27 entries across 23 versions & 1 rubygems