diff options
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js index 0ab00eb..671b580 100644 --- a/src/utils.js +++ b/src/utils.js | |||
@@ -1,5 +1,16 @@ | |||
1 | const path = require('path'); | 1 | const path = require('path'); |
2 | 2 | ||
3 | exports.PscError = class PscError extends Error { | ||
4 | constructor(message, modules) { | ||
5 | super(message); | ||
6 | this.modules = modules; | ||
7 | } | ||
8 | |||
9 | static get name() { | ||
10 | return 'PscError'; | ||
11 | } | ||
12 | }; | ||
13 | |||
3 | const repeat = (value, times) => | 14 | const repeat = (value, times) => |
4 | times <= 0 ? [] : [value, ...repeat(value, times - 1)]; | 15 | times <= 0 ? [] : [value, ...repeat(value, times - 1)]; |
5 | const diffPursModuleNames = (from, target, parts) => { | 16 | const diffPursModuleNames = (from, target, parts) => { |