shevchenko
Version:
JavaScript library for declension of Ukrainian anthroponyms
28 lines (27 loc) • 1.35 kB
TypeScript
import { DeclensionInput, GenderDetectionInput } from './contracts';
export declare class InputValidationError extends TypeError {
}
/**
* Validates and normalizes declension input.
*
* Validates that the input is a valid declension input object and normalizes all string fields
* to NFC (Canonical Decomposition followed by Canonical Composition) form to ensure Unicode
* characters are in a consistent form for reliable pattern matching with Cyrillic characters.
*
* @param input - The input to validate and normalize
* @returns A new validated and normalized input object
* @throws {InputValidationError} If validation fails
*/
export declare function validateDeclensionInput<T extends DeclensionInput>(input: T): T;
/**
* Validates and normalizes gender detection input.
*
* Validates that the input is a valid gender detection input object and normalizes all string
* fields to NFC (Canonical Decomposition followed by Canonical Composition) form to ensure
* Unicode characters are in a consistent form for reliable pattern matching with Cyrillic characters.
*
* @param input - The input to validate and normalize
* @returns A new validated and normalized input object
* @throws {InputValidationError} If validation fails
*/
export declare function validateGenderDetectionInput<T extends GenderDetectionInput>(input: T): T;