Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
443 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | exports.__esModule = true;
|
---|
4 | exports["default"] = getProp;
|
---|
5 |
|
---|
6 | function getProp(obj) {
|
---|
7 | for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
---|
8 | props[_key - 1] = arguments[_key];
|
---|
9 | }
|
---|
10 |
|
---|
11 | while (props.length > 0) {
|
---|
12 | var prop = props.shift();
|
---|
13 |
|
---|
14 | if (!obj[prop]) {
|
---|
15 | return undefined;
|
---|
16 | }
|
---|
17 |
|
---|
18 | obj = obj[prop];
|
---|
19 | }
|
---|
20 |
|
---|
21 | return obj;
|
---|
22 | }
|
---|
23 |
|
---|
24 | module.exports = exports.default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.