sikits
Version:
A powerful and comprehensive utility library for JavaScript and TypeScript with 100+ functions for strings, numbers, arrays, and objects
133 lines (132 loc) • 4.1 kB
TypeScript
/**
* Converts a string to slug format (URL-friendly)
*/
export declare const toSlug: (str: string) => string;
/**
* Converts a string to initials (first letter of each word)
*/
export declare const toInitials: (str: string) => string;
/**
* Converts a string to a hash code
*/
export declare const toHashCode: (str: string) => number;
/**
* Converts a string to a simple hash (hexadecimal)
*/
export declare const toSimpleHash: (str: string) => string;
/**
* Converts a string to base64
*/
export declare const toBase64: (str: string) => string;
/**
* Decodes a base64 string
*/
export declare const fromBase64: (str: string) => string;
/**
* Converts a string to a random color hex
*/
export declare const toColorHex: (str: string) => string;
/**
* Converts a string to a random color RGB
*/
export declare const toColorRGB: (str: string) => {
r: number;
g: number;
b: number;
};
/**
* Converts a string to a random color HSL
*/
export declare const toColorHSL: (str: string) => {
h: number;
s: number;
l: number;
};
/**
* Converts a string to a random emoji
*/
export declare const toRandomEmoji: (str: string) => string;
/**
* Converts a string to a random avatar URL (using DiceBear API)
*/
export declare const toAvatarURL: (str: string, style?: 'adventurer' | 'avataaars' | 'big-ears' | 'bottts' | 'croodles' | 'fun-emoji' | 'icons' | 'identicon' | 'initials' | 'micah' | 'miniavs' | 'personas' | 'pixel-art' | 'rings' | 'shapes' | 'thumbs') => string;
/**
* Converts a string to a QR code URL
*/
export declare const toQRCodeURL: (str: string, size?: number) => string;
/**
* Converts a string to a word cloud data structure
*/
export declare const toWordCloud: (str: string) => Array<{
word: string;
count: number;
size: number;
}>;
/**
* Converts a string to a frequency analysis
*/
export declare const toFrequencyAnalysis: (str: string) => Record<string, number>;
/**
* Converts Indonesian currency format to number
*/
export declare function parseIndonesianCurrency(currency: string): number;
/**
* Formats number to Indonesian currency format
*/
export declare function formatIndonesianCurrency(amount: number): string;
/**
* Converts Indonesian date format (DD/MM/YYYY) to Date object
*/
export declare function parseIndonesianDate(dateString: string): Date | null;
/**
* Formats Date object to Indonesian date format
*/
export declare function formatIndonesianDate(date: Date): string;
/**
* Converts Indonesian time format to 24-hour format
*/
export declare function parseIndonesianTime(timeString: string): string;
/**
* Formats 24-hour time to Indonesian time format
*/
export declare function formatIndonesianTime(timeString: string, use12Hour?: boolean): string;
/**
* Converts Indonesian address to standardized format
*/
export declare function formatIndonesianAddress(address: string): string;
/**
* Converts Indonesian name to title case
*/
export declare function formatIndonesianName(name: string): string;
/**
* Converts Indonesian phone number to WhatsApp link
*/
export declare function toWhatsAppLink(phone: string, message?: string): string;
/**
* Converts Indonesian phone number to Telegram link
*/
export declare function toTelegramLink(phone: string, message?: string): string;
/**
* Converts Indonesian bank account to masked format
*/
export declare function maskIndonesianBankAccount(accountNumber: string): string;
/**
* Converts Indonesian credit card to masked format
*/
export declare function maskIndonesianCreditCard(cardNumber: string): string;
/**
* Converts Indonesian KTP to masked format
*/
export declare function maskIndonesianKTP(ktp: string): string;
/**
* Converts Indonesian NPWP to masked format
*/
export declare function maskIndonesianNPWP(npwp: string): string;
/**
* Converts Indonesian postal code to formatted version
*/
export declare function formatIndonesianPostalCode(postalCode: string): string;
/**
* Converts Indonesian vehicle plate to formatted version
*/
export declare function formatIndonesianVehiclePlate(plate: string): string;