MCPcopy
hub / github.com/chavyleung/scripts / dealKey

Function dealKey

chavy.box.js:700–710  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

698}
699
700function dealKey(str) {
701 const [rootKey, delIndex] = str.split('.')
702 if (rootKey && rootKey.indexOf('@') > -1 && delIndex !== undefined) {
703 const key = rootKey.replace('@', '')
704 const datas = JSON.parse($.getdata(key))
705 if (Array.isArray(datas) && delIndex <= datas.length - 1) {
706 datas.splice(delIndex, 1)
707 $.setdata(JSON.stringify(datas), key)
708 }
709 }
710}
711
712async function apiSave() {
713 const data = $.toObj($request.body)

Callers 1

apiSaveFunction · 0.70

Calls 2

getdataMethod · 0.45
setdataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…