simple-body-validator
Version:
This package is inspired by Laravel validation, and aims to make body validation easier for Javascript developers
19 lines (18 loc) • 750 B
TypeScript
import { CustomMesages } from '../types';
/**
* Get the validation message for an attribute and rule.
*/
export declare function getMessage(attributes: string[], rule: string, value: any, customMessages: CustomMesages, hasNumericRule: boolean, lang: string): string;
/**
* Convert a string to snake case.
*/
export declare function toSnakeCase(string: string): string;
/**
* Get the formatted name of the attribute
*/
export declare function getFormattedAttribute(attribute: string): string;
/**
* Get the combinations of keys from a main key. For example if the main key is 'user.info.name',
* the combination will be [user.info.name, info.name, name]
*/
export declare function getKeyCombinations(key: string): string[];