mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-16 01:24:05 -08:00
15 lines
336 B
JavaScript
15 lines
336 B
JavaScript
// @ts-check
|
|
|
|
/**
|
|
* Converts an object of flags to an array of CLI arguments.
|
|
*
|
|
* @param {Record<string, string | undefined>} flags
|
|
*
|
|
* @returns {string[]}
|
|
*/
|
|
export function flagsObjectToCliArgs(flags) {
|
|
return Object.entries(flags)
|
|
.filter(([, value]) => value !== undefined)
|
|
.map(([key, value]) => `--${key}=${value}`);
|
|
}
|