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

Function setPath

frontend/util/ijson.ts:97–111  ·  view source on GitHub ↗
(obj: any, path: PathType, value: any, opts: SetPathOpts)

Source from the content-addressed store, hash-verified

95}
96
97function setPath(obj: any, path: PathType, value: any, opts: SetPathOpts) {
98 if (opts == null) {
99 opts = {};
100 }
101 if (opts.remove && value != null) {
102 throw new Error("Cannot set value and remove at the same time");
103 }
104 if (path == null) {
105 path = [];
106 }
107 if (!checkPath(path)) {
108 throw new Error("Invalid path: " + formatPath(path));
109 }
110 return setPathInternal(obj, path, value, opts);
111}
112
113function isEmpty(obj: any): boolean {
114 if (obj == null) {

Callers 1

applyCommandFunction · 0.85

Calls 3

checkPathFunction · 0.85
formatPathFunction · 0.85
setPathInternalFunction · 0.70

Tested by

no test coverage detected