UNPKG

579 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = createDependencyLocation;
7
8function createDependencyLocation(start, moduleSpecifier, lineOffset = 0, columnOffset = 0, // Imports are usually wrapped in quotes
9importWrapperLength = 2) {
10 return {
11 filePath: moduleSpecifier,
12 start: {
13 line: start.line + lineOffset,
14 column: start.column + columnOffset
15 },
16 end: {
17 line: start.line + lineOffset,
18 column: start.column + moduleSpecifier.length - 1 + importWrapperLength + columnOffset
19 }
20 };
21}
\No newline at end of file