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

Function normalize_normalize

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

Source from the content-addressed store, hash-verified

41876 return `${o.toLowerCase()}${replace_special_chars_with_underscore(s)}`
41877 })(o, i, { v2OperationIdCompatibilityMode: a })
41878 }
41879 function normalize_normalize(s) {
41880 const { spec: o } = s,
41881 { paths: i } = o,
41882 a = {}
41883 if (!i || o.$$normalized) return s
41884 for (const s in i) {
41885 const u = i[s]
41886 if (null == u || !['object', 'function'].includes(typeof u)) continue
41887 const _ = u.parameters
41888 for (const i in u) {
41889 const w = u[i]
41890 if (null == w || !['object', 'function'].includes(typeof w)) continue
41891 const x = opId(w, s, i)
41892 if (x) {
41893 a[x] ? a[x].push(w) : (a[x] = [w])
41894 const s = a[x]
41895 if (s.length > 1)
41896 s.forEach((s, o) => {
41897 ;((s.__originalOperationId = s.__originalOperationId || s.operationId),
41898 (s.operationId = `${x}${o + 1}`))
41899 })
41900 else if (void 0 !== w.operationId) {
41901 const o = s[0]
41902 ;((o.__originalOperationId = o.__originalOperationId || w.operationId),
41903 (o.operationId = x))
41904 }
41905 }
41906 if ('parameters' !== i) {
41907 const s = [],
41908 i = {}
41909 for (const a in o)
41910 ('produces' !== a && 'consumes' !== a && 'security' !== a) ||
41911 ((i[a] = o[a]), s.push(i))
41912 if ((_ && ((i.parameters = _), s.push(i)), s.length))
41913 for (const o of s)
41914 for (const s in o)
41915 if (Array.isArray(w[s])) {
41916 if ('parameters' === s)
41917 for (const i of o[s]) {
41918 w[s].some(
41919 (s) =>
41920 !(!fu(s) && !fu(i)) &&
41921 (s === i ||
41922 ['name', '$ref', '$$ref'].some(
41923 (o) =>
41924 'string' == typeof s[o] &&
41925 'string' == typeof i[o] &&
41926 s[o] === i[o]
41927 ))
41928 ) || w[s].push(i)
41929 }
41930 } else w[s] = o[s]
41931 }
41932 }
41933 }
41934 return ((o.$$normalized = !0), s)
41935 }

Callers 1

normalizeFunction · 0.85

Calls 7

opIdFunction · 0.85
fuFunction · 0.85
includesMethod · 0.45
pushMethod · 0.45
forEachMethod · 0.45
isArrayMethod · 0.45
someMethod · 0.45

Tested by

no test coverage detected