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

Function stylize

frontend/public/swagger-ui-bundle.js:41465–41527  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

41463 })
41464 .join('')
41465 }
41466 function stylize(s) {
41467 const { value: o } = s
41468 return Array.isArray(o)
41469 ? (function encodeArray({ key: s, value: o, style: i, explode: a, escape: u }) {
41470 if ('simple' === i) return o.map((s) => valueEncoder(s, u)).join(',')
41471 if ('label' === i) return `.${o.map((s) => valueEncoder(s, u)).join('.')}`
41472 if ('matrix' === i)
41473 return o
41474 .map((s) => valueEncoder(s, u))
41475 .reduce((o, i) => (!o || a ? `${o || ''};${s}=${i}` : `${o},${i}`), '')
41476 if ('form' === i) {
41477 const i = a ? `&${s}=` : ','
41478 return o.map((s) => valueEncoder(s, u)).join(i)
41479 }
41480 if ('spaceDelimited' === i) {
41481 const i = a ? `${s}=` : ''
41482 return o.map((s) => valueEncoder(s, u)).join(` ${i}`)
41483 }
41484 if ('pipeDelimited' === i) {
41485 const i = a ? `${s}=` : ''
41486 return o.map((s) => valueEncoder(s, u)).join(`|${i}`)
41487 }
41488 return
41489 })(s)
41490 : 'object' == typeof o
41491 ? (function encodeObject({ key: s, value: o, style: i, explode: a, escape: u }) {
41492 const _ = Object.keys(o)
41493 if ('simple' === i)
41494 return _.reduce((s, i) => {
41495 const _ = valueEncoder(o[i], u)
41496 return `${s ? `${s},` : ''}${i}${a ? '=' : ','}${_}`
41497 }, '')
41498 if ('label' === i)
41499 return _.reduce((s, i) => {
41500 const _ = valueEncoder(o[i], u)
41501 return `${s ? `${s}.` : '.'}${i}${a ? '=' : '.'}${_}`
41502 }, '')
41503 if ('matrix' === i && a)
41504 return _.reduce(
41505 (s, i) => `${s ? `${s};` : ';'}${i}=${valueEncoder(o[i], u)}`,
41506 ''
41507 )
41508 if ('matrix' === i)
41509 return _.reduce((i, a) => {
41510 const _ = valueEncoder(o[a], u)
41511 return `${i ? `${i},` : `;${s}=`}${a},${_}`
41512 }, '')
41513 if ('form' === i)
41514 return _.reduce((s, i) => {
41515 const _ = valueEncoder(o[i], u)
41516 return `${s ? `${s}${a ? '&' : ','}` : ''}${i}${a ? '=' : ','}${_}`
41517 }, '')
41518 return
41519 })(s)
41520 : (function encodePrimitive({ key: s, value: o, style: i, escape: a }) {
41521 if ('simple' === i) return valueEncoder(o, a)
41522 if ('label' === i) return `.${valueEncoder(o, a)}`

Callers 3

parameter_builders_pathFunction · 0.85
cookieFunction · 0.85

Calls 5

valueEncoderFunction · 0.85
isArrayMethod · 0.45
mapMethod · 0.45
reduceMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected