From 78ebd0d3b1614ccd0a7b90a820b386955037a20a Mon Sep 17 00:00:00 2001 From: ivojawer Date: Sun, 23 Jun 2024 21:53:12 -0300 Subject: [PATCH] lint --- src/extensions.ts | 1 - src/parser.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/extensions.ts b/src/extensions.ts index 986cbe19..7b17e03e 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -1,4 +1,3 @@ -import {EOL} from 'os' export const keys = Object.keys as (o: T) => (Extract)[] export const last = (xs: ReadonlyArray): T | undefined => xs[xs.length - 1] diff --git a/src/parser.ts b/src/parser.ts index 0b43b5bf..2329d328 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -130,14 +130,14 @@ export const sanitizeWhitespaces = (originalFrom: SourceIndex, originalTo: Sourc to.line-- const nodeLines = input.substring(from.offset, to.offset - EOL.length).split(EOL) const lastLine = nodeLines.pop()! - to.column = lastLine.length + ( nodeLines.length == 0 ? + to.column = lastLine.length + ( nodeLines.length == 0 ? from.column // one-line : 1 // base 1 ) to.offset -= EOL.length } else { to.column-- - to.offset--; + to.offset-- } } return [from, to]