MCPcopy Index your code
hub / github.com/apache/echarts / set

Function set

src/preprocessor/backwardCompat.ts:41–56  ·  view source on GitHub ↗
(opt: Dictionary<any>, path: string, val: any, overwrite?: boolean)

Source from the content-addressed store, hash-verified

39}
40
41function set(opt: Dictionary<any>, path: string, val: any, overwrite?: boolean) {
42 const pathArr = path.split(',');
43 let obj = opt;
44 let key;
45 let i = 0;
46 for (; i < pathArr.length - 1; i++) {
47 key = pathArr[i];
48 if (obj[key] == null) {
49 obj[key] = {};
50 }
51 obj = obj[key];
52 }
53 if (overwrite || obj[pathArr[i]] == null) {
54 obj[pathArr[i]] = val;
55 }
56}
57
58function compatLayoutProperties(option: Dictionary<any>) {
59 option && each(LAYOUT_PROPERTIES, function (prop) {

Callers 1

globalBackwardCompatFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected