Skip to content

Commit a244a17

Browse files
authoredNov 21, 2021
Fix dependency on lines-and-columns (#33)
1 parent 0b526f2 commit a244a17

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed
 

‎index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import errorEx from 'error-ex';
22
import fallback from 'json-parse-even-better-errors';
33
import {codeFrameColumns} from '@babel/code-frame';
4-
import LinesAndColumns from 'lines-and-columns';
4+
import {LinesAndColumns} from 'lines-and-columns';
55

66
export const JSONError = errorEx('JSONError', {
77
fileName: errorEx.append('in %s'),
@@ -31,8 +31,7 @@ export default function parseJson(string, reviver, filename) {
3131
}
3232

3333
if (indexMatch && indexMatch.length > 0) {
34-
// eslint-disable-next-line new-cap
35-
const lines = new LinesAndColumns.default(string);
34+
const lines = new LinesAndColumns(string);
3635
const index = Number(indexMatch[1]);
3736
const location = lines.locationForIndex(index);
3837

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@babel/code-frame": "^7.16.0",
3838
"error-ex": "^1.3.2",
3939
"json-parse-even-better-errors": "^2.3.1",
40-
"lines-and-columns": "^1.1.6"
40+
"lines-and-columns": "^2.0.2"
4141
},
4242
"devDependencies": {
4343
"ava": "^3.15.0",

0 commit comments

Comments
 (0)
Please sign in to comment.