Skip to content

[I] PositionDetail

owner node and other related information according to the position

PropertyModifierTypeDescription
charreadonlynumberUTF-16 code unit at position, or NaN outside the source text.
getPositionDetailAfterTriviareadonly() => PositionDetailget the PositionDetail of positionAfterTrivia
getPositionDetailBeforeTriviareadonly() => PositionDetailget the PositionDetail of positionBeforeTrivia
inTriviareadonlybooleanWhether the position query identifies whitespace or comment trivia at this offset.
nextCharreadonlynumberUTF-16 code unit immediately after position, or NaN outside the source text.
nodereadonlyNode | undefinedMost specific node accepted by the position query, or undefined when none matches.
positionreadonlynumberQueried zero-based UTF-16 offset in the source file.
preCharreadonlynumberUTF-16 code unit immediately before position, or NaN outside the source text.
triviaEndPositionreadonlynumberif the position is in a trivia, return the end position (exclude as other ‘end’ means) of the trivia containing the position if the position is not a trivia, return the end position (exclude as other ‘end’ means) of the trivia after the node containing the position Please be aware that this may not be the next node in the tree because some non-trivia char is ignored in the tree but will considered here also comments are considered as trivia
triviaStartPositionreadonlynumberif the position is in a trivia, return the start position of the trivia containing the position if the position is not a trivia, return the start position of the trivia before the text(identifier code) containing the position Please be aware that this may not be the pre node in the tree because some non-trivia char is ignored in the tree but will counted here also comments are considered as trivia