Skip to content

Commit fd4d328

Browse files
committed
fix(index): check node.selector
1 parent 16fb30e commit fd4d328

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ module.exports = (input /*: string */) /*: Set<string> */ => {
1818

1919
const result = parser.parse(input)
2020
for (const node of result.nodes) {
21-
selectorParser(transform).processSync(node.selector)
21+
if (node.selector) {
22+
selectorParser(transform).processSync(node.selector)
23+
}
2224
}
2325

2426
return set

test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ test('return class names', () => {
1010
.testCase {
1111
color: white;
1212
}
13+
@keyframes App-logo-spin {
14+
from { transform: rotate(0deg); }
15+
to { transform: rotate(360deg); }
16+
}
1317
`
1418
expect(m(css)).toEqual(new Set(['a', 'b', 'c', 'testCase']))
1519
})

0 commit comments

Comments
 (0)