(candidateValue: string | null, themeKeys: ThemeKey[])
| 166 | } |
| 167 | |
| 168 | #resolveKey(candidateValue: string | null, themeKeys: ThemeKey[]): string | null { |
| 169 | for (let namespace of themeKeys) { |
| 170 | let themeKey = |
| 171 | candidateValue !== null ? (`${namespace}-${candidateValue}` as ThemeKey) : namespace |
| 172 | |
| 173 | if (!this.values.has(themeKey)) { |
| 174 | // If the exact theme key is not found, we might be trying to resolve a key containing a dot |
| 175 | // that was registered with an underscore instead: |
| 176 | if (candidateValue !== null && candidateValue.includes('.')) { |
| 177 | themeKey = `${namespace}-${candidateValue.replaceAll('.', '_')}` as ThemeKey |
| 178 | |
| 179 | if (!this.values.has(themeKey)) continue |
| 180 | } else { |
| 181 | continue |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | if (isIgnoredThemeKey(themeKey, namespace)) continue |
| 186 | |
| 187 | return themeKey |
| 188 | } |
| 189 | |
| 190 | return null |
| 191 | } |
| 192 | |
| 193 | #var(themeKey: string) { |
| 194 | let value = this.values.get(themeKey) |
no test coverage detected