UNPKG

432 BJavaScriptView Raw
1"use strict";
2
3var isValue = require("./object/is-value");
4
5var slice = Array.prototype.slice;
6
7// eslint-disable-next-line no-unused-vars
8module.exports = function (value, propertyName1 /*, …propertyNamen*/) {
9 var propertyNames = slice.call(arguments, 1), index = 0, length = propertyNames.length;
10 while (isValue(value) && index < length) value = value[propertyNames[index++]];
11 return index === length ? value : undefined;
12};