Made enum for known parameter factory options

This commit is contained in:
Kir_Antipov 2023-02-18 11:09:27 +00:00
parent c2a959f05a
commit 661974ccb8

View file

@ -0,0 +1,49 @@
/**
* Representing the known options for the action parameter factory function.
*/
export enum ActionParameterFactoryOptions {
/**
* Determines if the input string should be split into an array of strings.
*
* Default value is `true` if the type represents an array, and `false` otherwise.
*/
SPLIT = "split",
/**
* If `split` is `true`, this is used to divide the input string into an array of strings.
* Otherwise, it's unused.
*
* Default value is `/\r?\n/g`.
*/
SEPARATOR = "separator",
/**
* If `split` is set to `true`, this indicates whether the factory/converter function
* should accept the input array as a whole or process its values individually and then concatenate them into a new array.
*
* Default value is the same as `split`.
*/
PROCESS_SEPARATELY = "processSeparately",
/**
* If `true`, trims whitespace from the beginning and end of each entry in the array.
*
* Default value is the same as `split`.
*/
TRIM_ENTRIES = "trimEntries",
/**
* If `true`, removes empty entries from the array after processing.
*
* Default value is the same as `split`.
*/
REMOVE_EMPTY_ENTRIES = "removeEmptyEntries",
/**
* The depth level specifying how deep a nested array structure should be flattened.
* Passes the value to Array.prototype.flat() method.
*
* Default value is `1`.
*/
FLAT_DEPTH = "flatDepth",
}