UNPKG

@appworks/doctor

Version:

Analyse and running codemods over react/rax projects, troubleshooting and automatically fixing errors

46 lines (45 loc) 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Doctor = void 0; var path = require("path"); var getFiles_1 = require("./getFiles"); var Analyzer_1 = require("./Analyzer"); var Scanner_1 = require("./Scanner"); // Ignore directories var defaultIgnore = [ '.faas_debug_tmp', '.ice', '.rax', 'build', 'es', 'dist', 'lib', 'mocks', 'logs', 'coverage', 'node_modules', 'demo', 'examples', 'public', 'test', '__tests__', ]; var Doctor = /** @class */ (function () { function Doctor(options) { this.options = options || {}; this.ignore = defaultIgnore.concat(this.options.ignore || []); this.scanner = new Scanner_1.default({ ignore: this.ignore }); this.analyzer = new Analyzer_1.default({ ignore: this.ignore }); } Doctor.prototype.scan = function (directory, options) { return this.scanner.scan(path.isAbsolute(directory) ? directory : path.join(process.cwd(), directory), options); }; Doctor.prototype.analyse = function (directory) { return this.analyzer.analyse(directory); }; Doctor.prototype.getFiles = function (directory) { return getFiles_1.default(directory, this.ignore); }; return Doctor; }()); exports.Doctor = Doctor;