@modern-js/babel-compiler 2.15.0 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,137 +1,145 @@
1
- function _arrayLikeToArray(arr, len) {
2
- if (len == null || len > arr.length) len = arr.length;
3
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
- return arr2;
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length)
3
+ len = arr.length;
4
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
5
+ arr2[i] = arr[i];
6
+ return arr2;
5
7
  }
6
- function _arrayWithoutHoles(arr) {
7
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
8
+ function _array_without_holes(arr) {
9
+ if (Array.isArray(arr))
10
+ return _array_like_to_array(arr);
8
11
  }
9
- function _defineProperty(obj, key, value) {
10
- if (key in obj) {
11
- Object.defineProperty(obj, key, {
12
- value: value,
13
- enumerable: true,
14
- configurable: true,
15
- writable: true
16
- });
17
- } else {
18
- obj[key] = value;
19
- }
20
- return obj;
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
22
+ }
23
+ return obj;
21
24
  }
22
- function _iterableToArray(iter) {
23
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
25
+ function _iterable_to_array(iter) {
26
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
27
+ return Array.from(iter);
24
28
  }
25
- function _nonIterableSpread() {
26
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
29
+ function _non_iterable_spread() {
30
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
27
31
  }
28
- function _objectSpread(target) {
29
- for(var i = 1; i < arguments.length; i++){
30
- var source = arguments[i] != null ? arguments[i] : {};
31
- var ownKeys = Object.keys(source);
32
- if (typeof Object.getOwnPropertySymbols === "function") {
33
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
34
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
35
- }));
36
- }
37
- ownKeys.forEach(function(key) {
38
- _defineProperty(target, key, source[key]);
39
- });
32
+ function _object_spread(target) {
33
+ for (var i = 1; i < arguments.length; i++) {
34
+ var source = arguments[i] != null ? arguments[i] : {};
35
+ var ownKeys2 = Object.keys(source);
36
+ if (typeof Object.getOwnPropertySymbols === "function") {
37
+ ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
38
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
39
+ }));
40
40
  }
41
- return target;
41
+ ownKeys2.forEach(function(key) {
42
+ _define_property(target, key, source[key]);
43
+ });
44
+ }
45
+ return target;
42
46
  }
43
47
  function ownKeys(object, enumerableOnly) {
44
- var keys = Object.keys(object);
45
- if (Object.getOwnPropertySymbols) {
46
- var symbols = Object.getOwnPropertySymbols(object);
47
- if (enumerableOnly) {
48
- symbols = symbols.filter(function(sym) {
49
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
50
- });
51
- }
52
- keys.push.apply(keys, symbols);
48
+ var keys = Object.keys(object);
49
+ if (Object.getOwnPropertySymbols) {
50
+ var symbols = Object.getOwnPropertySymbols(object);
51
+ if (enumerableOnly) {
52
+ symbols = symbols.filter(function(sym) {
53
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
54
+ });
53
55
  }
54
- return keys;
56
+ keys.push.apply(keys, symbols);
57
+ }
58
+ return keys;
55
59
  }
56
- function _objectSpreadProps(target, source) {
57
- source = source != null ? source : {};
58
- if (Object.getOwnPropertyDescriptors) {
59
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
60
- } else {
61
- ownKeys(Object(source)).forEach(function(key) {
62
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
63
- });
64
- }
65
- return target;
60
+ function _object_spread_props(target, source) {
61
+ source = source != null ? source : {};
62
+ if (Object.getOwnPropertyDescriptors) {
63
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
64
+ } else {
65
+ ownKeys(Object(source)).forEach(function(key) {
66
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
67
+ });
68
+ }
69
+ return target;
66
70
  }
67
- function _toConsumableArray(arr) {
68
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
71
+ function _to_consumable_array(arr) {
72
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
69
73
  }
70
- function _unsupportedIterableToArray(o, minLen) {
71
- if (!o) return;
72
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
73
- var n = Object.prototype.toString.call(o).slice(8, -1);
74
- if (n === "Object" && o.constructor) n = o.constructor.name;
75
- if (n === "Map" || n === "Set") return Array.from(n);
76
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
74
+ function _unsupported_iterable_to_array(o, minLen) {
75
+ if (!o)
76
+ return;
77
+ if (typeof o === "string")
78
+ return _array_like_to_array(o, minLen);
79
+ var n = Object.prototype.toString.call(o).slice(8, -1);
80
+ if (n === "Object" && o.constructor)
81
+ n = o.constructor.name;
82
+ if (n === "Map" || n === "Set")
83
+ return Array.from(n);
84
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
85
+ return _array_like_to_array(o, minLen);
77
86
  }
78
87
  import { glob } from "@modern-js/utils";
79
88
  import { DEFAULT_EXTENSIONS } from "@babel/core";
80
89
  import { mergeDefaultOption } from "./defaults";
81
- var getGlobPattern = function(dir, extensions) {
82
- if (extensions.length > 1) {
83
- return "".concat(dir, "/**/*{").concat(extensions.join(","), "}");
84
- } else if (extensions.length === 1) {
85
- return "".concat(dir, "/**/*").concat(extensions[0]);
86
- } else {
87
- return "".concat(dir, "/**/*");
88
- }
90
+ export var getGlobPattern = function(dir, extensions) {
91
+ if (extensions.length > 1) {
92
+ return "".concat(dir, "/**/*{").concat(extensions.join(","), "}");
93
+ } else if (extensions.length === 1) {
94
+ return "".concat(dir, "/**/*").concat(extensions[0]);
95
+ } else {
96
+ return "".concat(dir, "/**/*");
97
+ }
89
98
  };
90
- var getFinalExtensions = function(extensions) {
91
- var isExtensions = function(ext) {
92
- return Array.isArray(ext);
93
- };
94
- var isExtensionsFunc = function(ext) {
95
- return typeof ext === "function";
96
- };
97
- if (isExtensions(extensions)) {
98
- return _toConsumableArray(extensions).concat(_toConsumableArray(DEFAULT_EXTENSIONS));
99
- } else if (isExtensionsFunc(extensions)) {
100
- return extensions(DEFAULT_EXTENSIONS);
101
- } else {
102
- return DEFAULT_EXTENSIONS;
103
- }
99
+ export var getFinalExtensions = function(extensions) {
100
+ var isExtensions = function(ext) {
101
+ return Array.isArray(ext);
102
+ };
103
+ var isExtensionsFunc = function(ext) {
104
+ return typeof ext === "function";
105
+ };
106
+ if (isExtensions(extensions)) {
107
+ return _to_consumable_array(extensions).concat(_to_consumable_array(DEFAULT_EXTENSIONS));
108
+ } else if (isExtensionsFunc(extensions)) {
109
+ return extensions(DEFAULT_EXTENSIONS);
110
+ } else {
111
+ return DEFAULT_EXTENSIONS;
112
+ }
104
113
  };
105
- var getFilesFromDir = function(param) {
106
- var dir = param.dir, _param_finalExt = param.finalExt, finalExt = _param_finalExt === void 0 ? [] : _param_finalExt, _param_ignore = param.ignore, ignore = _param_ignore === void 0 ? [] : _param_ignore;
107
- var globFindFilenames = [];
108
- var globPattern = getGlobPattern(dir, finalExt);
109
- globFindFilenames = glob.sync(globPattern, {
110
- ignore: ignore
111
- });
112
- return globFindFilenames;
114
+ export var getFilesFromDir = function(param) {
115
+ var dir = param.dir, _param_finalExt = param.finalExt, finalExt = _param_finalExt === void 0 ? [] : _param_finalExt, _param_ignore = param.ignore, ignore = _param_ignore === void 0 ? [] : _param_ignore;
116
+ var globFindFilenames = [];
117
+ var globPattern = getGlobPattern(dir, finalExt);
118
+ globFindFilenames = glob.sync(globPattern, {
119
+ ignore
120
+ });
121
+ return globFindFilenames;
113
122
  };
114
- var getFinalCompilerOption = function(option) {
115
- var optionWithDefault = mergeDefaultOption(option);
116
- var sourceDir = option.sourceDir, ignore = option.ignore, _option_enableWatch = option.enableWatch, enableWatch = _option_enableWatch === void 0 ? false : _option_enableWatch, watchDir = option.watchDir, _option_extensions = option.extensions, extensions = _option_extensions === void 0 ? DEFAULT_EXTENSIONS : _option_extensions;
117
- var globFindFilenames = [];
118
- var finalExt = getFinalExtensions(extensions);
119
- if (sourceDir) {
120
- globFindFilenames = getFilesFromDir({
121
- dir: sourceDir,
122
- ignore: ignore,
123
- finalExt: finalExt
124
- });
125
- }
126
- if (enableWatch) {
127
- globFindFilenames = getFilesFromDir({
128
- dir: watchDir,
129
- ignore: ignore,
130
- finalExt: finalExt
131
- });
132
- }
133
- return _objectSpreadProps(_objectSpread({}, optionWithDefault), {
134
- filenames: _toConsumableArray(optionWithDefault.filenames).concat(_toConsumableArray(globFindFilenames))
123
+ export var getFinalCompilerOption = function(option) {
124
+ var optionWithDefault = mergeDefaultOption(option);
125
+ var sourceDir = option.sourceDir, ignore = option.ignore, _option_enableWatch = option.enableWatch, enableWatch = _option_enableWatch === void 0 ? false : _option_enableWatch, watchDir = option.watchDir, _option_extensions = option.extensions, extensions = _option_extensions === void 0 ? DEFAULT_EXTENSIONS : _option_extensions;
126
+ var globFindFilenames = [];
127
+ var finalExt = getFinalExtensions(extensions);
128
+ if (sourceDir) {
129
+ globFindFilenames = getFilesFromDir({
130
+ dir: sourceDir,
131
+ ignore,
132
+ finalExt
133
+ });
134
+ }
135
+ if (enableWatch) {
136
+ globFindFilenames = getFilesFromDir({
137
+ dir: watchDir,
138
+ ignore,
139
+ finalExt
135
140
  });
141
+ }
142
+ return _object_spread_props(_object_spread({}, optionWithDefault), {
143
+ filenames: _to_consumable_array(optionWithDefault.filenames).concat(_to_consumable_array(globFindFilenames))
144
+ });
136
145
  };
137
- export { getFilesFromDir, getFinalCompilerOption, getFinalExtensions, getGlobPattern };
package/dist/esm/index.js CHANGED
@@ -1,166 +1,172 @@
1
1
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
- try {
3
- var info = gen[key](arg);
4
- var value = info.value;
5
- } catch (error) {
6
- reject(error);
7
- return;
8
- }
9
- if (info.done) {
10
- resolve(value);
11
- } else {
12
- Promise.resolve(value).then(_next, _throw);
13
- }
2
+ try {
3
+ var info = gen[key](arg);
4
+ var value = info.value;
5
+ } catch (error) {
6
+ reject(error);
7
+ return;
8
+ }
9
+ if (info.done) {
10
+ resolve(value);
11
+ } else {
12
+ Promise.resolve(value).then(_next, _throw);
13
+ }
14
14
  }
15
- function _asyncToGenerator(fn) {
16
- return function() {
17
- var self = this, args = arguments;
18
- return new Promise(function(resolve, reject) {
19
- var gen = fn.apply(self, args);
20
- function _next(value) {
21
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
- }
23
- function _throw(err) {
24
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
- }
26
- _next(undefined);
27
- });
28
- };
15
+ function _async_to_generator(fn) {
16
+ return function() {
17
+ var self = this, args = arguments;
18
+ return new Promise(function(resolve, reject) {
19
+ var gen = fn.apply(self, args);
20
+ function _next(value) {
21
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
+ }
23
+ function _throw(err) {
24
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
+ }
26
+ _next(void 0);
27
+ });
28
+ };
29
29
  }
30
- var __generator = this && this.__generator || function(thisArg, body) {
31
- var f, y, t, g, _ = {
32
- label: 0,
33
- sent: function() {
34
- if (t[0] & 1) throw t[1];
35
- return t[1];
36
- },
37
- trys: [],
38
- ops: []
30
+ var __generator = function(thisArg, body) {
31
+ var f, y, t, g, _ = {
32
+ label: 0,
33
+ sent: function() {
34
+ if (t[0] & 1)
35
+ throw t[1];
36
+ return t[1];
37
+ },
38
+ trys: [],
39
+ ops: []
40
+ };
41
+ return g = {
42
+ next: verb(0),
43
+ "throw": verb(1),
44
+ "return": verb(2)
45
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
46
+ return this;
47
+ }), g;
48
+ function verb(n) {
49
+ return function(v) {
50
+ return step([
51
+ n,
52
+ v
53
+ ]);
39
54
  };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
- return this;
46
- }), g;
47
- function verb(n) {
48
- return function(v) {
49
- return step([
50
- n,
51
- v
52
- ]);
53
- };
54
- }
55
- function step(op) {
56
- if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
58
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
- if (y = 0, t) op = [
60
- op[0] & 2,
61
- t.value
62
- ];
63
- switch(op[0]){
64
- case 0:
65
- case 1:
66
- t = op;
67
- break;
68
- case 4:
69
- _.label++;
70
- return {
71
- value: op[1],
72
- done: false
73
- };
74
- case 5:
75
- _.label++;
76
- y = op[1];
77
- op = [
78
- 0
79
- ];
80
- continue;
81
- case 7:
82
- op = _.ops.pop();
83
- _.trys.pop();
84
- continue;
85
- default:
86
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
87
- _ = 0;
88
- continue;
89
- }
90
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
91
- _.label = op[1];
92
- break;
93
- }
94
- if (op[0] === 6 && _.label < t[1]) {
95
- _.label = t[1];
96
- t = op;
97
- break;
98
- }
99
- if (t && _.label < t[2]) {
100
- _.label = t[2];
101
- _.ops.push(op);
102
- break;
103
- }
104
- if (t[2]) _.ops.pop();
105
- _.trys.pop();
106
- continue;
107
- }
108
- op = body.call(thisArg, _);
109
- } catch (e) {
55
+ }
56
+ function step(op) {
57
+ if (f)
58
+ throw new TypeError("Generator is already executing.");
59
+ while (_)
60
+ try {
61
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
62
+ return t;
63
+ if (y = 0, t)
64
+ op = [
65
+ op[0] & 2,
66
+ t.value
67
+ ];
68
+ switch (op[0]) {
69
+ case 0:
70
+ case 1:
71
+ t = op;
72
+ break;
73
+ case 4:
74
+ _.label++;
75
+ return {
76
+ value: op[1],
77
+ done: false
78
+ };
79
+ case 5:
80
+ _.label++;
81
+ y = op[1];
110
82
  op = [
111
- 6,
112
- e
83
+ 0
113
84
  ];
114
- y = 0;
115
- } finally{
116
- f = t = 0;
85
+ continue;
86
+ case 7:
87
+ op = _.ops.pop();
88
+ _.trys.pop();
89
+ continue;
90
+ default:
91
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
92
+ _ = 0;
93
+ continue;
94
+ }
95
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
96
+ _.label = op[1];
97
+ break;
98
+ }
99
+ if (op[0] === 6 && _.label < t[1]) {
100
+ _.label = t[1];
101
+ t = op;
102
+ break;
103
+ }
104
+ if (t && _.label < t[2]) {
105
+ _.label = t[2];
106
+ _.ops.push(op);
107
+ break;
108
+ }
109
+ if (t[2])
110
+ _.ops.pop();
111
+ _.trys.pop();
112
+ continue;
117
113
  }
118
- if (op[0] & 5) throw op[1];
119
- return {
120
- value: op[0] ? op[1] : void 0,
121
- done: true
122
- };
123
- }
114
+ op = body.call(thisArg, _);
115
+ } catch (e) {
116
+ op = [
117
+ 6,
118
+ e
119
+ ];
120
+ y = 0;
121
+ } finally {
122
+ f = t = 0;
123
+ }
124
+ if (op[0] & 5)
125
+ throw op[1];
126
+ return {
127
+ value: op[0] ? op[1] : void 0,
128
+ done: true
129
+ };
130
+ }
124
131
  };
125
132
  import { getFinalCompilerOption } from "./getFinalOption";
126
133
  import { build } from "./build";
127
134
  import { buildWatch } from "./buildWatch";
128
135
  import { validate } from "./validate";
129
- function compiler(compilerOptions) {
130
- return _compiler.apply(this, arguments);
136
+ export function compiler(compilerOptions) {
137
+ return _compiler.apply(this, arguments);
131
138
  }
132
139
  function _compiler() {
133
- _compiler = _asyncToGenerator(function(compilerOptions) {
134
- var babelOptions, validRet, finalCompilerOption;
135
- var _arguments = arguments;
136
- return __generator(this, function(_state) {
137
- babelOptions = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
138
- validRet = validate(compilerOptions);
139
- if (validRet) {
140
- return [
141
- 2,
142
- validRet
143
- ];
144
- }
145
- finalCompilerOption = getFinalCompilerOption(compilerOptions);
146
- if (compilerOptions.enableWatch) {
147
- return [
148
- 2,
149
- buildWatch(finalCompilerOption, babelOptions)
150
- ];
151
- } else {
152
- return [
153
- 2,
154
- build(finalCompilerOption, babelOptions)
155
- ];
156
- }
157
- return [
158
- 2
159
- ];
160
- });
140
+ _compiler = _async_to_generator(function(compilerOptions) {
141
+ var babelOptions, validRet, finalCompilerOption;
142
+ var _arguments = arguments;
143
+ return __generator(this, function(_state) {
144
+ babelOptions = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
145
+ validRet = validate(compilerOptions);
146
+ if (validRet) {
147
+ return [
148
+ 2,
149
+ validRet
150
+ ];
151
+ }
152
+ finalCompilerOption = getFinalCompilerOption(compilerOptions);
153
+ if (compilerOptions.enableWatch) {
154
+ return [
155
+ 2,
156
+ buildWatch(finalCompilerOption, babelOptions)
157
+ ];
158
+ } else {
159
+ return [
160
+ 2,
161
+ build(finalCompilerOption, babelOptions)
162
+ ];
163
+ }
164
+ return [
165
+ 2
166
+ ];
161
167
  });
162
- return _compiler.apply(this, arguments);
168
+ });
169
+ return _compiler.apply(this, arguments);
163
170
  }
164
171
  export * from "./buildWatch";
165
172
  export * from "./type";
166
- export { compiler };
package/dist/esm/type.js CHANGED
@@ -1 +1 @@
1
- "use strict";
1
+ export {};
package/dist/esm/utils.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as path from "path";
2
- function addSourceMappingUrl(code, loc) {
3
- return "".concat(code, "\n//# sourceMappingURL=").concat(path.normalize(path.basename(loc)));
2
+ export function addSourceMappingUrl(code, loc) {
3
+ return "".concat(code, "\n//# sourceMappingURL=").concat(path.normalize(path.basename(loc)));
4
4
  }
5
- export { addSourceMappingUrl };
@@ -1,38 +1,37 @@
1
1
  import { logger } from "@modern-js/utils";
2
- var sourceDirAndFileNamesValidMessage = "At least one of the sourceDir and filenames configurations must be configured";
3
- var watchDirValidMessage = "should set watchDir when enableWatch is true";
4
- var validateSourceDirAndFileNames = function(compilerOptions) {
5
- var sourceDir = compilerOptions.sourceDir, filenames = compilerOptions.filenames, quiet = compilerOptions.quiet;
6
- if (!sourceDir && !filenames) {
7
- if (!quiet) {
8
- logger.error(sourceDirAndFileNamesValidMessage);
9
- }
10
- return {
11
- code: 1,
12
- message: sourceDirAndFileNamesValidMessage,
13
- virtualDists: []
14
- };
2
+ export var sourceDirAndFileNamesValidMessage = "At least one of the sourceDir and filenames configurations must be configured";
3
+ export var watchDirValidMessage = "should set watchDir when enableWatch is true";
4
+ export var validateSourceDirAndFileNames = function(compilerOptions) {
5
+ var sourceDir = compilerOptions.sourceDir, filenames = compilerOptions.filenames, quiet = compilerOptions.quiet;
6
+ if (!sourceDir && !filenames) {
7
+ if (!quiet) {
8
+ logger.error(sourceDirAndFileNamesValidMessage);
15
9
  }
16
- return null;
10
+ return {
11
+ code: 1,
12
+ message: sourceDirAndFileNamesValidMessage,
13
+ virtualDists: []
14
+ };
15
+ }
16
+ return null;
17
17
  };
18
- var validateWatchDir = function(compilerOptions) {
19
- var watchDir = compilerOptions.watchDir, enableWatch = compilerOptions.enableWatch, quiet = compilerOptions.quiet;
20
- if (enableWatch && !watchDir) {
21
- if (!quiet) {
22
- logger.error(watchDirValidMessage);
23
- }
24
- return {
25
- code: 1,
26
- message: watchDirValidMessage,
27
- virtualDists: []
28
- };
18
+ export var validateWatchDir = function(compilerOptions) {
19
+ var watchDir = compilerOptions.watchDir, enableWatch = compilerOptions.enableWatch, quiet = compilerOptions.quiet;
20
+ if (enableWatch && !watchDir) {
21
+ if (!quiet) {
22
+ logger.error(watchDirValidMessage);
29
23
  }
30
- return null;
24
+ return {
25
+ code: 1,
26
+ message: watchDirValidMessage,
27
+ virtualDists: []
28
+ };
29
+ }
30
+ return null;
31
31
  };
32
- var validate = function(compilerOptions) {
33
- if (compilerOptions.enableWatch) {
34
- return validateWatchDir(compilerOptions);
35
- }
36
- return validateSourceDirAndFileNames(compilerOptions);
32
+ export var validate = function(compilerOptions) {
33
+ if (compilerOptions.enableWatch) {
34
+ return validateWatchDir(compilerOptions);
35
+ }
36
+ return validateSourceDirAndFileNames(compilerOptions);
37
37
  };
38
- export { sourceDirAndFileNamesValidMessage, validate, validateSourceDirAndFileNames, validateWatchDir, watchDirValidMessage };