Skip to content

Releases: identique/idnumbers-npm

v1.1.0 - Code Quality Improvements and Documentation

30 Nov 11:59

Choose a tag to compare

🧹 Code Quality Improvements and Documentation

What's Changed

🔧 Code Quality Improvements

  • Removed dead code paths - Cleaned up non-functional case statements that were identified during code review
    • Removed empty case statements in parseIdInfo() function
    • Removed dead code for Peru (PE) validator (always returned false with incorrect country code)
    • Removed dead code for Tunisia (TN) validator (always returned false with incorrect country code)
    • Removed incomplete implementation comments that provided no actionable value

📚 Documentation

  • Added CHANGELOG.md - Following Keep a Changelog format
    • Documents all releases (v1.0.0, v1.0.1, and future versions)
    • Includes issue and PR references for traceability
    • Follows Semantic Versioning conventions
  • Added CHANGELOG-MAINTENANCE.md - Comprehensive guide for contributors
    • When and how to update the CHANGELOG
    • Category guidelines and examples
    • Release process documentation

✨ Improvements

  • Better code maintainability - Reduced main dispatcher file complexity
  • Clearer codebase - Removed confusing placeholder code
  • Improved developer experience - Clear documentation for maintaining changelog

Installation

npm install idnumbers@1.1.0

Migration from v1.0.1

This is a minor release with internal improvements:

  • No breaking changes
  • 100% backward compatible with v1.0.1
  • No API changes - All existing functionality works exactly the same
  • ℹ️ Peru and Tunisia were never supported - Dead code removal has no functional impact

Test Results

Test Suites: 6 passed, 6 total
Tests:       402 passed, 402 total
Time:        ~2.5s

All quality checks passed:

  • ✅ TypeScript compilation
  • ✅ ESLint checks
  • ✅ Prettier formatting
  • ✅ All tests passing

What's Next

Focus areas for upcoming releases:

  • Additional country support
  • Enhanced parsing functions for existing countries
  • Improved test coverage for specific validators
  • Community contributions welcome!

Contributors

Thank you to all contributors who helped improve this release!


Full Changelog: v1.0.1...v1.1.0

v1.0.1 - Bug Fixes and Test Coverage Improvements

17 Nov 12:37

Choose a tag to compare

�� Bug Fixes and Test Coverage Improvements

What's Changed

�� Critical Bug Fix

  • Fixed Lithuanian ID year calculation - Lithuanian Personal Codes with first digit '3' or '4' were incorrectly parsed as 1800s instead of 1900s
    • This affected all Lithuanian IDs for people born between 1900-1999
    • Year calculation now uses clear, explicit logic instead of a flawed mathematical formula
    • All century digits (1-8) now properly validated and mapped

✨ New Features

  • Added parseIdInfo support for Iceland (ISL), Lithuania (LTU), and Luxembourg (LUX)
    • These countries can now extract detailed information from ID numbers
    • Birth dates, gender, and other metadata now available

📊 Test Coverage Improvements

  • Added 101 comprehensive tests for 9 low-coverage countries
  • Overall coverage improved from 61.95% to 68.24% (+6.29%)

Coverage by Country:

  • 🇭🇰 Hong Kong (HKG): 20.00% → 100.00% (+80.00%)
  • 🇨🇴 Colombia (COL): 20.68% → 89.65% (+68.97%)
  • 🇮🇸 Iceland (ISL): 15.38% → 82.05% (+66.67%)
  • 🇱🇹 Lithuania (LTU): 15.38% → 81.35% (+65.97%)
  • 🇭🇺 Hungary (HUN): 13.04% → 76.08% (+63.04%)
  • 🇦🇱 Albania (ALB): 17.64% → 79.41% (+61.77%)
  • 🇱🇺 Luxembourg (LUX): 15.38% → 78.12% (+62.74%)
  • 🇮🇷 Iran (IRN): 20.83% → 83.33% (+62.50%)
  • 🇮🇱 Israel (ISR): 25.00% → 75.00% (+50.00%)

📝 Documentation

  • Fixed country count discrepancy (103 → 80 countries) in package.json

Installation

npm install idnumbers@1.0.1

Migration from v1.0.0

This is a patch release with bug fixes and improvements:

  • No breaking changes
  • Backward compatible with v1.0.0
  • ⚠️ Lithuanian IDs will now return correct birth years (if you were using the old incorrect values, update your logic)

Example Usage

import { validateNationalId, parseIdInfo } from 'idnumbers';

// Fixed: Lithuanian ID now correctly parses year
const ltu = parseIdInfo('LTU', '39001010077');
console.log(ltu?.birthDate.getFullYear()); // 1990 (was 1890 before)

// New: Iceland parsing support
const isl = parseIdInfo('ISL', '120174-3399');
console.log(isl?.birthDate); // 1974-01-12

// New: Luxembourg parsing support
const lux = parseIdInfo('LUX', '1893120105732');
console.log(lux?.birthDate); // 1893-12-01

Full Test Results

Test Suites: 6 passed, 6 total
Tests:       402 passed, 402 total
Time:        6.405s

Contributors

Special thanks to all contributors who helped improve this release!


Full Changelog: v1.0.0...v1.0.1

v1.0.0 - Initial Release

02 Nov 02:59

Choose a tag to compare

🎉 Initial release of idnumbers package

Features

  • 80 countries supported - Comprehensive coverage across all continents
  • 🔍 Validation - Verify ID number format and checksums
  • 📊 Parsing - Extract information like birth date, gender, and citizenship
  • 🛡️ Type-safe - Full TypeScript support with type definitions
  • 📦 Zero dependencies - Lightweight and secure
  • Well-tested - 797 tests with 100% pass rate
  • 🌍 Multiple formats - Supports various ID number formats per country

Installation

npm install idnumbers

Quick Start

import { validateNationalId, parseIdInfo } from 'idnumbers';

// Validate a US Social Security Number
const result = validateNationalId('USA', '123-45-6789');
console.log(result.isValid); // true or false

// Parse information from a South African ID
const info = parseIdInfo('ZAF', '8001015009087');
console.log(info);
// {
//   yyyymmdd: Date(1980-01-01),
//   gender: 'male',
//   citizenship: 'citizen'
// }

Supported Countries

80+ countries including: USA, UK, France, Germany, Japan, China, India, Brazil, Canada, Australia, South Africa, and many more.

See full documentation: https://github.com/identique/idnumbers-npm#readme