Skip to content

Commit 180ccf0

Browse files
committed
Fix coverage
1 parent f0251f7 commit 180ccf0

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

libs/extractor/src/extractor/extract_global_style_from_expression.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,22 @@ pub fn extract_global_style_from_expression<'a>(
3131

3232
if let Expression::ObjectExpression(obj) = expression {
3333
for p in obj.properties.iter_mut() {
34-
if let ObjectPropertyKind::ObjectProperty(o) = p {
35-
let name = if let PropertyKey::StaticIdentifier(ident) = &o.key {
36-
ident.name.to_string()
34+
if let ObjectPropertyKind::ObjectProperty(o) = p
35+
&& let Some(name) = if let PropertyKey::StaticIdentifier(ident) = &o.key {
36+
Some(ident.name.to_string())
3737
} else if let PropertyKey::StringLiteral(s) = &o.key {
38-
s.value.to_string()
38+
Some(s.value.to_string())
3939
} else if let PropertyKey::TemplateLiteral(t) = &o.key {
40-
t.quasis
41-
.iter()
42-
.map(|q| q.value.raw.as_str())
43-
.collect::<String>()
40+
Some(
41+
t.quasis
42+
.iter()
43+
.map(|q| q.value.raw.as_str())
44+
.collect::<String>(),
45+
)
4446
} else {
45-
continue;
46-
};
47-
47+
None
48+
}
49+
{
4850
if name == "imports" {
4951
if let Expression::ArrayExpression(arr) = &o.value {
5052
for p in arr.elements.iter() {

0 commit comments

Comments
 (0)