MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / removeFromArr

Function removeFromArr

frontend/util/ijson.ts:129–143  ·  view source on GitHub ↗
(arr: any[], idx: number)

Source from the content-addressed store, hash-verified

127}
128
129function removeFromArr(arr: any[], idx: number): any[] {
130 console.log("removefromarray", arr, idx);
131 if (idx >= arr.length) {
132 return arr;
133 }
134 if (idx == arr.length - 1) {
135 arr.pop();
136 if (arr.length == 0) {
137 return null;
138 }
139 return arr;
140 }
141 arr[idx] = null;
142 return arr;
143}
144
145function setPathInternal(obj: any, path: PathType, value: any, opts: SetPathOpts): any {
146 if (path.length == 0) {

Callers 1

setPathInternalFunction · 0.85

Calls 1

popMethod · 0.80

Tested by

no test coverage detected