This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

32 lines
900 B
JavaScript
Raw Permalink Normal View History

2021-04-02 02:24:13 +03:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function isValidRNDependency(config) {
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;
}
function filterConfig(config) {
const filtered = { ...config
};
Object.keys(filtered.dependencies).forEach(item => {
if (!isValidRNDependency(filtered.dependencies[item])) {
delete filtered.dependencies[item];
}
});
return filtered;
}
var _default = {
name: 'config',
description: 'Print CLI configuration',
func: async (_argv, ctx) => {
console.log(JSON.stringify(filterConfig(ctx), null, 2));
}
};
exports.default = _default;
//# sourceMappingURL=config.js.map