deno.land / x / billboardjs@3.6.0 / config / config.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/** * Copyright (c) 2017 ~ present NAVER Corp. * billboard.js project is licensed under the MIT license */import {isDefined, isObjectType} from "../module/util";import Options from "./Options/Options";import type {ChartOptions} from "../../types/options";
/** * Load configuration option * @param {object} config User's generation config value * @private */export function loadConfig(config: ChartOptions): void { const thisConfig: Options = this.config; let target; let keys; let read;
const find = () => { const key = keys.shift();
if (key && target && isObjectType(target) && key in target) { target = target[key]; return find(); } else if (!key) { return target; }
return undefined; };
Object.keys(thisConfig).forEach(key => { target = config; keys = key.split("_"); read = find();
if (isDefined(read)) { thisConfig[key] = read; } });
// only should run in the ChartInternal context if (this.api) { this.state.orgConfig = config; }}
billboardjs

Version Info

Tagged at
a year ago