flagpole
Version:
Simple and fast DOM integration, headless or headful browser, and REST API testing framework.
21 lines • 647 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class jPath {
search(searchIn, path) {
const selectPath = this._getSelectPath(path);
let selection = searchIn || {};
selectPath.every((part) => {
selection = selection[part];
return (typeof selection !== 'undefined');
});
return selection;
}
_getSelectPath(path) {
path = path.replace(/[\[\] ]/g, '.');
path = path.replace(/['"]/g, '');
path = path.replace(/\.{2,}/g, '.');
return path.split('.');
}
}
exports.jPath = jPath;
//# sourceMappingURL=jpath.js.map