UNPKG

400 BJavaScriptView Raw
1'use strict';
2
3class NoFilesFoundError extends Error {
4 /**
5 * @param {string|string[]} fileList
6 */
7 constructor(fileList) {
8 super();
9
10 if (typeof fileList === 'string') {
11 fileList = [fileList];
12 }
13
14 const pattern = fileList.filter((i) => !i.startsWith('!')).join(', ');
15
16 this.message = `No files matching the pattern "${pattern}" were found.`;
17 }
18}
19
20module.exports = NoFilesFoundError;