1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.mergeCollectionReadingOptions = exports.defaultCollectionReadingOptions = exports.mergeSeederConfig = exports.defaultSeederConfig = void 0;
|
4 | const extend = require("extend");
|
5 | const database_1 = require("./database");
|
6 |
|
7 |
|
8 |
|
9 | exports.defaultSeederConfig = {
|
10 | database: database_1.defaultDatabaseConfigObject,
|
11 | databaseReconnectTimeout: 10000,
|
12 | dropDatabase: false,
|
13 | dropCollections: false,
|
14 | removeAllDocuments: false,
|
15 | };
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | const mergeSeederConfig = (partial, previous) => {
|
23 | const source = previous ? previous : exports.defaultSeederConfig;
|
24 | if (!partial) {
|
25 | return source;
|
26 | }
|
27 | const config = {};
|
28 | return extend(true, config, source, partial);
|
29 | };
|
30 | exports.mergeSeederConfig = mergeSeederConfig;
|
31 |
|
32 |
|
33 |
|
34 | exports.defaultCollectionReadingOptions = {
|
35 | extensions: ['json', 'js', 'cjs'],
|
36 | ejsonParseOptions: {
|
37 | relaxed: true,
|
38 | },
|
39 | transformers: [],
|
40 | };
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 | const mergeCollectionReadingOptions = (partial, previous) => {
|
48 | const source = previous ? previous : exports.defaultCollectionReadingOptions;
|
49 | if (!partial) {
|
50 | return source;
|
51 | }
|
52 | const config = {};
|
53 | return extend(true, config, source, partial);
|
54 | };
|
55 | exports.mergeCollectionReadingOptions = mergeCollectionReadingOptions;
|
56 |
|
\ | No newline at end of file |