Skip to content

Commit 9085ed4

Browse files
committed
Refactor to improve bundle size
1 parent b956b3a commit 9085ed4

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

index.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
module.exports = generated
44

55
function generated(node) {
6-
var position = optional(optional(node).position)
7-
var start = optional(position.start)
8-
var end = optional(position.end)
9-
10-
return !start.line || !start.column || !end.line || !end.column
11-
}
12-
13-
function optional(value) {
14-
return value && typeof value === 'object' ? value : {}
6+
return (
7+
!node ||
8+
!node.position ||
9+
!node.position.start ||
10+
!node.position.start.line ||
11+
!node.position.start.column ||
12+
!node.position.end ||
13+
!node.position.end.line ||
14+
!node.position.end.column
15+
)
1516
}

0 commit comments

Comments
 (0)