UNPKG

540 BPlain TextView Raw
167a68,90
2> * Get an element by a series of segment names.
3> *
4> * @param {Array} path - The series of fieldnames. Cannot be empty.
5> *
6> * @returns {Element} The element.
7> */
8> getChild(path) {
9> if (!path) {
10> return undefined;
11> }
12> let element = this.elements.get(path[0]);
13> let i = 1;
14> while (i < path.length) {
15> if (element === undefined) {
16> return undefined;
17> }
18> element = element.get(path[i]);
19> i++;
20> }
21> return element;
22> }
23>
24> /**