test-numbers-generator
Version:
Generate and validate European test phone numbers (mobile and landline) in safe, non-existent ranges.
124 lines (96 loc) โข 4.93 kB
Markdown
# Release Notes
## Version 1.2.3 (August 22, 2025)
### ๐ Major Mobile Number Format Update
**BREAKING CHANGES:**
- **International Format Change**: All mobile numbers now use `00` prefix instead of `+`
- Before: `+31 6 12345678`
- After: `0031 6 12345678`
- This follows the international dialing convention using `00` country exit code
### โจ Enhanced Mobile Number Generation
**Realistic Country-Specific Prefixes:**
- **๐ฉ๐ช Germany**: Now randomly selects from `015`, `016`, or `017` prefixes
- **๐ง๐ช Belgium**: Now randomly selects from `047`, `048`, or `049` prefixes
- **๐ซ๐ท France**: Now randomly selects from `6` or `7` prefixes
- **๐ช๐ธ Spain**: Now randomly selects from `6` or `7` prefixes
- **๐จ๐ญ Switzerland**: Now randomly selects from `076`, `077`, `078`, or `079` prefixes
- **๐ฆ๐น Austria**: Now randomly selects from `0664`, `0676`, or `0699` prefixes
- **๐ณ๐ด Norway**: Now randomly selects from `4x` or `9x` prefixes
- **๐ฉ๐ฐ Denmark**: Now randomly selects from `2x`, `3x`, `5x`, `6x`, `7x`, or `9x` prefixes
- **๐ซ๐ฎ Finland**: Now supports full range of `04x` prefixes plus `050`
- **๐ต๐น Portugal**: Now randomly selects from `91`, `92`, `93`, or `96` prefixes
- **๐ฎ๐ช Ireland**: Now randomly selects from `085`, `086`, `087`, or `089` prefixes
- **๐น๐ท Turkey**: Now randomly selects from various `053x` prefixes
- **๐ฒ๐ฆ Morocco**: Now randomly selects from `06` or `07` prefixes
### ๐ Corrected Number Lengths
All mobile numbers now follow exact official specifications:
- **Netherlands**: 15 characters (`0031 6 xxxxxxxx`)
- **Germany**: 16 characters (`0049 01x xxxxxxx`)
- **Belgium**: 16 characters (`0032 04x xxxxxxx`)
- **France**: 15 characters (`0033 x xxxxxxxx`)
- **United Kingdom**: 16 characters (`0044 7 xxxxxxxxx`)
- **Spain**: 14 characters (`0034 xxxxxxxxx`)
- **Italy**: 16 characters (`0039 xxx xxxxxxx`)
- **Austria**: 17 characters (`0043 0xxx xxxxxxx`)
- **Switzerland**: 15 characters (`0041 07x xxxxxx`)
- **Sweden**: 15 characters (`0046 7 xxxxxxxx`)
- **Norway**: 13 characters (`0047 xxxxxxxx`)
- **Denmark**: 13 characters (`0045 xxxxxxxx`)
- **Finland**: 16 characters (`00358 0xx xxxxxx`)
- **Portugal**: 16 characters (`00351 xx xxxxxxx`)
- **Ireland**: 16 characters (`00353 0xx xxxxxx`)
- **Turkey**: 16 characters (`0090 0xxx xxxxxx`)
- **Morocco**: 16 characters (`00212 0x xxxxxxx`)
### ๐ง Validator Updates
- **Enhanced Validation**: All validators now properly match the new `00` format
- **Flexible Prefix Matching**: Validators now accept all valid prefixes for each country
- **Improved Accuracy**: Regex patterns now precisely match official number formats
### ๐งช Test Suite Improvements
- **100% Pass Rate**: All 85 unit tests now pass successfully
- **Comprehensive Coverage**: Added specific format tests for all 17 countries
- **Cross-Validation**: Ensured all generated numbers pass their respective validators
- **Negative Testing**: Improved invalid number rejection tests
### ๐ Bug Fixes
- Fixed incorrect number lengths in test expectations
- Corrected validator regex patterns to match actual generator output
- Resolved cross-validation issues between generators and validators
- Fixed prefix validation for countries with multiple valid prefixes
## Version 1.2.2 (Previous)
### Features
- Support for 17 European and North African countries
- Dutch BSN, IBAN, and KvK number generation
- Real Dutch address data integration via PDOK API
- Comprehensive postcode validation
## Version 1.2.1 (Previous)
### Features
- Initial mobile and landline number generation
- Basic validation functions
- Dutch-specific identifier support
## Version 1.2.0 (Previous)
### Features
- Core phone number generation functionality
- Multi-country support foundation
- TypeScript type definitions
---
## Migration Guide (1.2.2 โ 1.2.3)
If you're upgrading from version 1.2.2, please note the breaking change in mobile number format:
### Before (v1.2.2):
```ts
const number = generateTestMobileNumber.Netherlands();
console.log(number); // "+31 6 12345678"
```
### After (v1.2.3):
```ts
const number = generateTestMobileNumber.Netherlands();
console.log(number); // "0031 6 12345678"
```
### Update Your Code:
1. **Tests**: Update any hardcoded expectations that use `+` prefix
2. **Validators**: Use the updated `isTestMobileNumber` functions
3. **Display**: Update UI components that format or display phone numbers
4. **Storage**: Consider data migration if you have stored phone numbers
### Compatibility:
- All validators automatically handle the new format
- Generated numbers remain in safe test ranges
- All country specifications are now more accurate
- No functional changes to other generators (BSN, IBAN, etc.)
The new format is more consistent with international dialing conventions and provides better compatibility across different systems.