config.js 900 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function isValidRNDependency(config) {
  7. return Object.keys(config.platforms).filter(key => Boolean(config.platforms[key])).length !== 0 || config.hooks && Object.keys(config.hooks).length !== 0 || config.assets && config.assets.length !== 0 || config.params && config.params.length !== 0;
  8. }
  9. function filterConfig(config) {
  10. const filtered = { ...config
  11. };
  12. Object.keys(filtered.dependencies).forEach(item => {
  13. if (!isValidRNDependency(filtered.dependencies[item])) {
  14. delete filtered.dependencies[item];
  15. }
  16. });
  17. return filtered;
  18. }
  19. var _default = {
  20. name: 'config',
  21. description: 'Print CLI configuration',
  22. func: async (_argv, ctx) => {
  23. console.log(JSON.stringify(filterConfig(ctx), null, 2));
  24. }
  25. };
  26. exports.default = _default;
  27. //# sourceMappingURL=config.js.map