You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
473 B

4 years ago
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = getProp;
  4. function getProp(obj) {
  5. for (var _len = arguments.length, props = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  6. props[_key - 1] = arguments[_key];
  7. }
  8. while (props.length > 0) {
  9. var prop = props.shift();
  10. if (!obj[prop]) {
  11. return undefined;
  12. }
  13. obj = obj[prop];
  14. }
  15. return obj;
  16. }
  17. module.exports = exports["default"];