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

Method _scopeAnimationKeyframe

packages/compiler/src/shadow_css.ts:316–327  ·  view source on GitHub ↗

* Function used to scope a keyframes name (obtained from an animation declaration) * using an existing set of unscopedKeyframes names to discern if the scoping needs to be * performed (keyframes names of keyframes not defined in the component's css need not to be * scoped). * * @param

(
    keyframe: string,
    scopeSelector: string,
    unscopedKeyframesSet: ReadonlySet<string>,
  )

Source from the content-addressed store, hash-verified

314 * scoped.
315 */
316 private _scopeAnimationKeyframe(
317 keyframe: string,
318 scopeSelector: string,
319 unscopedKeyframesSet: ReadonlySet<string>,
320 ): string {
321 return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/, (_, spaces1, quote, name, spaces2) => {
322 name = `${
323 unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : ''
324 }${name}`;
325 return `${spaces1}${quote}${name}${quote}${spaces2}`;
326 });
327 }
328
329 /**
330 * Regular expression used to extrapolate the possible keyframes from an

Callers 1

_scopeAnimationRuleMethod · 0.95

Calls 3

unescapeQuotesFunction · 0.85
hasMethod · 0.65
replaceMethod · 0.45

Tested by

no test coverage detected