UNPKG

2.39 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.getRealmOptions = getRealmOptions;
7exports.getSerializerOptions = getSerializerOptions;
8
9var _realm = require("./realm.js");
10
11/**
12 * Copyright (c) 2017-present, Facebook, Inc.
13 * All rights reserved.
14 *
15 * This source code is licensed under the BSD-style license found in the
16 * LICENSE file in the root directory of this source tree. An additional grant
17 * of patent rights can be found in the PATENTS file in the same directory.
18 */
19
20/* strict-local */
21function getRealmOptions({
22 compatibility = "browser",
23 debugNames = false,
24 errorHandler,
25 mathRandomSeed,
26 invariantLevel = 0,
27 invariantMode = "throw",
28 emitConcreteModel = false,
29 uniqueSuffix,
30 instantRender,
31 reactEnabled,
32 reactOutput,
33 reactVerbose,
34 reactOptimizeNestedFunctions,
35 residual,
36 serialize = !residual,
37 check,
38 strictlyMonotonicDateNow,
39 stripFlow,
40 timeout,
41 maxStackDepth,
42 abstractValueImpliesMax,
43 debuggerConfigArgs
44}) {
45 return {
46 compatibility,
47 debugNames,
48 errorHandler,
49 mathRandomSeed,
50 invariantLevel,
51 invariantMode,
52 emitConcreteModel,
53 uniqueSuffix,
54 instantRender,
55 reactEnabled,
56 reactOutput,
57 reactVerbose,
58 reactOptimizeNestedFunctions,
59 residual,
60 serialize,
61 check,
62 strictlyMonotonicDateNow,
63 stripFlow,
64 timeout,
65 maxStackDepth,
66 abstractValueImpliesMax,
67 debuggerConfigArgs
68 };
69}
70
71function getSerializerOptions({
72 lazyObjectsRuntime,
73 heapGraphFormat,
74 delayInitializations = false,
75 delayUnsupportedRequires = false,
76 accelerateUnsupportedRequires = true,
77 internalDebug = false,
78 debugScopes = false,
79 debugIdentifiers,
80 logStatistics = false,
81 logModules = false,
82 profile = false,
83 inlineExpressions = false,
84 initializeMoreModules = false,
85 trace = false
86}) {
87 let result = {
88 delayInitializations,
89 delayUnsupportedRequires,
90 accelerateUnsupportedRequires,
91 initializeMoreModules,
92 internalDebug,
93 debugScopes,
94 debugIdentifiers,
95 logStatistics,
96 logModules,
97 profile,
98 inlineExpressions,
99 trace
100 };
101
102 if (lazyObjectsRuntime !== undefined) {
103 result.lazyObjectsRuntime = lazyObjectsRuntime;
104 }
105
106 if (heapGraphFormat !== undefined) {
107 result.heapGraphFormat = heapGraphFormat;
108 }
109
110 return result;
111}
112//# sourceMappingURL=prepack-options.js.map
\No newline at end of file