Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.select = expr => {
let selector, result;
try {
selector = expr
.split(".")
.filter(next => next.length > 0)
.reduce((sel, next) => sel[next], selectors);
} catch (_) {
throw new Error("Unknown selector: %s", expr);
}
// throws its own exception
result = this.session.view(selector);
return result;
};