Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
fix: column should start with 0
Browse files Browse the repository at this point in the history
  • Loading branch information
KengoTODA committed Mar 16, 2022
1 parent a90c09b commit de64d90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function parse(text: string): TxtParentNode {
loc: {
start: {
line: 1,
column: 1,
column: 0,
},
end: {
line: linesLength,
Expand All @@ -73,7 +73,7 @@ function getChild(value: string, rawData: string, indNum: number, tempText: stri
loc: {
start: {
line: documentData.startLine,
column: 1,
column: 0,
},
end: {
line: documentData.endLine,
Expand Down
6 changes: 3 additions & 3 deletions test/multiline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"loc": {
"start": {
"line": 1,
"column": 1
"column": 0
},
"end": {
"line": 32,
Expand All @@ -21,7 +21,7 @@
"loc": {
"start": {
"line": 22,
"column": 1
"column": 0
},
"end": {
"line": 24,
Expand All @@ -38,7 +38,7 @@
"loc": {
"start": {
"line": 30,
"column": 1
"column": 0
},
"end": {
"line": 32,
Expand Down
6 changes: 3 additions & 3 deletions test/singleline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"loc": {
"start": {
"line": 1,
"column": 1
"column": 0
},
"end": {
"line": 24,
Expand All @@ -21,7 +21,7 @@
"loc": {
"start": {
"line": 20,
"column": 1
"column": 0
},
"end": {
"line": 20,
Expand All @@ -38,7 +38,7 @@
"loc": {
"start": {
"line": 24,
"column": 1
"column": 0
},
"end": {
"line": 24,
Expand Down

0 comments on commit de64d90

Please sign in to comment.