1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.isIterableIterator = isIterableIterator;
|
7 | exports.mergeOptions = mergeOptions;
|
8 |
|
9 | function mergeOptions(target, source) {
|
10 | for (const k of Object.keys(source)) {
|
11 | if ((k === "parserOpts" || k === "generatorOpts" || k === "assumptions") && source[k]) {
|
12 | const parserOpts = source[k];
|
13 | const targetObj = target[k] || (target[k] = {});
|
14 | mergeDefaultFields(targetObj, parserOpts);
|
15 | } else {
|
16 | const val = source[k];
|
17 | if (val !== undefined) target[k] = val;
|
18 | }
|
19 | }
|
20 | }
|
21 |
|
22 | function mergeDefaultFields(target, source) {
|
23 | for (const k of Object.keys(source)) {
|
24 | const val = source[k];
|
25 | if (val !== undefined) target[k] = val;
|
26 | }
|
27 | }
|
28 |
|
29 | function isIterableIterator(value) {
|
30 | return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function";
|
31 | } |
\ | No newline at end of file |