MCPcopy Create free account
hub / github.com/SplootCode/splootcode / updateVar

Function updateVar

packages/editor/src/components/config_panel.tsx:259–265  ·  view source on GitHub ↗
(prevName: string, newName: string, value: string, secret: boolean)

Source from the content-addressed store, hash-verified

257 }
258
259 const updateVar = (prevName: string, newName: string, value: string, secret: boolean) => {
260 if (prevName !== newName) {
261 project.deleteEnvironmentVar(prevName)
262 }
263 project.setEnvironmentVar(newName, value, secret)
264 setEnvVars(Object.fromEntries(project.environmentVars))
265 }
266
267 const newVar = () => {
268 const newEnvVars = { '': ['', false] as [string, boolean], ...envVars }

Callers 1

EnvironmentVarFunction · 0.85

Calls 2

deleteEnvironmentVarMethod · 0.80
setEnvironmentVarMethod · 0.80

Tested by

no test coverage detected