(
candidateValue: string,
themeKeys: ThemeKey[],
nestedKeys: `--${string}`[] = [],
)
| 243 | } |
| 244 | |
| 245 | resolveWith( |
| 246 | candidateValue: string, |
| 247 | themeKeys: ThemeKey[], |
| 248 | nestedKeys: `--${string}`[] = [], |
| 249 | ): [string, Record<string, string>] | null { |
| 250 | let themeKey = this.#resolveKey(candidateValue, themeKeys) |
| 251 | |
| 252 | if (!themeKey) return null |
| 253 | |
| 254 | let extra = {} as Record<string, string> |
| 255 | for (let name of nestedKeys) { |
| 256 | let nestedKey = `${themeKey}${name}` |
| 257 | let nestedValue = this.values.get(nestedKey)! |
| 258 | if (!nestedValue) continue |
| 259 | |
| 260 | if (nestedValue.options & ThemeOptions.INLINE) { |
| 261 | extra[name] = nestedValue.value |
| 262 | } else { |
| 263 | extra[name] = this.#var(nestedKey)! |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | let value = this.values.get(themeKey)! |
| 268 | |
| 269 | if (value.options & ThemeOptions.INLINE) { |
| 270 | return [value.value, extra] |
| 271 | } |
| 272 | |
| 273 | return [this.#var(themeKey)!, extra] |
| 274 | } |
| 275 | |
| 276 | namespace(namespace: string) { |
| 277 | let values = new Map<string | null, string>() |
no test coverage detected