Skip to content

Commit a7143fa

Browse files
committed
Refactor to improve bundle size
1 parent 55c0953 commit a7143fa

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

index.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,11 @@ function stringify(value) {
3030
}
3131

3232
function point(point) {
33-
if (!point || typeof point !== 'object') {
34-
point = {}
35-
}
36-
37-
return index(point.line) + ':' + index(point.column)
33+
return index(point && point.line) + ':' + index(point && point.column)
3834
}
3935

4036
function position(pos) {
41-
if (!pos || typeof pos !== 'object') {
42-
pos = {}
43-
}
44-
45-
return point(pos.start) + '-' + point(pos.end)
37+
return point(pos && pos.start) + '-' + point(pos && pos.end)
4638
}
4739

4840
function index(value) {

0 commit comments

Comments
 (0)