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