123456789101112131415 |
- "use strict";
- exports.__esModule = true;
- var point_1 = require("../factories/point");
- function transformOffset(offset, context) {
- // istanbul ignore next
- if (offset < 0) {
- offset = 0;
- }
- else if (offset > context.text.length) {
- offset = context.text.length;
- }
- var location = context.locator.locationForIndex(offset);
- return point_1.createPoint(offset, location.line + 1, location.column + 1);
- }
- exports.transformOffset = transformOffset;
|