MCPcopy Index your code
hub / github.com/dataease/SQLBot / foldLine

Function foldLine

frontend/public/swagger-ui-bundle.js:34255–34268  ·  view source on GitHub ↗
(s, o)

Source from the content-addressed store, hash-verified

34253 function dropEndingNewline(s) {
34254 return '\n' === s[s.length - 1] ? s.slice(0, -1) : s
34255 }
34256 function foldLine(s, o) {
34257 if ('' === s || ' ' === s[0]) return s
34258 for (var i, a, u = / [^ ]/g, _ = 0, w = 0, x = 0, C = ''; (i = u.exec(s)); )
34259 ((x = i.index) - _ > o &&
34260 ((a = w > _ ? w : x), (C += '\n' + s.slice(_, a)), (_ = a + 1)),
34261 (w = x))
34262 return (
34263 (C += '\n'),
34264 s.length - _ > o && w > _
34265 ? (C += s.slice(_, w) + '\n' + s.slice(w + 1))
34266 : (C += s.slice(_)),
34267 C.slice(1)
34268 )
34269 }
34270 function writeBlockSequence(s, o, i, a) {
34271 var u,

Callers 1

writeScalarFunction · 0.85

Calls 1

execMethod · 0.45

Tested by

no test coverage detected