2026-07-20 16:05:17 +00:00
// Module ID: 1493
2026-07-25 08:10:48 +00:00
// Function ID: 17228
2026-07-20 16:05:17 +00:00
// Name: formatToList
2026-07-23 10:11:24 +00:00
// Dependencies: [57]
2026-07-20 16:05:17 +00:00
// Module 1493 (formatToList)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray" ;
2026-07-20 16:05:17 +00:00
function formatToList ( found ) {
const mapped = found . map ( ( arg0 ) => "- " + arg0 ) ;
return mapped . join ( "\n" ) ;
}
function validatePathConfig ( config ) {
2026-07-23 10:11:24 +00:00
const items = [ "initialRouteName" , "screens" ] ;
2026-07-20 16:05:17 +00:00
const tmp = arguments . length > 1 && undefined !== arguments [ 1 ] ;
let tmp2 = ! tmp ;
if ( tmp ) {
tmp2 = arguments [ 1 ] ;
}
if ( ! tmp2 ) {
items . push ( "path" , "exact" , "stringify" , "parse" ) ;
}
const keys = Object . keys ( config ) ;
const found = keys . filter ( ( arg0 ) => ! items . includes ( arg0 ) ) ;
if ( found . length ) {
const _Error = Error ;
const tmp7 = formatToList ( found ) ;
const _HermesInternal = HermesInternal ;
const error = new Error ( "Found invalid properties in the configuration:\n" + tmp7 + "\n\nDid you forget to specify them under a 'screens' property?\n\nYou can only specify the following properties:\n" + formatToList ( items ) + "\n\nSee https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration." ) ;
throw error ;
} else if ( config . screens ) {
const _Object = Object ;
const entries = Object . entries ( config . screens ) ;
2026-07-23 10:11:24 +00:00
const item = entries . forEach ( ( closure _2 ) => {
const tmp2 = items ( closure _2 , 2 ) [ 1 ] ;
2026-07-20 16:05:17 +00:00
if ( "string" !== typeof tmp2 ) {
2026-07-23 10:11:24 +00:00
outer1 _2 ( tmp2 , false ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
}
}
export default validatePathConfig ;