MCPcopy Create free account
hub / github.com/ampproject/amphtml / selectorNeedsScoping

Function selectorNeedsScoping

third_party/webcomponentsjs/ShadowCSS.js:193–199  ·  view source on GitHub ↗
(selector, scopeSelector)

Source from the content-addressed store, hash-verified

191}
192
193export function selectorNeedsScoping(selector, scopeSelector) {
194 if (allowArraySelectors && Array.isArray(scopeSelector)) {
195 return true;
196 }
197 var re = makeScopeMatcher(scopeSelector);
198 return !selector.match(re);
199}
200
201export function makeScopeMatcher(scopeSelector) {
202 scopeSelector = scopeSelector.replace(/\[/g, '\\[').replace(/\]/g, '\\]');

Callers 1

doScopeSelectorFunction · 0.85

Calls 1

makeScopeMatcherFunction · 0.85

Tested by

no test coverage detected