UNPKG

typescript-tslint-plugin

Version:
26 lines 786 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConfigFileWatcher = void 0; class ConfigFileWatcher { constructor(ts, onChange) { this.ts = ts; this.onChange = onChange; this._watchedConfigs = new Set(); } ensureWatching(file) { if (!this.ts.sys.watchFile) { return; } if (this._watchedConfigs.has(file)) { return; } this._watchedConfigs.add(file); this.ts.sys.watchFile(file, (fileName, eventKind) => { if (eventKind === this.ts.FileWatcherEventKind.Changed) { this.onChange(fileName); } }); } } exports.ConfigFileWatcher = ConfigFileWatcher; //# sourceMappingURL=configFileWatcher.js.map