UNPKG

@nx-dotnet/utils

Version:

This library was generated with [Nx](https://nx.dev).

31 lines (30 loc) 1.54 kB
/** * Transforms an object of parameters into a string. * @param parameters Parameters to transform into CLI arguments * @returns Parameter string to be appended to CLI command */ export declare function getParameterString(parameters: Record<string, boolean | string>): string; /** * Transforms an object of parameters into an array of strings with key followed by the corresponding value. * @param parameters Parameters to transform into CLI arguments * @returns Parameter string to be appended to CLI command */ export declare function getSpawnParameterArray(parameters: Record<string, boolean | string | number | undefined | null>): string[]; /** * The needed configuration to convert an object of options into an array of CLI parameters. */ export interface CommandLineParamFixes<TKey extends string> { /** * A map of the option keys and what those flags are named in the cli */ keyMap: Partial<Record<TKey, string>>; /** * These are keys that need to be passed as `--key false` instead of not including in the flags */ explicitFalseKeys: readonly TKey[]; } /** * Converts an object of options like `{ noBuild: true }`into an array of CLI parameters like `["--no-build"]` * Will run a conversion process to change every option to a string, and will map keys to different flags if needed. */ export declare function convertOptionsToParams<TKey extends string>(options: Partial<Record<TKey, string | boolean | number | undefined | null>>, fixes: CommandLineParamFixes<TKey>): string[];