1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports.default = void 0;
|
5 |
|
6 |
|
7 |
|
8 | var _default = (moduleName, err) => {
|
9 |
|
10 |
|
11 | if (err.code === `QUALIFIED_PATH_RESOLUTION_FAILED` || err.pnpCode === `QUALIFIED_PATH_RESOLUTION_FAILED`) {
|
12 | return true;
|
13 | }
|
14 |
|
15 | const regex = new RegExp(`Error:\\s(\\S+\\s)?[Cc]annot find module\\s.${moduleName.replace(/[-/\\^$*+?.()|[\]{}]/g, `\\$&`)}`);
|
16 | const firstLine = err.toString().split(`\n`)[0];
|
17 | return regex.test(firstLine);
|
18 | };
|
19 |
|
20 | exports.default = _default;
|
21 |
|
\ | No newline at end of file |