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

Function createPositionWithColumnOffset

packages/babel-parser/src/util/location.ts:39–45  ·  view source on GitHub ↗
(
  position: Position,
  columnOffset: number,
)

Source from the content-addressed store, hash-verified

37 * function does not skip whitespaces.
38 */
39export function createPositionWithColumnOffset(
40 position: Position,
41 columnOffset: number,
42) {
43 const { line, column, index } = position;
44 return new Position(line, column + columnOffset, index + columnOffset);
45}

Callers 10

babel7CompatTokensFunction · 0.90
parseProgramFunction · 0.90
parsePrivateNameFunction · 0.90
parseTemplateElementFunction · 0.90
parseMaybeAssignMethod · 0.90
readRegexpFunction · 0.90
nextPosFunction · 0.90
readRadixNumberFunction · 0.90
readNumberFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected