UNPKG

scanpack

Version:

Dependency scanner to detect unknown or malicious packages in Node.js and Bun projects

30 lines 1.01 kB
import { existsSync } from 'node:fs'; import { join } from 'node:path'; export class IgnoreListAdapter { fileSystem; projectPath; constructor(fileSystem, projectPath) { this.fileSystem = fileSystem; this.projectPath = projectPath; } getIgnoreList() { const ignoreList = []; // Check for .scanpackignore file const ignoreFilePath = join(this.projectPath, '.scanpackignore'); if (existsSync(ignoreFilePath)) { try { const content = this.fileSystem.readFileSync(ignoreFilePath); const lines = content .split('\n') .map(line => line.trim()) .filter(line => line && !line.startsWith('#')); ignoreList.push(...lines); } catch (error) { // Silently fail if can't read ignore file } } return ignoreList; } } //# sourceMappingURL=ignore-list.adapter.js.map