UNPKG

@pandorajs/hub

Version:

pandora.js messenge hub

25 lines 747 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SelectorUtils = void 0; const types_1 = require("../types"); 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 types_1.selectorSchema) { shouldFound++; if (!selector[key] || selector[key] === targetSelector[key]) { found++; } } return shouldFound === found; } } exports.SelectorUtils = SelectorUtils; //# sourceMappingURL=SelectorUtils.js.map