Function
removeFromArr
(arr: any[], idx: number)
Source from the content-addressed store, hash-verified
| 127 | } |
| 128 | |
| 129 | function 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 | |
| 145 | function setPathInternal(obj: any, path: PathType, value: any, opts: SetPathOpts): any { |
| 146 | if (path.length == 0) { |
Tested by
no test coverage detected