aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@babel/core/lib/config/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/core/lib/config/util.js')
-rw-r--r--node_modules/@babel/core/lib/config/util.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/node_modules/@babel/core/lib/config/util.js b/node_modules/@babel/core/lib/config/util.js
new file mode 100644
index 0000000..1fc2d3d
--- /dev/null
+++ b/node_modules/@babel/core/lib/config/util.js
@@ -0,0 +1,31 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isIterableIterator = isIterableIterator;
+exports.mergeOptions = mergeOptions;
+
+function mergeOptions(target, source) {
+ for (const k of Object.keys(source)) {
+ if ((k === "parserOpts" || k === "generatorOpts" || k === "assumptions") && source[k]) {
+ const parserOpts = source[k];
+ const targetObj = target[k] || (target[k] = {});
+ mergeDefaultFields(targetObj, parserOpts);
+ } else {
+ const val = source[k];
+ if (val !== undefined) target[k] = val;
+ }
+ }
+}
+
+function mergeDefaultFields(target, source) {
+ for (const k of Object.keys(source)) {
+ const val = source[k];
+ if (val !== undefined) target[k] = val;
+ }
+}
+
+function isIterableIterator(value) {
+ return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function";
+} \ No newline at end of file