react-native-navigation的迁移库

Commands.js 417B

1234567891011121314151617181920
  1. import _ from 'lodash';
  2. export function startApp(params) {
  3. validateParams(params);
  4. }
  5. function validateParams(params) {
  6. const msg = `invalid params passed to startApp: ${params}`;
  7. if (!params) {
  8. throw new Error(msg);
  9. }
  10. if (params.screenKey) {
  11. return true;
  12. }
  13. if (params.tabs && params.tabs.length > 0 && _.every(params.tabs, (t) => t.screenKey)) {
  14. return true;
  15. }
  16. throw new Error(msg);
  17. }