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

Function updateParam

frontend/public/assistant.js:738–759  ·  view source on GitHub ↗
(target_url, key, newValue)

Source from the content-addressed store, hash-verified

736 } */
737
738 function updateParam(target_url, key, newValue) {
739 try {
740 const url = new URL(target_url)
741 const [hashPath, hashQuery] = url.hash.split('?')
742 let searchParams
743 if (hashQuery) {
744 searchParams = new URLSearchParams(hashQuery)
745 } else {
746 searchParams = url.searchParams
747 }
748 searchParams.set(key, newValue)
749 if (hashQuery) {
750 url.hash = `${hashPath}?${searchParams.toString()}`
751 } else {
752 url.search = searchParams.toString()
753 }
754 return url.toString()
755 } catch (e) {
756 console.error('Invalid URL:', target_url)
757 return target_url
758 }
759 }
760 function expposeGlobalMethods(id) {
761 window.sqlbot_assistant_handler[id]['setOnline'] = (online) => {
762 if (online != null && typeof online != 'boolean') {

Callers 1

expposeGlobalMethodsFunction · 0.85

Calls 3

errorMethod · 0.80
setMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected