Correct return type for getLocFromIndex

This commit is contained in:
Benjamin Lichtman
2018-10-23 17:17:04 -07:00
parent 3b01bb29b1
commit e4d310be5c
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -62,7 +62,9 @@ sourceCode.getNodeByRangeIndex(0);
sourceCode.isSpaceBetweenTokens(TOKEN, TOKEN);
sourceCode.getLocFromIndex(0);
const loc = sourceCode.getLocFromIndex(0);
loc.line; // $ExpectType number
loc.column; // $ExpectType number
sourceCode.getIndexFromLoc({ line: 0, column: 0 });
+1 -1
View File
@@ -136,7 +136,7 @@ export class SourceCode {
isSpaceBetweenTokens(first: AST.Token, second: AST.Token): boolean;
getLocFromIndex(index: number): ESTree.SourceLocation;
getLocFromIndex(index: number): ESTree.Position;
getIndexFromLoc(location: ESTree.Position): number;