1*04e66b12SGabriel Donadel Dall'Agnol"use strict"; 2*04e66b12SGabriel Donadel Dall'Agnolvar __importDefault = (this && this.__importDefault) || function (mod) { 3*04e66b12SGabriel Donadel Dall'Agnol return (mod && mod.__esModule) ? mod : { "default": mod }; 4*04e66b12SGabriel Donadel Dall'Agnol}; 5*04e66b12SGabriel Donadel Dall'AgnolObject.defineProperty(exports, "__esModule", { value: true }); 6*04e66b12SGabriel Donadel Dall'Agnolexports.validateConfig = void 0; 7*04e66b12SGabriel Donadel Dall'Agnolconst ajv_1 = __importDefault(require("ajv")); 8*04e66b12SGabriel Donadel Dall'Agnolconst schema = { 9*04e66b12SGabriel Donadel Dall'Agnol type: 'object', 10*04e66b12SGabriel Donadel Dall'Agnol properties: { 11*04e66b12SGabriel Donadel Dall'Agnol tryToLaunchLastOpenedBundle: { type: 'boolean', nullable: true }, 12*04e66b12SGabriel Donadel Dall'Agnol android: { 13*04e66b12SGabriel Donadel Dall'Agnol type: 'object', 14*04e66b12SGabriel Donadel Dall'Agnol properties: { 15*04e66b12SGabriel Donadel Dall'Agnol tryToLaunchLastOpenedBundle: { type: 'boolean', nullable: true }, 16*04e66b12SGabriel Donadel Dall'Agnol }, 17*04e66b12SGabriel Donadel Dall'Agnol nullable: true, 18*04e66b12SGabriel Donadel Dall'Agnol }, 19*04e66b12SGabriel Donadel Dall'Agnol ios: { 20*04e66b12SGabriel Donadel Dall'Agnol type: 'object', 21*04e66b12SGabriel Donadel Dall'Agnol properties: { 22*04e66b12SGabriel Donadel Dall'Agnol tryToLaunchLastOpenedBundle: { type: 'boolean', nullable: true }, 23*04e66b12SGabriel Donadel Dall'Agnol }, 24*04e66b12SGabriel Donadel Dall'Agnol nullable: true, 25*04e66b12SGabriel Donadel Dall'Agnol }, 26*04e66b12SGabriel Donadel Dall'Agnol }, 27*04e66b12SGabriel Donadel Dall'Agnol}; 28*04e66b12SGabriel Donadel Dall'Agnol/** 29*04e66b12SGabriel Donadel Dall'Agnol * @ignore 30*04e66b12SGabriel Donadel Dall'Agnol */ 31*04e66b12SGabriel Donadel Dall'Agnolfunction validateConfig(config) { 32*04e66b12SGabriel Donadel Dall'Agnol const validate = new ajv_1.default({ allowUnionTypes: true }).compile(schema); 33*04e66b12SGabriel Donadel Dall'Agnol if (!validate(config)) { 34*04e66b12SGabriel Donadel Dall'Agnol throw new Error('Invalid expo-dev-launcher config: ' + JSON.stringify(validate.errors)); 35*04e66b12SGabriel Donadel Dall'Agnol } 36*04e66b12SGabriel Donadel Dall'Agnol return config; 37*04e66b12SGabriel Donadel Dall'Agnol} 38*04e66b12SGabriel Donadel Dall'Agnolexports.validateConfig = validateConfig; 39