1"use strict"; 2Object.defineProperty(exports, "__esModule", { value: true }); 3exports.requireAndResolveExpoModuleConfig = exports.ExpoModuleConfig = void 0; 4/** 5 * A class that wraps the raw config (`expo-module.json` or `unimodule.json`). 6 */ 7class ExpoModuleConfig { 8 constructor(rawConfig) { 9 this.rawConfig = rawConfig; 10 } 11 /** 12 * Whether the module supports given platform. 13 */ 14 supportsPlatform(platform) { 15 var _a, _b; 16 return (_b = (_a = this.rawConfig.platforms) === null || _a === void 0 ? void 0 : _a.includes(platform)) !== null && _b !== void 0 ? _b : false; 17 } 18 /** 19 * Returns a list of names of Swift native modules classes to put to the generated modules provider file. 20 */ 21 iosModulesClassNames() { 22 var _a, _b; 23 return (_b = (_a = this.rawConfig.ios) === null || _a === void 0 ? void 0 : _a.modulesClassNames) !== null && _b !== void 0 ? _b : []; 24 } 25 /** 26 * Returns serializable raw config. 27 */ 28 toJSON() { 29 return this.rawConfig; 30 } 31} 32exports.ExpoModuleConfig = ExpoModuleConfig; 33/** 34 * Reads the config at given path and returns the config wrapped by `ExpoModuleConfig` class. 35 */ 36function requireAndResolveExpoModuleConfig(path) { 37 // TODO: Validate the raw config against a schema. 38 // TODO: Support for `*.js` files, not only static `*.json`. 39 return new ExpoModuleConfig(require(path)); 40} 41exports.requireAndResolveExpoModuleConfig = requireAndResolveExpoModuleConfig; 42//# sourceMappingURL=ExpoModuleConfig.js.map