Skip to content

Commit

Permalink
fix: revert
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Dec 2, 2022
1 parent 2e2aa7b commit a332c02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,9 @@ export function posToNumber(

export function numberToPos(
source: string,
offset: number
offset: number | { line: number; column: number }
): { line: number; column: number } {
if (typeof offset !== 'number') return offset
if (offset > source.length) {
throw new Error(
`offset is longer than source length! offset ${offset} > length ${source.length}`
Expand Down

0 comments on commit a332c02

Please sign in to comment.