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

Function compileKeywords

frontend/public/swagger-ui-bundle.js:20506–20525  ·  view source on GitHub ↗
(s, o, i = 'keyword')

Source from the content-addressed store, hash-verified

20504 'value',
20505 ]
20506 function compileKeywords(s, o, i = 'keyword') {
20507 const a = {}
20508 return (
20509 'string' == typeof s
20510 ? compileList(i, s.split(' '))
20511 : Array.isArray(s)
20512 ? compileList(i, s)
20513 : Object.keys(s).forEach(function (i) {
20514 Object.assign(a, compileKeywords(s[i], o, i))
20515 }),
20516 a
20517 )
20518 function compileList(s, i) {
20519 ;(o && (i = i.map((s) => s.toLowerCase())),
20520 i.forEach(function (o) {
20521 const i = o.split('|')
20522 a[i[0]] = [s, scoreForKeyword(i[0], i[1])]
20523 }))
20524 }
20525 }
20526 function scoreForKeyword(s, o) {
20527 return o
20528 ? Number(o)

Callers 1

compileLanguageFunction · 0.85

Calls 4

compileListFunction · 0.85
isArrayMethod · 0.45
forEachMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected