Skip to content

Commit 360db34

Browse files
author
Bart Veneman
committed
reduce bundle size by avoiding ?. syntax
1 parent 7463223 commit 360db34

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,11 @@ const analyze = (css) => {
309309
}
310310

311311
// i.e. `property: value\9`
312-
if (node.children?.last?.type === 'Identifier' && endsWith('\\9', node.children.last.name)) {
312+
if (node.children
313+
&& node.children.last
314+
&& node.children.last.type === 'Identifier'
315+
&& endsWith('\\9', node.children.last.name)
316+
) {
313317
valueBrowserhacks.push(stringifyNode(node))
314318
}
315319

src/values/values.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const keywords = {
88
}
99

1010
export function isValueKeyword(node) {
11-
const firstChild = node.children?.first
11+
if (!node.children) return false
12+
const firstChild = node.children.first
1213
if (!firstChild) return false
1314

1415
if (node.children.size > 1) return false

0 commit comments

Comments
 (0)