@oxog/string
Version:
Comprehensive string manipulation utilities with zero dependencies
20 lines (19 loc) • 1.54 kB
TypeScript
import type { SimilarityAlgorithm, SoundsLikeAlgorithm, HashAlgorithm, RandomOptions, MaskOptions, Pattern, TableOptions, BoxOptions, ProgressOptions } from '../types';
export declare function similarity(str1: string, str2: string, algorithm?: SimilarityAlgorithm): number;
export declare function fuzzyMatch(str: string, pattern: string, threshold?: number): boolean;
export declare function soundsLike(str1: string, str2: string, algorithm?: SoundsLikeAlgorithm): boolean;
export declare function findPatterns(str: string, minLength?: number): Pattern[];
export declare function isRepeating(str: string): boolean;
export declare function extractEmails(str: string): string[];
export declare function extractUrls(str: string): string[];
export declare function extractNumbers(str: string): string[];
export declare function random(length: number, options?: RandomOptions): string;
export declare function generatePronounceable(length: number): string;
export declare function generateFromPattern(pattern: string): string;
export declare function mask(str: string, options?: MaskOptions): string;
export declare function maskEmail(email: string): string;
export declare function maskCreditCard(cc: string): string;
export declare function hash(str: string, algorithm: HashAlgorithm): string;
export declare function toTable(data: string[][], options?: TableOptions): string;
export declare function boxify(str: string, options?: BoxOptions): string;
export declare function progressBar(value: number, options?: ProgressOptions): string;