MCPcopy Index your code
hub / github.com/angular/angular / _convertColonHost

Method _convertColonHost

packages/compiler/src/shadow_css.ts:434–452  ·  view source on GitHub ↗
(cssText: string)

Source from the content-addressed store, hash-verified

432 * .foo<scopeName> > .bar
433 */
434 private _convertColonHost(cssText: string): string {
435 return cssText.replace(_cssColonHostRe, (_, hostSelectors: string, otherSelectors: string) => {
436 if (hostSelectors) {
437 const parts = [...this._splitOnTopLevelCommas(hostSelectors, true)];
438 if (parts.length > 1) {
439 return ':host(' + hostSelectors + ')' + otherSelectors;
440 }
441 const trimmedHostSelector = parts[0].trim();
442 if (trimmedHostSelector) {
443 return (
444 _polyfillHostNoCombinator +
445 trimmedHostSelector.replace(_polyfillHost, '') +
446 otherSelectors
447 );
448 }
449 }
450 return _polyfillHostNoCombinator + otherSelectors;
451 });
452 }
453
454 /**
455 * Generator function that splits a string on top-level commas (commas that are not inside parentheses).

Callers 1

_scopeCssTextMethod · 0.95

Calls 2

replaceMethod · 0.45

Tested by

no test coverage detected