nx-mesh
Version:
GraphQL Mesh support for Nx
28 lines • 900 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.flatternCliArguments = exports.getCliArguments = void 0;
/**
* Get a list of arguments that can be passed to the
* GraphQL Mesh CLI.
*/
const getCliArguments = (options) => {
const cliArguments = {};
Object.entries(options).forEach(([key, value]) => {
const cliKey = `--${key}`;
let cliValue;
if (Array.isArray(value)) {
cliValue = value.join(' ');
}
else {
cliValue = value;
}
if (cliValue !== undefined && cliValue !== '') {
cliArguments[cliKey] = `${cliValue}`;
}
});
return cliArguments;
};
exports.getCliArguments = getCliArguments;
const flatternCliArguments = (args) => Object.entries(args).flat();
exports.flatternCliArguments = flatternCliArguments;
//# sourceMappingURL=arguments.js.map