1const formatToList = (items) => items.map((key) => `- ${key}`).join('\n'); 2export default function validatePathConfig(config, root = true) { 3 const validKeys = ['initialRouteName', 'screens', '_route']; 4 if (!root) { 5 validKeys.push('path', 'exact', 'stringify', 'parse'); 6 } 7 const invalidKeys = Object.keys(config).filter((key) => !validKeys.includes(key)); 8 if (invalidKeys.length) { 9 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.`); 10 } 11 if (config.screens) { 12 Object.entries(config.screens).forEach(([_, value]) => { 13 if (typeof value !== 'string') { 14 validatePathConfig(value, false); 15 } 16 }); 17 } 18} 19//# sourceMappingURL=validatePathConfig.js.map