Skip to content

Commit

Permalink
Refactor to improve bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 3, 2020
1 parent 55c0953 commit a7143fa
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,11 @@ function stringify(value) {
}

function point(point) {
if (!point || typeof point !== 'object') {
point = {}
}

return index(point.line) + ':' + index(point.column)
return index(point && point.line) + ':' + index(point && point.column)
}

function position(pos) {
if (!pos || typeof pos !== 'object') {
pos = {}
}

return point(pos.start) + '-' + point(pos.end)
return point(pos && pos.start) + '-' + point(pos && pos.end)
}

function index(value) {
Expand Down

0 comments on commit a7143fa

Please sign in to comment.