1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const Errors_1 = require("./Errors");
|
4 | function serializeAndEvaluate(val) {
|
5 | if (['undefined', 'string', 'boolean', 'number', 'bigint'].includes(typeof val)) {
|
6 | return val;
|
7 | }
|
8 | else if (typeof val === 'function') {
|
9 |
|
10 | return val();
|
11 | }
|
12 | else if (Array.isArray(val)) {
|
13 | return val.map(serializeAndEvaluate);
|
14 | }
|
15 | else if (typeof val === 'object') {
|
16 | const output = {};
|
17 | for (const property in val) {
|
18 | if (val.hasOwnProperty(property)) {
|
19 | output[property] = serializeAndEvaluate(val[property]);
|
20 | }
|
21 | }
|
22 | return output;
|
23 | }
|
24 |
|
25 | throw new Errors_1.ConfigError(`Expo config doesn't support \`Symbols\`: ${val}`, 'INVALID_CONFIG');
|
26 | }
|
27 | exports.serializeAndEvaluate = serializeAndEvaluate;
|
28 |
|
\ | No newline at end of file |