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

Function validateRnmCallbackResult

frontend/public/swagger-ui-bundle.js:43234–43264  ·  view source on GitHub ↗
(o, i, u, _)

Source from the content-addressed store, hash-verified

43232 nodeHits: V,
43233 }
43234 }
43235 const validateRnmCallbackResult = (o, i, u, _) => {
43236 if (i.phraseLength > u) {
43237 let s = `${a}opRNM(${o.name}): callback function error: `
43238 throw (
43239 (s += `sysData.phraseLength: ${i.phraseLength}`),
43240 (s += ` must be <= remaining chars: ${u}`),
43241 new Error(s)
43242 )
43243 }
43244 switch (i.state) {
43245 case s.ACTIVE:
43246 if (!_)
43247 throw new Error(
43248 `${a}opRNM(${o.name}): callback function return error. ACTIVE state not allowed.`
43249 )
43250 break
43251 case s.EMPTY:
43252 i.phraseLength = 0
43253 break
43254 case s.MATCH:
43255 0 === i.phraseLength && (i.state = s.EMPTY)
43256 break
43257 case s.NOMATCH:
43258 i.phraseLength = 0
43259 break
43260 default:
43261 throw new Error(
43262 `${a}opRNM(${o.name}): callback function return error. Unrecognized return state: ${i.state}`
43263 )
43264 }
43265 },
43266 opUDT = (o, C) => {
43267 let $, U, V

Callers 1

opExecuteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected