MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / hasAttr

Function hasAttr

packages/core/src/compiler/timingCompiler.ts:73–75  ·  view source on GitHub ↗
(tag: string, attr: string)

Source from the content-addressed store, hash-verified

71}
72
73function hasAttr(tag: string, attr: string): boolean {
74 return new RegExp(`\\s${attr}(?:\\s|=|>|/)`).test(tag);
75}
76
77function injectAttr(tag: string, attr: string, value: string): string {
78 return tag.replace(/>$/, ` ${attr}="${value}">`);

Callers 4

compileTagFunction · 0.85
compileTimingAttrsFunction · 0.85
injectDurationsFunction · 0.85
extractResolvedMediaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected