Private Static ReadonlyALLOWED_Allowed normalization flags
Private Static ReadonlyALLOWED_Allowed comparison modes
Private Static ReadonlyALLOWED_Allowed output modes
Private Static ReadonlyALLOWED_Allowed sort modes
Private Static ReadonlyCMPSTR_CmpStr options validation dispatch table
Private Static ReadonlyMETRIC_Metric options validation dispatch table
Private Static ReadonlyPHONETIC_Phonetic algorithm options validation dispatch table
Private Static ReadonlyPROCESSORSProcessor dispatch table
Private Staticset2stringInternal helper to convert a Set to a string for error messages.
The set to convert
StaticvalidatePrivate StaticvalidateStaticvalidatePrivate StaticvalidateInternal helper to validate objects against a dispatch table of validation functions.
The object to validate.
A dispatch table mapping keys to validation functions.
StaticvalidateStaticvalidateValidate metric options.
Optionalopt: MetricOptionsThe metric options to validate
StaticvalidateStaticvalidateStaticvalidateValidate the provided CmpStr options object.
This method performs a comprehensive validation of the options object passed to CmpStr. It checks for the presence and validity of all supported options, including primitive types, enum-like values, registry-based names, and nested processor options.
If any validation check fails, a CmpStrValidationError is thrown with a descriptive message and relevant details about the invalid option.
Optionalopt: CmpStrOptions | StructuredDataOptionsThe options object to validate
StaticvalidateStaticvalidateStaticvalidateValidate phonetic options.
Optionalopt: PhoneticOptionsThe phonetic options to validate
StaticvalidateValidate processor options.
This method iterates over the keys in the provided processor options and dispatches validation to the corresponding function in the PROCESSORS table.
If an invalid processor type is found, a CmpStrValidationError is thrown indicating the invalid type and the expected processor types.
Optionalopt: CmpStrProcessorsThe processor options to validate
Private StaticvalidateInternal helper to validate registry-based options (metrics and phonetic algorithms).
The value to validate.
The name of the option (for error messages).
The label to use in error messages (e.g. "Metric" or "Phonetic algorithm").
A function that checks if the registry contains a given name.
A function that returns a list of registered names for error messages.
StaticvalidateStaticvalidatePrivate StaticvalidateInternal helper to validate primitive types.
The value to validate.
The name of the option (for error messages).
The expected type of the value.
Utility for validating CmpStr options.
This class provides static methods to validate various aspects of the options object passed to CmpStr.