( name, appOrLoadApp, activeWhen, customProps )
| 264 | } |
| 265 | |
| 266 | function validateRegisterWithArguments( |
| 267 | name, |
| 268 | appOrLoadApp, |
| 269 | activeWhen, |
| 270 | customProps |
| 271 | ) { |
| 272 | if (typeof name !== "string" || name.length === 0) |
| 273 | throw Error( |
| 274 | formatErrorMessage( |
| 275 | 20, |
| 276 | __DEV__ && |
| 277 | `The 1st argument to registerApplication must be a non-empty string 'appName'` |
| 278 | ) |
| 279 | ); |
| 280 | |
| 281 | if (!appOrLoadApp) |
| 282 | throw Error( |
| 283 | formatErrorMessage( |
| 284 | 23, |
| 285 | __DEV__ && |
| 286 | "The 2nd argument to registerApplication must be an application or loading application function" |
| 287 | ) |
| 288 | ); |
| 289 | |
| 290 | if (typeof activeWhen !== "function") |
| 291 | throw Error( |
| 292 | formatErrorMessage( |
| 293 | 24, |
| 294 | __DEV__ && |
| 295 | "The 3rd argument to registerApplication must be an activeWhen function" |
| 296 | ) |
| 297 | ); |
| 298 | |
| 299 | if (!validCustomProps(customProps)) |
| 300 | throw Error( |
| 301 | formatErrorMessage( |
| 302 | 22, |
| 303 | __DEV__ && |
| 304 | "The optional 4th argument is a customProps and must be an object" |
| 305 | ) |
| 306 | ); |
| 307 | } |
| 308 | |
| 309 | export function validateRegisterWithConfig(config) { |
| 310 | if (Array.isArray(config) || config === null) |
no test coverage detected
searching dependent graphs…