pandora-hub
Version:
pandora.js messenge hub
24 lines • 720 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const domain_1 = require("../domain");
class SelectorUtils {
/**
* Decide Equivalence of Selector
* @param {Selector} selector
* @param {Selector} targetSelector
* @return {boolean}
*/
static match(selector, targetSelector) {
let found = 0;
let shouldFound = 0;
for (const key of domain_1.selectorSchema) {
shouldFound++;
if (!selector[key] || (selector[key] === targetSelector[key])) {
found++;
}
}
return shouldFound === found;
}
}
exports.SelectorUtils = SelectorUtils;
//# sourceMappingURL=SelectorUtils.js.map