(s, o, i, a, u)
| 34164 | : 2 |
| 34165 | : 1 |
| 34166 | } |
| 34167 | function writeScalar(s, o, i, a, u) { |
| 34168 | s.dump = (function () { |
| 34169 | if (0 === o.length) return 2 === s.quotingType ? '""' : "''" |
| 34170 | if (!s.noCompatMode && (-1 !== Yr.indexOf(o) || Xr.test(o))) |
| 34171 | return 2 === s.quotingType ? '"' + o + '"' : "'" + o + "'" |
| 34172 | var _ = s.indent * Math.max(1, i), |
| 34173 | w = -1 === s.lineWidth ? -1 : Math.max(Math.min(s.lineWidth, 40), s.lineWidth - _), |
| 34174 | x = a || (s.flowLevel > -1 && i >= s.flowLevel) |
| 34175 | switch ( |
| 34176 | chooseScalarStyle( |
| 34177 | o, |
| 34178 | x, |
| 34179 | s.indent, |
| 34180 | w, |
| 34181 | function testAmbiguity(o) { |
| 34182 | return (function testImplicitResolving(s, o) { |
| 34183 | var i, a |
| 34184 | for (i = 0, a = s.implicitTypes.length; i < a; i += 1) |
| 34185 | if (s.implicitTypes[i].resolve(o)) return !0 |
| 34186 | return !1 |
| 34187 | })(s, o) |
| 34188 | }, |
| 34189 | s.quotingType, |
| 34190 | s.forceQuotes && !a, |
| 34191 | u |
| 34192 | ) |
| 34193 | ) { |
| 34194 | case 1: |
| 34195 | return o |
| 34196 | case 2: |
| 34197 | return "'" + o.replace(/'/g, "''") + "'" |
| 34198 | case 3: |
| 34199 | return '|' + blockHeader(o, s.indent) + dropEndingNewline(indentString(o, _)) |
| 34200 | case 4: |
| 34201 | return ( |
| 34202 | '>' + |
| 34203 | blockHeader(o, s.indent) + |
| 34204 | dropEndingNewline( |
| 34205 | indentString( |
| 34206 | (function foldString(s, o) { |
| 34207 | var i, |
| 34208 | a, |
| 34209 | u = /(\n+)([^\n]*)/g, |
| 34210 | _ = |
| 34211 | ((x = s.indexOf('\n')), |
| 34212 | (x = -1 !== x ? x : s.length), |
| 34213 | (u.lastIndex = x), |
| 34214 | foldLine(s.slice(0, x), o)), |
| 34215 | w = '\n' === s[0] || ' ' === s[0] |
| 34216 | var x |
| 34217 | for (; (a = u.exec(s)); ) { |
| 34218 | var C = a[1], |
| 34219 | j = a[2] |
| 34220 | ;((i = ' ' === j[0]), |
| 34221 | (_ += C + (w || i || '' === j ? '' : '\n') + foldLine(j, o)), |
| 34222 | (w = i)) |
| 34223 | } |
no test coverage detected