fix(#10923): allow direct literal class name

This commit is contained in:
Acid Chicken (硫酸鶏) 2023-05-31 20:56:04 +09:00
parent c7babde4a1
commit 843586d468
No known key found for this signature in database
GPG Key ID: 3E87B98A3F6BAB99
1 changed files with 1 additions and 0 deletions

View File

@ -81,6 +81,7 @@ export function unwindCssModuleClassName(ast: estree.Node): void {
const moduleTree = new Map(cssModuleTreeNode.declarations[0].init.properties.flatMap((property) => {
if (property.type !== 'Property') return [];
if (property.key.type !== 'Identifier') return [];
if (property.value.type === 'Literal') return [[property.key.name, property.value.value as string]];
if (property.value.type !== 'Identifier') return [];
const labelledValue = property.value.name;
const actualValue = parent.body.find((x) => {