(level: number, id?: string)
| 99 | readonly id: string; |
| 100 | |
| 101 | constructor(level: number, id?: string) { |
| 102 | this.level = level; |
| 103 | if (id) { |
| 104 | this.id = id; |
| 105 | } |
| 106 | let placeholder: any; |
| 107 | if (id) { |
| 108 | placeholder = document.head.querySelector(`style[data-id="${id}"]`); |
| 109 | } |
| 110 | if (!placeholder) { |
| 111 | placeholder = document.createTextNode(''); |
| 112 | const meta = document.head.querySelector(`meta[level="${level}"]`); |
| 113 | if (meta) { |
| 114 | document.head.insertBefore(placeholder, meta); |
| 115 | } else { |
| 116 | document.head.appendChild(placeholder); |
| 117 | } |
| 118 | } |
| 119 | this.placeholder = placeholder; |
| 120 | } |
| 121 | |
| 122 | applyText(content: string) { |
| 123 | if (this.lastContent === content) { |
nothing calls this directly
no test coverage detected