Skip to content

Commit

Permalink
Always assume loc in document
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Nov 13, 2024
1 parent 1ea2e3a commit 9e4df79
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions scripts/codemods/data-masking/unmask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ function applyIndentationFromOriginalQuery(
document: DocumentNode
) {
const lines = source.split("\n");
const locationOffset =
document.loc?.source.locationOffset.line ??
lines.findIndex((line) => /\S/.test(line));
const locationOffset = document.loc!.source.locationOffset.line;

const leadingWhitespace = getMatch(source, /^[\s]*(?=\S)/);
const trailingWhitespace = getMatch(source, TRAILING_WHITESPACE);
Expand Down

0 comments on commit 9e4df79

Please sign in to comment.