v0.7.2 - April 18, 2026
New Features
Currency Module
formatPercentage()- Format number as Indonesian percentage with comma as decimal separator
v0.7.1 - April 10, 2026
New Features
Plate Module
maskPlate()- Mask license plate for privacycleanPlate()- Remove non-alphanumeric charactersisPrivatePlate()- Check if private vehicle plateisPublicPlate()- Check if public transportation plateisDiplomatPlate()- Check if diplomat plate
VIN Module
maskVIN()- Mask VIN for privacycleanVIN()- Remove non-alphanumeric characters
NPWP Module
cleanNPWP()- Remove non-digit charactersisNIKBasedNPWP()- Check if 16-digit NIK-based NPWP
Main Exports
Added missing barrel exports:
- NIK:
cleanNIK,validateNIKDetailed,compareNIK,isAdult - Phone:
normalizePhoneNumber,comparePhones,getLandlineRegion - Currency:
splitAmount,percentageOf,difference,InvalidSplitError
Bug Fixes
InvalidSplitError- Addedreadonly codeproperty and default message (was missing, inconsistent with other error classes)
Type Definitions
- Added
PlateMaskOptionsinterface - Added
VINMaskOptionsinterface
v0.7.0 - April 6, 2026
New Features
Error Classes
Custom error classes with code property for programmatic error handling:
InvalidPhoneError- Error for invalid phone numbersInvalidNPWPError- Error for invalid NPWPInvalidEmailError- Error for invalid email addressesInvalidPlateError- Error for invalid vehicle platesInvalidVINError- Error for invalid VINs
Parse Functions
parseVIN()- Extract VIN components (WMI, VDS, check digit, model year, plant code, serial number)parsePlate()- Extract plate components (prefix, number, suffix, type, formatted)
Breaking Changes with Deprecation
Mask Options Standardization
Standardized mask option names across all modules:
| Old Name | New Name |
|---|---|
start | visibleStart |
end | visibleEnd |
char | maskChar |
Migration: Old names still work but emit deprecation warnings in console. Support will be removed in v1.0.0.
NIK Module
maskNIK()- Now usesvisibleStart,visibleEnd,maskCharoptions
Phone Module
maskPhoneNumber()- Now usesvisibleStart,visibleEnd,maskCharoptions
Text Module
maskText()- Now usesvisibleStart,visibleEnd,maskCharoptions, addedseparatorsupport
v0.6.0 - April 6, 2026
New Features
NIK Module
cleanNIK(): Normalize NIK input by stripping separators (.,-,)compareNIK(): Check if two NIKs belong to the same personisAdult(): Check KTP eligibility (17 years default, configurable)validateNIKDetailed(): Structured validation result with error codes and messagesNIKValidationResult,NIKValidationError,NIKErrorCodetypesAgeandGetAgeOptionstypes
Breaking Changes
NIK Module
getAge()now returns{ years, months, days }object instead ofnumber- Use
{ asString: true }option for formatted output (“35 Tahun 2 Bulan 6 Hari”) - Use
age.yearsfor year comparison
- Use
Improvements
NIK Module
formatBirthDate()now uses internal formatting (consistent with datetime module)
v0.5.0 - April 6, 2026
Breaking Changes
Phone Module
generateWALink()andgenerateSmsLink()now reject landlines- WhatsApp and SMS only work on mobile numbers
- Landline numbers now return empty string
'' - Use
generateTelLink()for landline phone calls
Improvements
Phone Module
comparePhones()now properly compares using E.164 format for accurate comparisongetLandlineRegion()now uses sharednormalizePhoneNumber()utility (removed code duplication)
v0.4.2 - April 6, 2026
Improvements
NIK Module Code Quality
- Extracted shared date validation logic to
utils/date.ts(DRY principle) - Added
InvalidNIKErrorcustom error class for consistent error handling with datetime module - Cached regex pattern in
validateNIK()andparseNIK()for ~10% performance improvement
Bug Fixes
parseNIK()now properly validates calendar dates (e.g., Feb 30, Feb 31 returned incorrect results)
Documentation
- Removed
sanitizeNIK()from best practices section (function not exported)
v0.4.1 - April 6, 2026
New Features
Phone Module Enhancements
normalizePhoneNumber()- New utility to normalize phone numbers to national format (08xx)comparePhones()- Compare two phone numbers regardless of formatgetLandlineRegion()- Get region name from landline area code
Bug Fixes
isMobileNumber()- Fixed 620 prefix edge case bug (was treating invalid 620xxx as valid)- Removed code duplication in
format.tsandparse.ts(single source of truth inutils.ts)
Improvements
getOperator()- Return type now properly typed asOperatorName | null- Constants now use
as constfor better type safety OPERATOR_PREFIXESvalues typed asOperatorNameunion type
Documentation
- Added
@publicJSDoc tags togenerateWALink,generateSmsLink,generateTelLink
v0.4.0 - April 5, 2026
New Features
DateTime Module
A comprehensive new module for Indonesian date/time operations:
formatDate()- Format dates with Indonesian locale (6 styles: full, long, medium, short, weekday, month)formatDateRange()- Smart date range formatting with automatic redundancy removalparseDate()- Strict DD-MM-YYYY parser with ISO format auto-detection and leap year validationtoRelativeTime()- Relative time in Indonesian (“X menit yang lalu”, “Kemarin”, “Besok”, etc.)getAge()- Age calculation with years, months, days support (object or string output)getIndonesianTimezone()- Map IANA timezone names and UTC offsets to WIB/WITA/WITisLeapYear()- Leap year validation with proper Gregorian calendar rulesdaysInMonth()- Days in month calculation accounting for leap yearsisValidDate()- Type guard for validating Date objectsisWeekend()/isWorkingDay()- Weekend and working day detectionInvalidDateError/InvalidDateRangeError- Custom error classes with error codes for programmatic handling
v0.3.4 - April 4, 2026
Breaking Changes
calculateTax()now requires explicitrateparameter (removed default 0.11) to comply with Data Independence mandate
Fixes
formatRupiah()negative numbers now display as-Rp 1.500.000instead ofRp -1.500.000(standard accounting format)formatCompact()negative numbers now display as-Rp 1,5 juta(consistent with formatRupiah)addRupiahSymbol()no longer uses browser-dependenttoLocaleString— uses internal formatting for consistency
New Features
Currency Module Enhancements
splitAmount()- Split amounts into equal or custom-ratio parts with optional rounding (e.g., split bills, installments)percentageOf()- Calculate what percentage a part is of a total (e.g., budget allocation)difference()- Calculate absolute and percentage difference between two amounts with direction trackingvalidateRupiah()- Validate whether a string is a valid Rupiah formatformatCompact()now acceptsCompactOptions(symbol,spaceAfterSymbol)toWords()now supportswithDecimalsoption for decimal terbilang (e.g., “satu juta koma lima puluh”)InvalidSplitErrorcustom error class for split validation failures
v0.3.3 - April 4, 2026
New Features
Text Module Enhancements
maskText()- Versatile text masking utility withall,middle, andemailpatterns for privacy-compliant data displaytoCamelCase()- Convert text to camelCase format (replaces Lodash dependency)toPascalCase()- Convert text to PascalCase formattoSnakeCase()- Convert text to snake_case format, handles camelCase boundariescountSyllables()- Algorithm-based syllable counter for Indonesian text with dipthong awareness (ai, au, oi)
v0.3.2 - April 3, 2026
New Features
Email Validator Module
validateEmail()- Standard email format validation with optional disposable domain detectionnormalizeEmail()- Utility to clean and lowercase email addressesmaskEmail()- Securely mask email addresses for privacy protection (e.g.,u***r@example.com)getEmailInfo()- Extract detailed metadata including domain and provider classification
v0.3.1 - April 3, 2026
New Features
VIN (Vehicle Identification Number) Module
validateVIN()- Validate 17-character VIN strings according to ISO 3779 checksum standards
v0.3.0 - April 3, 2026
New Features
NPWP Module
validateNPWP()- Validate format and checksums for 15-digit and 16-digit NPWPformatNPWP()- Format 15/16-digit data into standard NPWP notationsparseNPWP()- Clean and parse NPWP segmentsmaskNPWP()- Mask NPWP digits for privacy and logging
Vehicle Plate (Plat Nomor) Module
validatePlate()- Validate standard Indonesian vehicle plate numbersformatPlate()- Format and normalize plate spacinggetRegionFromPlate()- Extract corresponding province and region names based on plate prefix
Text Module Enhancements
profanityFilter()- Safely filter out common Indonesian bad wordsremoveStopwords()- Remove excessive filler words (stopwords) from Indonesian texttoFormal()- Normalize informal writing variants (slang) into formal IndonesianisAlay()- Detect informal “alay” writing styles or excessive symbol usagecontractAbbreviation()- Revert expanded text back into standard abbreviationsremoveAccents()- Remove diacritic marks (accents) for clean string comparisons
Documentation & Core
- Reorganized module utilities (
utils.ts) into core functional exports - Added
.prettierrcfor enforced source code formatting rules - Updated
API Documentationwith multiple runtime installation tabs (npm,pnpm,yarn,bun)
v0.2.0 - January 2, 2026
New Features
Text Module
toTitleCase()- Smart capitalization handling Indonesian particlesexpandAbbreviation()- Expand common Indonesian abbreviations (Jl., Bpk., etc.)slugify()- URL-friendly slugs with Indonesian conjunction support (& -> dan)truncate()- Smart text truncation respecting word boundariescompareStrings()- Robust string comparison (case/accent/whitespace)similarity()- Calculate string similarity scores (Levenshtein)extractWords()- Word extraction preserving hyphenated wordssanitize()- Text cleaning and normalization
Improvements
- Performance optimizations for text processing
- Comprehensive test coverage for text utilities
v0.1.0 - December 11, 2025
New Features
NIK Module
validateNIK()- Validate Indonesian National Identity NumberparseNIK()- Extract province, birth date, and gender informationformatNIK()- Format NIK with separatorsmaskNIK()- Mask NIK for privacy protection- Support for all 38 Indonesian provinces
- Leap year validation
- Gender detection from birth date encoding
Phone Module
validatePhoneNumber()- Validate Indonesian phone numbersformatPhoneNumber()- Format to international/national/e164 formatsgetOperator()- Detect mobile operator (Telkomsel, XL, Indosat, Smartfren, Axis)parsePhoneNumber()- Extract all phone informationmaskPhoneNumber()- Mask phone numbers for privacycleanPhoneNumber()- Remove separators and normalize- Support for 200+ Indonesian area codes
- Support for landline and mobile numbers
Currency Module
formatRupiah()- Format numbers as Rupiah currencyformatCompact()- Compact format with proper Indonesian grammar (1,5 juta)parseRupiah()- Parse formatted strings back to numberstoWords()- Convert numbers to Indonesian words (terbilang)roundToClean()- Round to clean amounts (ribu, ratus-ribu, juta)- Support for decimal places and custom separators
Package
- TypeScript support with full type definitions
- Dual package support (ESM + CommonJS)
- Tree-shakeable exports
- Zero runtime dependencies
- 175+ test cases with 95%+ coverage
Last updated on