From c6583524f56ac86d19937fc76be7f3134386bf55 Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Thu, 4 Jan 2024 09:45:21 +0000 Subject: [PATCH] Converted `ActionParameterFactoryOptions` to `Enum` --- .../action-parameter-factory-options.ts | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/utils/actions/action-parameter-factory-options.ts b/src/utils/actions/action-parameter-factory-options.ts index caba72c..b696f85 100644 --- a/src/utils/actions/action-parameter-factory-options.ts +++ b/src/utils/actions/action-parameter-factory-options.ts @@ -1,7 +1,11 @@ +import { Enum, EnumOptions } from "@/utils/enum"; + /** - * Representing the known options for the action parameter factory function. + * Represents the known options for the action parameter factory function. + * + * @partial */ -export enum ActionParameterFactoryOptions { +enum ActionParameterFactoryOptionsValues { /** * Determines if the input string should be split into an array of strings. * @@ -47,3 +51,33 @@ export enum ActionParameterFactoryOptions { */ FLAT_DEPTH = "flatDepth", } + +/** + * Options for configuring the behavior of the `ActionParameterFactoryOptions` enum. + * + * @partial + */ +const ActionParameterFactoryOptionsOptions: EnumOptions = { + /** + * The case should be ignored while parsing the options. + */ + ignoreCase: true, + + /** + * Non-word characters should be ignored while parsing the options. + */ + ignoreNonWordCharacters: true, +}; + +/** + * Represents the known options for the action parameter factory function. + */ +export const ActionParameterFactoryOptions = Enum.create( + ActionParameterFactoryOptionsValues, + ActionParameterFactoryOptionsOptions, +); + +/** + * Represents the known options for the action parameter factory function. + */ +export type ActionParameterFactoryOptions = Enum;