1"use strict"; 2Object.defineProperty(exports, "__esModule", { value: true }); 3const formatToList = (items) => items.map((key) => `- ${key}`).join('\n'); 4function validatePathConfig(config, root = true) { 5 const validKeys = ['initialRouteName', 'screens', '_route']; 6 if (!root) { 7 validKeys.push('path', 'exact', 'stringify', 'parse'); 8 } 9 const invalidKeys = Object.keys(config).filter((key) => !validKeys.includes(key)); 10 if (invalidKeys.length) { 11 throw new Error(`Found invalid properties in the configuration:\n${formatToList(invalidKeys)}\n\nDid you forget to specify them under a 'screens' property?\n\nYou can only specify the following properties:\n${formatToList(validKeys)}\n\nSee https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.`); 12 } 13 if (config.screens) { 14 Object.entries(config.screens).forEach(([_, value]) => { 15 if (typeof value !== 'string') { 16 validatePathConfig(value, false); 17 } 18 }); 19 } 20} 21exports.default = validatePathConfig; 22//# sourceMappingURL=validatePathConfig.js.map