MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / getOrCreateId

Function getOrCreateId

ui/src/workflow/common/shortcut.ts:171–178  ·  view source on GitHub ↗
(oldId: string)

Source from the content-addressed store, hash-verified

169 const idMap = new Map<string, string>()
170
171 const getOrCreateId = (oldId: string) => {
172 let newId = idMap.get(oldId)
173 if (!newId) {
174 newId = randomId()
175 idMap.set(oldId, newId)
176 }
177 return newId
178 }
179
180 for (const node of data.nodes) {
181 node.id = getOrCreateId(node.id)

Callers 1

resetDataFunction · 0.85

Calls 3

randomIdFunction · 0.90
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected