MCPcopy Create free account
hub / github.com/chavyleung/scripts / dealKey

Function dealKey

chavy.box.js:701–711  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

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

Callers 1

apiSaveFunction · 0.70

Calls 2

getdataMethod · 0.45
setdataMethod · 0.45

Tested by

no test coverage detected