Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getValue(obj, names) {
let i = 0;
while ( i < names.length ) {
if ( obj == null || obj.type !== Syntax.ObjectExpression ) {
return null;
}
obj = findOwnProperty(obj, names[i++]);
}
return obj;
}
visitArrayOrObjectExpression.test = function(node, path, state) {
return node.type === Syntax.ArrayExpression ||
node.type === Syntax.ObjectExpression;
};