validify-string
Version:
Ensure accurate and secure input with our reliable string validation library.
53 lines (52 loc) • 2.63 kB
TypeScript
import { addUnderscore, removeSpace, removeUnderscore } from "./utils/utilityFunctions";
import { isStringWithoutSpecialCharacters, startsWithPrefix, endsWithSuffix } from "./utils/validateFunctions";
declare const validator: {
isEmpty: (value: string) => boolean;
isIdentical: (strOne: string, strTwo: string) => boolean;
isAlpha: (str: string) => boolean;
isAlphaNumeric: (str: string) => boolean;
isValidEmail: (email: string) => boolean;
countWords: (str: string) => number;
isAvailable: (str: string, word: string) => boolean;
countOccurrences: (str: string, word: string) => number;
isPasswordStrong: (password: string) => boolean;
isURL: (str: string) => boolean;
isIP: (ip: string) => boolean;
isUppercase: (str: string) => boolean;
isLowercase: (str: string) => boolean;
isPalindrome: (str: string) => boolean;
isValidDate: (dateString: string) => boolean;
isValidPhone: (num: string) => boolean;
isValidCardNumber: (num: string) => boolean;
isAlphanumeric: (str: string) => boolean;
isHash: (str: string) => boolean;
isHexadecimal: (str: string) => boolean;
isASCII: (str: string, extended?: string[] | undefined) => boolean;
isHexColor: (str: string) => boolean;
isJSON: (str: string) => boolean;
isJWT: (str: string) => boolean;
isBase32: (str: string) => boolean;
isBase64: (str: string) => boolean;
isEthereumAddress: (address: string) => boolean;
isStringWithoutSpecialCharacters: typeof isStringWithoutSpecialCharacters;
startsWithPrefix: typeof startsWithPrefix;
endsWithSuffix: typeof endsWithSuffix;
trimRight: (str: string, chars: string) => string;
trimLeft: (str: string, chars: string) => string;
trimBoth: (str: string, chars: string) => string;
encrypt: (str: string) => string;
decrypt: (toDecode: string) => string;
getAlphaNumString: (length: number) => string;
getLeftSubstring: (inputString: string, n: number) => string;
isStringAContainsB: (StringA: string, StringB: string) => boolean;
isStringAMatchesB: (StringA: string, StringB: string) => boolean;
addUnderscore: typeof addUnderscore;
removeSpace: typeof removeSpace;
removeUnderscore: typeof removeUnderscore;
generateJWT: (payload: import("./utils/generateJWT").Payload, secret: string, expiresInSec?: number) => string;
decodeJWT: (token: string) => import("./utils/generateJWT").DecodedJWT | null;
addFullstop: (str: string) => string;
removeNumber: (str: string) => string;
generateRandomString: (length: number) => string;
};
export default validator;