- ViraStack Mask
v2.3.0Minor
Test data with `@virastack/mask/testing`, and a plate preset
Generate valid TCKNs and IBANs for tests and seed data, and check Turkish registration plates against the official regulation.
What changed
- New
@virastack/mask/testingentry: Test and seed data generators. The root and/serverentries don't export them, so they never reach production bundles. No React and no"use client", about 2 KB. generateTCKN(): A TCKN that passesisValidTCKN. No list is kept; every number is made on the spot.generateIBAN(country, { bank }): Turkish IBANs follow the national layout with a bank fromturkishBanks;bank: "0062"picks Garanti. Every country in the IBAN registry works, with a digits-only account part that passesisValidIBAN.seedoption: An integer seed gives the same value on every run and platform, so snapshots and seed data stay stable.platepreset andisValidPlate(): Shows34 ABC 123, stores34ABC123. Province code 01–81, then 1 letter and 4–5 digits, 2 letters and 3–4 digits, or 3 letters and 2–3 digits, from article 34 of the vehicle registration regulation. Name plates and special plates are not checked.- Smaller bank-only bundles: Importing only
getTurkishBankno longer pulls in every preset; it drops from 2.3 KB to under 1 KB.
Why
Tests and seed scripts kept copying the same few example numbers, and a hand-made TCKN or IBAN usually fails the checksum. A generated value can belong to a real person or account, so the generators are for tests and seed data only.