UNPKG

refakts

Version:

TypeScript refactoring tool built for AI coding agents to perform precise refactoring operations via command line instead of requiring complete code regeneration.

25 lines 928 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RangeSelectionStrategy = void 0; const range_analyzer_1 = require("../services/range-analyzer"); class RangeSelectionStrategy { constructor() { this.rangeAnalyzer = new range_analyzer_1.RangeAnalyzer(); } canHandle(options) { return !!options.range; } async select(sourceFile, options) { return this.rangeAnalyzer.findRangeMatches(sourceFile, options); } validateOptions(options) { if (!options.startRegex && !options['start-regex']) { throw new Error('--start-regex must be specified with --range'); } if (!options.endRegex && !options['end-regex']) { throw new Error('--end-regex must be specified with --range'); } } } exports.RangeSelectionStrategy = RangeSelectionStrategy; //# sourceMappingURL=range-selection-strategy.js.map