1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 |
|
8 |
|
9 | function validateOptions(options) {
|
10 |
|
11 | options.dest = options.dest || 'carte-blanche';
|
12 |
|
13 | options.dest = options.dest.replace(/^\/|\\/gi, '');
|
14 |
|
15 | options.filter = options.filter || /(\/[A-Z][a-zA-Z]*.?\/index|\/[A-Z][a-zA-Z]*)\.(jsx?|es6|react\.jsx?)$/;
|
16 |
|
17 |
|
18 | if (!options.componentRoot) {
|
19 | throw new Error('You need to specify where your components are in the "componentRoot" option!\n\n');
|
20 | }
|
21 |
|
22 |
|
23 | if (options.plugins && !Array.isArray(options.plugins)) {
|
24 | throw new Error('The "plugins" option needs to be an array!\n\n');
|
25 | }
|
26 |
|
27 |
|
28 | if (options.files && !Array.isArray(options.files)) {
|
29 | throw new Error('The "files" option needs to be an array!\n\n');
|
30 | }
|
31 | }
|
32 |
|
33 | exports.default = validateOptions; |
\ | No newline at end of file |