MCPcopy Create free account
hub / github.com/babel/babel / sourceToOffsetPos

Method sourceToOffsetPos

packages/babel-parser/src/parser/base.ts:42–44  ·  view source on GitHub ↗
(sourcePos: number)

Source from the content-addressed store, hash-verified

40 declare comments: N.Comment[];
41
42 sourceToOffsetPos(sourcePos: number) {
43 return sourcePos + this.startIndex;
44 }
45
46 offsetToSourcePos(offsetPos: number) {
47 return offsetPos - this.startIndex;

Callers 6

parseLabeledStatementFunction · 0.80
skipBlockCommentFunction · 0.80
skipLineCommentFunction · 0.80
skipSpaceFunction · 0.80
readTemplateTokenFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected