MCPcopy Create free account
hub / github.com/dataease/SQLBot / chooseScalarStyle

Function chooseScalarStyle

frontend/public/swagger-ui-bundle.js:34097–34165  ·  view source on GitHub ↗
(s, o, i, a, u, _, w, x)

Source from the content-addressed store, hash-verified

34095 function needIndentIndicator(s) {
34096 return /^\n* /.test(s)
34097 }
34098 function chooseScalarStyle(s, o, i, a, u, _, w, x) {
34099 var C,
34100 j = 0,
34101 L = null,
34102 B = !1,
34103 $ = !1,
34104 U = -1 !== a,
34105 V = -1,
34106 z =
34107 (function isPlainSafeFirst(s) {
34108 return (
34109 isPrintable(s) &&
34110 s !== Kr &&
34111 !isWhitespace(s) &&
34112 45 !== s &&
34113 63 !== s &&
34114 58 !== s &&
34115 44 !== s &&
34116 91 !== s &&
34117 93 !== s &&
34118 123 !== s &&
34119 125 !== s &&
34120 35 !== s &&
34121 38 !== s &&
34122 42 !== s &&
34123 33 !== s &&
34124 124 !== s &&
34125 61 !== s &&
34126 62 !== s &&
34127 39 !== s &&
34128 34 !== s &&
34129 37 !== s &&
34130 64 !== s &&
34131 96 !== s
34132 )
34133 })(codePointAt(s, 0)) &&
34134 (function isPlainSafeLast(s) {
34135 return !isWhitespace(s) && 58 !== s
34136 })(codePointAt(s, s.length - 1))
34137 if (o || w)
34138 for (C = 0; C < s.length; j >= 65536 ? (C += 2) : C++) {
34139 if (!isPrintable((j = codePointAt(s, C)))) return 5
34140 ;((z = z && isPlainSafe(j, L, x)), (L = j))
34141 }
34142 else {
34143 for (C = 0; C < s.length; j >= 65536 ? (C += 2) : C++) {
34144 if (10 === (j = codePointAt(s, C)))
34145 ((B = !0), U && (($ = $ || (C - V - 1 > a && ' ' !== s[V + 1])), (V = C)))
34146 else if (!isPrintable(j)) return 5
34147 ;((z = z && isPlainSafe(j, L, x)), (L = j))
34148 }
34149 $ = $ || (U && C - V - 1 > a && ' ' !== s[V + 1])
34150 }
34151 return B || $
34152 ? i > 9 && needIndentIndicator(s)
34153 ? 5
34154 : w

Callers 1

writeScalarFunction · 0.85

Calls 6

isPrintableFunction · 0.85
isWhitespaceFunction · 0.85
codePointAtFunction · 0.85
isPlainSafeFunction · 0.85
needIndentIndicatorFunction · 0.85
uFunction · 0.70

Tested by

no test coverage detected