diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bda8e5d..fcaad19 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,5 +28,8 @@ jobs: - name: Run tests run: npm test + - name: Moldova regression tests + run: npm run test:moldova + - name: CLI smoke test run: node ./bin/cli.mjs "AB 123 CD" --countries IT --type car --pretty diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..22c5620 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,57 @@ +# Changelog + +Notable changes to **@codecorn/euro-plate-validator**. See also [GitHub releases](https://github.com/CodeCornTech/euro-plate-validator/releases). + +## Upcoming release — publication pending + +### 1.0.16 + +> Prepared in [PR #3](https://github.com/CodeCornTech/euro-plate-validator/pull/3). The GitHub release and npm publication are deferred until after the merge into `main`. + +#### Added + +- **Moldova (`MD`)** added to the country codes, names, flag lookups and default multi-country validation (30 supported countries total). +- Seven Moldovan plate variants proposed in [issue #2](https://github.com/CodeCornTech/euro-plate-validator/issues/2): + - Current standard: `ABC 123` + - Historical four-letter: `AB CD 123` + - Chișinău (C): `C AB 123` + - Chișinău (K): `K AB 123` + - Diplomatic: `CD 123 AB` + - Police (MAI): `MAI 1234` + - Transnistria: `T 123 AB` +- Moldova display formats and Inputmask alternatives, with IT/EN country labels in the browser client. +- Matching Moldova regex patterns in the standalone PHP validator. +- Positive, negative and randomized Moldova test coverage; dedicated GitHub Actions regression step. +- English and Italian README documentation with format examples and an API usage snippet. + +#### Fixed + +- Preserve Inputmask alternative-mask arrays when normalizing mask patterns, instead of converting them to a comma-separated string. +- Add a TypeScript overload for `string | string[]` in the browser mask normalizer. + +#### Notes + +- This package validates **syntax only**, not actual registration, plate authenticity or legal recognition of regional plates. +- Lowercase input and valid compact forms without spaces are supported; hyphens are not accepted by the Moldova formats. +- Multiple country matches are possible in AUTO mode when patterns overlap. +- No Moldova motorcycle-specific format or new runtime dependency was added. + +### 1.0.15 + +- Improved Inputmask merging while retaining default definitions. +- Added uppercase-normalizing `L` letter token and safer restricted-letter masks. +- Improved placeholder derivation, mask application during country switching and client logging. + +### 1.0.14 + +- See [GitHub release v1.0.14](https://github.com/CodeCornTech/euro-plate-validator/releases/tag/v1.0.14). + +### 1.0.13 + +- Configurable inline, block or hidden validation status, with icon and text options. +- Improved handling of empty/partial input and country changes. + +### 1.0.12 + +- Introduced `autoFocusOnInit` and `preserveInputAttrs`. +- Standardized `epv__*` CSS classes and updated Inputmask autoload and localization behavior. diff --git a/README.md b/README.md index 0698b2f..9712315 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🌍 @codecorn/euro-plate-validator -> 🚗 European license plate validator (Russia excluded). Multi-country, regex-based validation for EU/EEA license plates. Works in **Node.js**, **TypeScript**, and the **browser** (with a lightweight UI client). +> 🚗 Syntax-only license plate validator for European and nearby countries, including Moldova and Ukraine (Russia excluded). Supports Node.js, TypeScript, browser and PHP. [](./README_IT.md) [](https://codecorntech.github.io/euro-plate-validator/) @@ -14,7 +14,7 @@ ## ✨ Features -- ✅ **Multi-country** support (25+ EU/EEA) +- ✅ **30 supported countries**, including Moldova (`MD`) — automatic or fixed-country mode - 🚫 **Russia excluded** by design - 🔠 Normalizes input (spaces, hyphens, case) - 🧠 Smart regex engine per-country (car/motorcycle aware) @@ -33,52 +33,29 @@ npm install @codecorn/euro-plate-validator --- -## 🔗 CDN (v1.0.15) +## 🔗 CDN (v1.0.16 — after npm publication) -> Use **versioned URLs** to avoid stale CDN caches. +> v1.0.16 CDN assets will be available **after npm publishing**. Use versioned URLs to avoid stale caches. ### Core module -- **ESM (browser)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/browser/index.esm.js` +- **ESM (browser)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/browser/index.esm.js` -- **IIFE (global `window.EuroPlateValidator`)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/browser/index.iife.min.js` +- **IIFE (global `window.EuroPlateValidator`)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/browser/index.iife.min.js` ### Client SDK (UI) -- **ESM** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/client/index.mjs` +- **ESM** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/client/index.mjs` -- **CJS (Node)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/client/europlate.client.cjs` +- **CJS (Node)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/client/index.cjs` ### Assets (CSS) -- `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/assets/css/styles.css` +- `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/assets/css/styles.css` - (compat alias) `…/assets/css/styles.css` --- -## 🧠 Core API - -### Node.js / TypeScript - -```ts -import { validatePlate } from "@codecorn/euro-plate-validator"; - -// Italy (car) -validatePlate("AB 123 CD", ["IT"], { vehicleType: "car" }); -// → { isValid: true, matches: [{country:"IT", name:"Italy"}], checked:["IT"] } - -// UK vs IE -validatePlate("AB12 CDE", ["UK", "IE"]); -``` - ---- - -## 🧩 Browser Client SDK — `createEuroPlate()` - -The browser client auto-generates a full UI (`flag + input + dropdown + status`) or attaches to an existing ``. ecco la versione **EN** tradotta 1 : 1 . Ho lasciato **il codice invariato** , e ho applicato lo spazio prima / dopo la punteggiatura solo al testo in prosa . - ---- - ## 🧠 Core API ( Node / TS ) ```ts @@ -197,13 +174,13 @@ type EuroPlateInstance = { ### A ) Quick start with a shared `common` config + autoload deps ( Inputmask , jQuery , Toastr ) ```html - +
'; } @@ -386,14 +363,49 @@ Exit codes: --- -## 🌍 Supported Countries +## 🌍 Supported countries + +The package supports **30 countries**, including Moldova (`MD`). -🇮🇹 IT | 🇬🇧 UK | 🇩🇪 DE | 🇫🇷 FR | 🇪🇸 ES | 🇵🇹 PT | 🇳🇱 NL | 🇧🇪 BE | 🇨🇭 CH | 🇦🇹 AT | 🇮🇪 IE | 🇱🇺 LU 🇩🇰 DK | 🇸🇪 SE | 🇳🇴 NO | 🇫🇮 FI | 🇵🇱 PL | 🇨🇿 CZ | 🇸🇰 SK | 🇭🇺 HU | 🇷🇴 RO | 🇧🇬 BG | 🇸🇮 SI | 🇭🇷 HR | 🇬🇷 GR 🇱🇹 LT | 🇱🇻 LV | 🇪🇪 EE | 🇺🇦 UA +🇮🇹 IT | 🇬🇧 UK | 🇩🇪 DE | 🇫🇷 FR | 🇪🇸 ES | 🇵🇹 PT | 🇳🇱 NL | 🇧🇪 BE | 🇨🇭 CH | 🇦🇹 AT +🇮🇪 IE | 🇱🇺 LU | 🇩🇰 DK | 🇸🇪 SE | 🇳🇴 NO | 🇫🇮 FI | 🇵🇱 PL | 🇨🇿 CZ | 🇸🇰 SK | 🇭🇺 HU +🇷🇴 RO | 🇧🇬 BG | 🇸🇮 SI | 🇭🇷 HR | 🇬🇷 GR | 🇱🇹 LT | 🇱🇻 LV | 🇪🇪 EE | 🇺🇦 UA | 🇲🇩 MD + +### 🇲🇩 Moldova (MD) + +| Category | Example | +| --- | --- | +| Current standard | `ABC 123` | +| Four-letter legacy | `AB CD 123` | +| Chișinău C | `C AB 123` | +| Chișinău K | `K AB 123` | +| Diplomatic | `CD 123 AB` | +| Police / MAI | `MAI 1234` | +| Transnistria | `T 123 AB` | + +```ts +import { validatePlate, getInputMask } from "@codecorn/euro-plate-validator"; +validatePlate("ABC 123", ["MD"], { vehicleType: "car" }).isValid; // true +validatePlate("MAI 1234", ["MD"]).isValid; // true +validatePlate("ABC-123", ["MD"]).isValid; // false +getInputMask("MD"); // seven mask variants +``` + +Lowercase and compact unspaced forms are supported, but hyphens are not. Validation checks **syntax only**, not actual registration or legal recognition. AUTO mode may report multiple countries for overlapping patterns. See [issue #2](https://github.com/CodeCornTech/euro-plate-validator/issues/2). --- ## 🧾 Changelog (highlights) +### 1.0.16 + +- Moldova (`MD`) support: seven plate formats, metadata, flag and IT/EN country labels. +- PHP validator updated alongside the TypeScript core. +- Inputmask now preserves arrays of alternative masks. +- Dedicated positive/negative tests and CI regression coverage. + +> **Upcoming:** GitHub release and npm publish after merge. See [CHANGELOG.md](./CHANGELOG.md). + ### 1.0.15 - **Inputmask** @@ -423,11 +435,11 @@ Exit codes: - `showStatusText: boolean` - `iconPosition: "left" | "right"` -- Riserva spazio automatica via `:has([data-state])` -- Nessuno stato su campo vuoto / parziale -- Fix cambio paese (IT↔FR) e Inputmask merge (`A/H/9`) -- Refactor UI status (`setValidityUI` unico writer) -- Add `clearStatusUI()` per idle neutro +- Automatic layout space reservation via `:has([data-state])` +- No status shown for empty or partial input +- Fixed country switching (IT↔FR) and Inputmask definitions merging (`A/H/9`) +- Refactored status rendering with `setValidityUI` as the single writer +- Added `clearStatusUI()` for a neutral idle state --- diff --git a/README_IT.md b/README_IT.md index 05d9c89..9312517 100644 --- a/README_IT.md +++ b/README_IT.md @@ -1,6 +1,6 @@ # 🌍 @codecorn/euro-plate-validator -> 🚗 Validatore di targhe europee (Russia esclusa). Validazione della sintassi basata su espressioni regex multi-paese per targhe UE/SEE. Funziona in **Node.js/TypeScript** e nel **browser** (UI client leggera). +> 🚗 Validatore sintattico per targhe europee e Paesi vicini, inclusi Moldavia e Ucraina (Russia esclusa). Per Node.js, TypeScript, browser e PHP. [](./README.md) [](https://codecorntech.github.io/euro-plate-validator/) @@ -14,7 +14,7 @@ ## ✨ Caratteristiche -- ✅ **Multi-country** (25+ EU/EEA) — auto o paese fisso +- ✅ **30 Paesi supportati**, inclusa la Moldavia (`MD`) — modalità automatica o Paese fisso - 🏍️ Tipi veicolo: `car`, `bike`, `any` - 🔠 Normalizzazione (spazi/trattini) + formattatori per paese - ↕️ **Minuscole accettate** in input e forzate a **MAIUSCOLO** in mask (token `L` custom) @@ -33,25 +33,25 @@ npm install @codecorn/euro-plate-validator --- -## 🔗 CDN (v1.0.13) +## 🔗 CDN (v1.0.16 — dopo la pubblicazione npm) -> Usa URL **versionati** per evitare cache stantia. +> La v1.0.16 verrà resa disponibile su CDN **dopo la pubblicazione npm**. Usare URL versionati per evitare cache obsolete. ### Core (browser) -- **ESM (browser)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/browser/index.esm.js` +- **ESM (browser)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/browser/index.esm.js` -- **IIFE (global `window.EuroPlateValidator`)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/browser/index.iife.min.js` +- **IIFE (global `window.EuroPlateValidator`)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/browser/index.iife.min.js` ### Client SDK (UI) -- **ESM** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/client/index.mjs` +- **ESM** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/client/index.mjs` -- **CJS (Node)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/client/europlate.client.cjs` +- **CJS (Node)** `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/client/index.cjs` ### Assets CSS -- `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.15/dist/assets/css/styles.css` +- `https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.16/dist/assets/css/styles.css` - (compat shim) `…/assets/css/styles.css` → include/forward a `styles.css` > Se vedi file non aggiornati, puoi forzare un purge su jsDelivr. @@ -177,13 +177,13 @@ type EuroPlateInstance = { ### A ) Avvio rapido con configurazione `common` condivisa + autoload dipendenze ( Inputmask , jQuery , Toastr ) ```html - + '; } @@ -393,13 +393,48 @@ Exit code: `0` valido, `1` non valido, `2` errori input. --- -## 🌍 Supported Countries +## 🌍 Paesi supportati -🇮🇹 IT | 🇬🇧 UK | 🇩🇪 DE | 🇫🇷 FR | 🇪🇸 ES | 🇵🇹 PT | 🇳🇱 NL | 🇧🇪 BE | 🇨🇭 CH | 🇦🇹 AT | 🇮🇪 IE | 🇱🇺 LU 🇩🇰 DK | 🇸🇪 SE | 🇳🇴 NO | 🇫🇮 FI | 🇵🇱 PL | 🇨🇿 CZ | 🇸🇰 SK | 🇭🇺 HU | 🇷🇴 RO | 🇧🇬 BG | 🇸🇮 SI | 🇭🇷 HR | 🇬🇷 GR 🇱🇹 LT | 🇱🇻 LV | 🇪🇪 EE | 🇺🇦 UA +Il pacchetto supporta **30 Paesi**, inclusa la Moldavia (`MD`). + +🇮🇹 IT | 🇬🇧 UK | 🇩🇪 DE | 🇫🇷 FR | 🇪🇸 ES | 🇵🇹 PT | 🇳🇱 NL | 🇧🇪 BE | 🇨🇭 CH | 🇦🇹 AT +🇮🇪 IE | 🇱🇺 LU | 🇩🇰 DK | 🇸🇪 SE | 🇳🇴 NO | 🇫🇮 FI | 🇵🇱 PL | 🇨🇿 CZ | 🇸🇰 SK | 🇭🇺 HU +🇷🇴 RO | 🇧🇬 BG | 🇸🇮 SI | 🇭🇷 HR | 🇬🇷 GR | 🇱🇹 LT | 🇱🇻 LV | 🇪🇪 EE | 🇺🇦 UA | 🇲🇩 MD + +### 🇲🇩 Moldavia (MD) + +| Categoria | Esempio | +| --- | --- | +| Standard attuale | `ABC 123` | +| Storica a quattro lettere | `AB CD 123` | +| Chișinău C | `C AB 123` | +| Chișinău K | `K AB 123` | +| Diplomatica | `CD 123 AB` | +| Polizia / MAI | `MAI 1234` | +| Transnistria | `T 123 AB` | + +```ts +import { validatePlate, getInputMask } from "@codecorn/euro-plate-validator"; +validatePlate("ABC 123", ["MD"], { vehicleType: "car" }).isValid; // true +validatePlate("MAI 1234", ["MD"]).isValid; // true +validatePlate("ABC-123", ["MD"]).isValid; // false +getInputMask("MD"); // seven mask variants +``` + +Sono accettate le minuscole e le varianti compatte senza spazi, ma non i trattini. La verifica è **solo sintattica**, non prova che una targa sia immatricolata o legalmente riconosciuta. I formati condivisi possono generare più corrispondenze in modalità automatica. Vedi la [issue #2](https://github.com/CodeCornTech/euro-plate-validator/issues/2). --- -## 🧾 Changelog (highlights) +## 🧾 Novità e changelog + +### 1.0.16 + +- Supporto alle targhe moldave (`MD`): sette formati, metadati, bandiera e localizzazione IT/EN. +- Variante PHP aggiornata insieme al core TypeScript. +- Fix Inputmask: conserviamo gli array delle maschere alternative. +- Nuovi test positivi/negativi e regressione in CI. + +> **In preparazione:** release e pubblicazione npm solo dopo il merge. Leggi [CHANGELOG.md](./CHANGELOG.md). ### 1.0.15 @@ -418,7 +453,7 @@ Exit code: `0` valido, `1` non valido, `2` errori input. - **Docs** - CDN aggiornato a **1.0.15**. - Nota su minuscole accettate + uppercase automatico. - - ## Linee guida: **non** ridefinire `A`/`9`; definire solo token custom per alfabeti ristretti. + - Linee guida: **non** ridefinire `A`/`9`; definire solo token personalizzati per alfabeti ristretti. --- diff --git a/_php_variant/EuroPlateValidator.php b/_php_variant/EuroPlateValidator.php index 7e69794..ce81acd 100644 --- a/_php_variant/EuroPlateValidator.php +++ b/_php_variant/EuroPlateValidator.php @@ -95,6 +95,18 @@ function europlate_rx_map(): array 'LT' => ['name' => 'Lithuania', 'car' => ['/^[A-Z]{3}\s?\d{3}$/']], 'LV' => ['name' => 'Latvia', 'car' => ['/^[A-Z]{2}-\d{4}$/']], 'EE' => ['name' => 'Estonia', 'car' => ['/^\d{3}\s?[A-Z]{3}$/']], + 'MD' => [ + 'name' => 'Moldova', + 'car' => [ + '/^[A-Z]{3}\s?\d{3}$/', + '/^[A-Z]{2}\s?[A-Z]{2}\s?\d{3}$/', + '/^C\s?[A-Z]{2}\s?\d{3}$/', + '/^K\s?[A-Z]{2}\s?\d{3}$/', + '/^CD\s?\d{3}\s?[A-Z]{2}$/', + '/^MAI\s?\d{4}$/', + '/^T\s?\d{3}\s?[A-Z]{2}$/' + ] + ], 'UA' => ['name' => 'Ukraine', 'car' => ['/^[A-Z]{2}\s?\d{4}\s?[A-Z]{2}$/']] ]; } diff --git a/dist-types/client/europlate.client.d.ts.map b/dist-types/client/europlate.client.d.ts.map index 562bed1..1e110f3 100644 --- a/dist-types/client/europlate.client.d.ts.map +++ b/dist-types/client/europlate.client.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"europlate.client.d.ts","sourceRoot":"","sources":["../../src/client/europlate.client.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAMzE,wBAAsB,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,OAAkB,EAAE,GAAG,GAAE,UAAqB,iBAkB9H;AAMD,kCAAkC;AAClC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AAEjD,8CAA8C;AAC9C,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAC9B,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAC7B,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAC7B,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAC9B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,SAAS,CAAC,EAAE,WAAW,CAA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AI,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAE5C,+CAA+C;IAC/C,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAEtC,8DAA8D;IAC9D,cAAc,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IAEzC,sCAAsC;IACtC,QAAQ,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;IAEhC,mEAAmE;IACnE,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAEtC,4DAA4D;IAC5D,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAElC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAEjE,0CAA0C;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB,gDAAgD;IAChD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAypBF;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,gBAAgB,GAAG,iBAAiB,CA05BvF;AAQD;;;;;;;;;;;;;;;;;GAiBG"} \ No newline at end of file diff --git a/dist-types/countries.d.ts b/dist-types/countries.d.ts index 38a12b4..a867cd4 100644 --- a/dist-types/countries.d.ts +++ b/dist-types/countries.d.ts @@ -1,9 +1,9 @@ /** Tutti i country code supportati (Russia esclusa) */ -export type CountryKey = "IT" | "UK" | "DE" | "FR" | "ES" | "PT" | "NL" | "BE" | "CH" | "AT" | "IE" | "LU" | "DK" | "SE" | "NO" | "FI" | "PL" | "CZ" | "SK" | "HU" | "RO" | "BG" | "SI" | "HR" | "GR" | "LT" | "LV" | "EE" | "UA"; +export type CountryKey = "IT" | "UK" | "DE" | "FR" | "ES" | "PT" | "NL" | "BE" | "CH" | "AT" | "IE" | "LU" | "DK" | "SE" | "NO" | "FI" | "PL" | "CZ" | "SK" | "HU" | "RO" | "BG" | "SI" | "HR" | "GR" | "LT" | "LV" | "EE" | "UA" | "MD"; /** Tipo veicolo */ export type VehicleType = "car" | "motorcycle" | "any"; /** Lista di paesi supportati (const + tipizzato) */ -export declare const supportedCountries: readonly ["IT", "UK", "DE", "FR", "ES", "PT", "NL", "BE", "CH", "AT", "IE", "LU", "DK", "SE", "NO", "FI", "PL", "CZ", "SK", "HU", "RO", "BG", "SI", "HR", "GR", "LT", "LV", "EE", "UA"]; +export declare const supportedCountries: readonly ["IT", "UK", "DE", "FR", "ES", "PT", "NL", "BE", "CH", "AT", "IE", "LU", "DK", "SE", "NO", "FI", "PL", "CZ", "SK", "HU", "RO", "BG", "SI", "HR", "GR", "LT", "LV", "EE", "UA", "MD"]; export declare const FLAG_MAP: { readonly IT: "it"; readonly UK: "gb"; @@ -34,6 +34,7 @@ export declare const FLAG_MAP: { readonly LV: "lv"; readonly EE: "ee"; readonly UA: "ua"; + readonly MD: "md"; }; export declare const COUNTRY_NAMES: { readonly IT: "Italy"; @@ -65,6 +66,7 @@ export declare const COUNTRY_NAMES: { readonly LV: "Latvia"; readonly EE: "Estonia"; readonly UA: "Ukraine"; + readonly MD: "Moldova"; }; export type CountryCode = keyof typeof FLAG_MAP; /** diff --git a/dist-types/countries.d.ts.map b/dist-types/countries.d.ts.map index 40ff6d4..07ee3b7 100644 --- a/dist-types/countries.d.ts.map +++ b/dist-types/countries.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"countries.d.ts","sourceRoot":"","sources":["../src/countries.ts"],"names":[],"mappings":"AAIA,uDAAuD;AACvD,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAA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e,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAgC/D,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,eAAe,CAAC,CA2N1E,CAAC;AAIF,eAAO,MAAM,uBAAuB,8CAGnC,CAAC;AAGF,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,0BAE/C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAEnE;AAED;;;GAGG;AACH,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CA6LJ,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 780a28f..8946985 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@codecorn/euro-plate-validator", - "version": "1.0.14", + "version": "1.0.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@codecorn/euro-plate-validator", - "version": "1.0.14", + "version": "1.0.16", "license": "MIT", "bin": { "euro-plate-validator": "bin/cli.mjs" @@ -32,6 +32,91 @@ "inputmask": ">=5" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.10.tgz", + "integrity": "sha512-0NFWnA+7l41irNuaSVlLfgNT12caWJVLzp5eAVhZ0z1qpxbockccEt3s+149rE64VUI3Ml2zt8Nv5JVc4QXTsw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.10.tgz", + "integrity": "sha512-dQAxF1dW1C3zpeCDc5KqIYuZ1tgAdRXNoZP7vkBIRtKZPYe2xVr/d3SkirklCHudW1B45tGiUlz2pUWDfbDD4w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.10.tgz", + "integrity": "sha512-LSQa7eDahypv/VO6WKohZGPSJDq5OVOo3UoFR1E4t4Gj1W7zEQMUhI+lo81H+DtB+kP+tDgBp+M4oNCwp6kffg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.10.tgz", + "integrity": "sha512-MiC9CWdPrfhibcXwr39p9ha1x0lZJ9KaVfvzA0Wxwz9ETX4v5CHfF09bx935nHlhi+MxhA63dKRRQLiVgSUtEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.10.tgz", + "integrity": "sha512-JC74bdXcQEpW9KkV326WpZZjLguSZ3DfS8wrrvPMHgQOIEIG/sPXEN/V8IssoJhbefLRcRqw6RQH2NnpdprtMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/darwin-x64": { "version": "0.25.10", "cpu": [ @@ -47,10 +132,351 @@ "node": ">=18" } }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.10.tgz", + "integrity": "sha512-3ZioSQSg1HT2N05YxeJWYR+Libe3bREVSdWhEEgExWaDtyFbbXWb49QgPvFH8u03vUPX10JhJPcz7s9t9+boWg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.10.tgz", + "integrity": "sha512-LLgJfHJk014Aa4anGDbh8bmI5Lk+QidDmGzuC2D+vP7mv/GeSN+H39zOf7pN5N8p059FcOfs2bVlrRr4SK9WxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.10.tgz", + "integrity": "sha512-oR31GtBTFYCqEBALI9r6WxoU/ZofZl962pouZRTEYECvNF/dtXKku8YXcJkhgK/beU+zedXfIzHijSRapJY3vg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.10.tgz", + "integrity": "sha512-5luJWN6YKBsawd5f9i4+c+geYiVEw20FVW5x0v1kEMWNq8UctFjDiMATBxLvmmHA4bf7F6hTRaJgtghFr9iziQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.10.tgz", + "integrity": "sha512-NrSCx2Kim3EnnWgS4Txn0QGt0Xipoumb6z6sUtl5bOEZIVKhzfyp/Lyw4C1DIYvzeW/5mWYPBFJU3a/8Yr75DQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.10.tgz", + "integrity": "sha512-xoSphrd4AZda8+rUDDfD9J6FUMjrkTz8itpTITM4/xgerAZZcFW7Dv+sun7333IfKxGG8gAq+3NbfEMJfiY+Eg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.10.tgz", + "integrity": "sha512-ab6eiuCwoMmYDyTnyptoKkVS3k8fy/1Uvq7Dj5czXI6DF2GqD2ToInBI0SHOp5/X1BdZ26RKc5+qjQNGRBelRA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.10.tgz", + "integrity": "sha512-NLinzzOgZQsGpsTkEbdJTCanwA5/wozN9dSgEl12haXJBzMTpssebuXR42bthOF3z7zXFWH1AmvWunUCkBE4EA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.10.tgz", + "integrity": "sha512-FE557XdZDrtX8NMIeA8LBJX3dC2M8VGXwfrQWU7LB5SLOajfJIxmSdyL/gU1m64Zs9CBKvm4UAuBp5aJ8OgnrA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.10.tgz", + "integrity": "sha512-3BBSbgzuB9ajLoVZk0mGu+EHlBwkusRmeNYdqmznmMc9zGASFjSsxgkNsqmXugpPk00gJ0JNKh/97nxmjctdew==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.10.tgz", + "integrity": "sha512-QSX81KhFoZGwenVyPoberggdW1nrQZSvfVDAIUXr3WqLRZGZqWk/P4T8p2SP+de2Sr5HPcvjhcJzEiulKgnxtA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.10.tgz", + "integrity": "sha512-AKQM3gfYfSW8XRk8DdMCzaLUFB15dTrZfnX8WXQoOUpUBQ+NaAFCP1kPS/ykbbGYz7rxn0WS48/81l9hFl3u4A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.10.tgz", + "integrity": "sha512-7RTytDPGU6fek/hWuN9qQpeGPBZFfB4zZgcz2VK2Z5VpdUxEI8JKYsg3JfO0n/Z1E/6l05n0unDCNc4HnhQGig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.10.tgz", + "integrity": "sha512-5Se0VM9Wtq797YFn+dLimf2Zx6McttsH2olUBsDml+lm0GOCRVebRWUvDtkY4BWYv/3NgzS8b/UM3jQNh5hYyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.10.tgz", + "integrity": "sha512-XkA4frq1TLj4bEMB+2HnI0+4RnjbuGZfet2gs/LNs5Hc7D89ZQBHQ0gL2ND6Lzu1+QVkjp3x1gIcPKzRNP8bXw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.10.tgz", + "integrity": "sha512-AVTSBhTX8Y/Fz6OmIVBip9tJzZEUcY8WLh7I59+upa5/GPhh2/aM6bvOMQySspnCCHvFi79kMtdJS1w0DXAeag==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.10.tgz", + "integrity": "sha512-fswk3XT0Uf2pGJmOpDB7yknqhVkJQkAQOcW/ccVOtfx05LkbWOaRAtn5SaqXypeKQra1QaEa841PgrSL9ubSPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.10.tgz", + "integrity": "sha512-ah+9b59KDTSfpaCg6VdJoOQvKjI33nTaQr4UluQwW7aEwZQsbMCfTmfEO4VyewOxx4RaDT/xCy9ra2GPWmO7Kw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.10.tgz", + "integrity": "sha512-QHPDbKkrGO8/cz9LKVnJU22HOi4pxZnZhhA2HYHez5Pz4JeffhDjf85E57Oyco163GnzNCVkZK0b/n4Y0UHcSw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.10.tgz", + "integrity": "sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.9.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "eslint-visitor-keys": "^3.4.3" }, @@ -68,6 +494,7 @@ "version": "3.4.3", "dev": true, "license": "Apache-2.0", + "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -79,6 +506,7 @@ "version": "4.12.1", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -87,6 +515,7 @@ "version": "0.21.0", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", @@ -100,6 +529,7 @@ "version": "0.4.0", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@eslint/core": "^0.16.0" }, @@ -111,6 +541,7 @@ "version": "0.16.0", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@types/json-schema": "^7.0.15" }, @@ -122,6 +553,7 @@ "version": "3.3.1", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -144,6 +576,7 @@ "version": "9.37.0", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -155,6 +588,7 @@ "version": "2.1.6", "dev": true, "license": "Apache-2.0", + "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -163,6 +597,7 @@ "version": "0.4.0", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@eslint/core": "^0.16.0", "levn": "^0.4.1" @@ -172,29 +607,51 @@ } }, "node_modules/@humanfs/core": { - "version": "0.19.1", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", "dev": true, "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@humanfs/types": "^0.15.0" + }, "engines": { "node": ">=18.18.0" } }, "node_modules/@humanfs/node": { - "version": "0.16.7", + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { - "@humanfs/core": "^0.19.1", + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", "@humanwhocodes/retry": "^0.4.0" }, "engines": { "node": ">=18.18.0" } }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=18.18.0" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "dev": true, "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=12.22" }, @@ -207,6 +664,7 @@ "version": "0.4.3", "dev": true, "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=18.18" }, @@ -215,25 +673,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@isaacs/balanced-match": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@isaacs/brace-expansion": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@isaacs/balanced-match": "^4.0.1" - }, - "engines": { - "node": "20 || >=22" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "dev": true, @@ -264,7 +703,8 @@ "node_modules/@types/estree": { "version": "1.0.8", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/inputmask": { "version": "5.0.7", @@ -286,7 +726,8 @@ "node_modules/@types/json-schema": { "version": "7.0.15", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/node": { "version": "24.6.2", @@ -336,14 +777,18 @@ "version": "5.3.2", "dev": true, "license": "MIT", + "peer": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/ajv": { - "version": "6.12.6", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -383,17 +828,22 @@ "node_modules/argparse": { "version": "2.0.1", "dev": true, - "license": "Python-2.0" + "license": "Python-2.0", + "peer": true }, "node_modules/balanced-match": { "version": "1.0.2", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/brace-expansion": { - "version": "1.1.12", + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -403,6 +853,7 @@ "version": "3.1.0", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -411,6 +862,7 @@ "version": "4.1.2", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -441,7 +893,8 @@ "node_modules/concat-map": { "version": "0.0.1", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/cross-spawn": { "version": "7.0.6", @@ -460,6 +913,7 @@ "version": "4.4.3", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ms": "^2.1.3" }, @@ -475,7 +929,8 @@ "node_modules/deep-is": { "version": "0.1.4", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/eastasianwidth": { "version": "0.2.0", @@ -531,6 +986,7 @@ "version": "4.0.0", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -602,7 +1058,6 @@ "version": "10.1.8", "dev": true, "license": "MIT", - "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -646,6 +1101,7 @@ "version": "8.4.0", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -661,6 +1117,7 @@ "version": "4.2.1", "dev": true, "license": "Apache-2.0", + "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -672,6 +1129,7 @@ "version": "10.4.0", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", @@ -688,6 +1146,7 @@ "version": "1.6.0", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -699,6 +1158,7 @@ "version": "4.3.0", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -710,6 +1170,7 @@ "version": "5.3.0", "dev": true, "license": "BSD-2-Clause", + "peer": true, "engines": { "node": ">=4.0" } @@ -718,6 +1179,7 @@ "version": "2.0.3", "dev": true, "license": "BSD-2-Clause", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -725,7 +1187,8 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-diff": { "version": "1.3.0", @@ -735,17 +1198,20 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/file-entry-cache": { "version": "8.0.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "flat-cache": "^4.0.0" }, @@ -757,6 +1223,7 @@ "version": "5.0.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -772,6 +1239,7 @@ "version": "4.0.1", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" @@ -781,9 +1249,12 @@ } }, "node_modules/flatted": { - "version": "3.3.3", + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/foreground-child": { "version": "3.3.1", @@ -801,13 +1272,16 @@ } }, "node_modules/glob": { - "version": "11.0.3", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.1.0.tgz", + "integrity": "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "dependencies": { "foreground-child": "^3.3.1", "jackspeak": "^4.1.1", - "minimatch": "^10.0.3", + "minimatch": "^10.1.1", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^2.0.0" @@ -826,6 +1300,7 @@ "version": "6.0.2", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -833,15 +1308,40 @@ "node": ">=10.13.0" } }, - "node_modules/glob/node_modules/minimatch": { - "version": "10.0.3", + "node_modules/glob/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, - "license": "ISC", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", "dependencies": { - "@isaacs/brace-expansion": "^5.0.0" + "balanced-match": "^4.0.2" }, "engines": { "node": "20 || >=22" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -851,6 +1351,7 @@ "version": "14.0.0", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -862,6 +1363,7 @@ "version": "4.0.0", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -870,6 +1372,7 @@ "version": "5.3.2", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 4" } @@ -878,6 +1381,7 @@ "version": "3.3.1", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -893,6 +1397,7 @@ "version": "0.1.4", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.8.19" } @@ -906,6 +1411,7 @@ "version": "2.1.1", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -922,6 +1428,7 @@ "version": "4.0.3", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -949,9 +1456,22 @@ } }, "node_modules/js-yaml": { - "version": "4.1.0", - "dev": true, + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], "license": "MIT", + "peer": true, "dependencies": { "argparse": "^2.0.1" }, @@ -962,22 +1482,26 @@ "node_modules/json-buffer": { "version": "3.0.1", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/keyv": { "version": "4.5.4", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "json-buffer": "3.0.1" } @@ -986,6 +1510,7 @@ "version": "0.4.1", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -998,6 +1523,7 @@ "version": "6.0.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -1011,7 +1537,8 @@ "node_modules/lodash.merge": { "version": "4.6.2", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/lru-cache": { "version": "11.2.2", @@ -1022,9 +1549,12 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1043,17 +1573,20 @@ "node_modules/ms": { "version": "2.1.3", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/natural-compare": { "version": "1.4.0", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/optionator": { "version": "0.9.4", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -1070,6 +1603,7 @@ "version": "3.1.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -1084,6 +1618,7 @@ "version": "5.0.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -1103,6 +1638,7 @@ "version": "1.0.1", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "callsites": "^3.0.0" }, @@ -1114,6 +1650,7 @@ "version": "4.0.0", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -1145,6 +1682,7 @@ "version": "1.2.1", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8.0" } @@ -1153,7 +1691,6 @@ "version": "3.6.2", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -1179,6 +1716,7 @@ "version": "2.3.1", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -1187,6 +1725,7 @@ "version": "4.0.0", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=4" } @@ -1331,6 +1870,7 @@ "version": "3.1.1", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" }, @@ -1342,6 +1882,7 @@ "version": "7.2.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -1372,6 +1913,7 @@ "version": "0.4.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -1402,6 +1944,7 @@ "version": "4.4.1", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "punycode": "^2.1.0" } @@ -1424,6 +1967,7 @@ "version": "1.2.5", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -1513,6 +2057,7 @@ "version": "0.1.0", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index ec917a2..ff205d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@codecorn/euro-plate-validator", - "version": "1.0.15", + "version": "1.0.16", "description": "European license plate validator (Russia excluded).Syntax-only validation via regex for multiple EU/EEA countries including Italy, UK, Germany, France, Spain and more.Supports Node.js (TypeScript package) and PHP library.", "keywords": [ "license-plate", @@ -24,7 +24,8 @@ "belgium", "scandinavia", "balkans", - "ukraine" + "ukraine", + "moldova" ], "type": "module", "main": "./dist/index.cjs", @@ -109,6 +110,7 @@ "cli-test": "node ./bin/cli.mjs \"AB 123 CD\" --countries IT --type car --pretty", "test": "node -e \"import('./dist/index.js').then(m=>console.log(m.validatePlate('AB 123 CD',['IT'])))\"", "test:samples": "npm run build && node ./scripts/test-samples.mjs", + "test:moldova": "node ./scripts/test-moldova.mjs", "test:random": "npm run build && node ./scripts/test-random.mjs", "format": "prettier --write .", "format:check": "prettier --check ." @@ -132,5 +134,8 @@ }, "engines": { "node": ">=18" + }, + "allowScripts": { + "esbuild": true } } diff --git a/scripts/test-moldova.mjs b/scripts/test-moldova.mjs new file mode 100644 index 0000000..9d1ffd0 --- /dev/null +++ b/scripts/test-moldova.mjs @@ -0,0 +1,40 @@ +// Issue #2 - Moldova syntax regression tests (run after npm run build). +import assert from "node:assert/strict"; +import { supportedCountries, COUNTRY_CODES, COUNTRIES, RX, FLAG_MAP, normalizeCode, getFlagSlug, getCountryName, getInputMask, getDisplayFormat, validatePlate } from "../dist/index.js"; + +assert.ok(supportedCountries.includes("MD")); +assert.ok(COUNTRY_CODES.includes("MD")); +assert.ok(COUNTRIES.some((country) => country.code === "MD")); +assert.equal(normalizeCode("md"), "MD"); +assert.equal(getFlagSlug("MD"), "md"); +assert.equal(FLAG_MAP.MD, "md"); +assert.equal(getCountryName("MD"), "Moldova"); +assert.equal(RX.MD.name, "Moldova"); +assert.match(getDisplayFormat("MD"), /MAI 9999/); +const mask = getInputMask("MD"); +assert.ok(mask && Array.isArray(mask.mask)); +assert.equal(mask.mask.length, 7); +assert.ok(mask.mask.includes("CD 999 LL")); + +const positive = [ + ["standard", "ABC 123"], ["standard compact", "ABC123"], + ["legacy", "AB CD 123"], ["legacy compact", "ABCD123"], ["legacy partially spaced", "ABCD 123"], + ["Chișinău C", "C AB 123"], ["Chișinău K", "K AB 123"], + ["diplomatic", "CD 123 AB"], ["diplomatic compact", "CD123AB"], + ["MAI", "MAI 1234"], ["MAI lowercase", "mai1234"], + ["Transnistria", "T 123 AB"], ["Transnistria compact", "T123AB"], +]; +for (const [label, plate] of positive) { + const result = validatePlate(plate, ["MD"], { vehicleType: "car" }); + assert.equal(result.isValid, true, `${label}: ${plate}`); + assert.deepEqual(result.matches, [{ country: "MD", name: "Moldova" }]); + assert.ok(validatePlate(plate).matches.some((match) => match.country === "MD")); + assert.equal(validatePlate(plate, ["MD"], { vehicleType: "motorcycle" }).isValid, false); +} +const negative = ["", "AB 12", "ABC-123", "AB_CD_123", "AB CDE 123", "ABCDE123", "CD 12 AB", "CD 123 ABC", "MAI 12", "MAI 12345", "T 12 AB", "T 123 ABC", "C AB 12", "AAA 12A", "123 ABC"]; +for (const plate of negative) { + assert.equal(validatePlate(plate, ["MD"]).isValid, false, `Invalid MD plate: ${plate}`); +} +assert.deepEqual(validatePlate("ABC 123", ["ZZ"]).checked, []); +assert.deepEqual(validatePlate("ABC 123", ["ZZ"]).errors, ["no_countries_selected"]); +console.log(`Moldova regression: ${positive.length} valid + ${negative.length} invalid cases passed`); diff --git a/scripts/test-random.mjs b/scripts/test-random.mjs old mode 100755 new mode 100644 index bc83f30..f1239e6 --- a/scripts/test-random.mjs +++ b/scripts/test-random.mjs @@ -169,6 +169,19 @@ function sampleUA() { return `${R.A(2)} ${R.N(4)} ${R.A(2)}`; } +function sampleMD() { + const variants = [ + () => `${R.A(3)} ${R.N(3)}`, + () => `${R.A(2)} ${R.A(2)} ${R.N(3)}`, + () => `C ${R.A(2)} ${R.N(3)}`, + () => `K ${R.A(2)} ${R.N(3)}`, + () => `CD ${R.N(3)} ${R.A(2)}`, + () => `MAI ${R.N(4)}`, + () => `T ${R.N(3)} ${R.A(2)}`, + ]; + return variants[Math.floor(Math.random() * variants.length)](); +} + // Generatori per paese const GEN = { IT: sampleIT, @@ -200,6 +213,7 @@ const GEN = { LV: sampleLV, EE: sampleEE, UA: sampleUA, + MD: sampleMD, }; // Negative fisse diff --git a/scripts/test-samples.mjs b/scripts/test-samples.mjs old mode 100755 new mode 100644 index 0e03b8a..fd738ef --- a/scripts/test-samples.mjs +++ b/scripts/test-samples.mjs @@ -47,6 +47,7 @@ const POS = { LV: ["AB-1234", "ZZ-0001", "AA-9999"], EE: ["123 ABC", "001 ABC", "999 ZZZ"], UA: ["AA 1234 BB", "BC1234DE", "AK 0001 AA"], + MD: ["ABC 123", "AB CD 123", "C AB 123", "K AB 123", "CD 123 AB", "MAI 1234", "T 123 AB"], }; // Alcune negative per rumore @@ -60,6 +61,8 @@ const NEG = [ { plate: "B 1234-MA", countries: ["DE"] }, // FR separatori sbagliati { plate: "AB_123_CD", countries: ["FR"] }, + { plate: "ABC-123", countries: ["MD"] }, + { plate: "MAI 12", countries: ["MD"] }, ]; let pass = 0, diff --git a/src/client/europlate.client.ts b/src/client/europlate.client.ts index 82d756d..b9667a2 100644 --- a/src/client/europlate.client.ts +++ b/src/client/europlate.client.ts @@ -750,7 +750,7 @@ const DICT: Record< countries: { IT: "Italia", UK: "Regno Unito", DE: "Germania", FR: "Francia", ES: "Spagna", PT: "Portogallo", NL: "Paesi Bassi", BE: "Belgio", CH: "Svizzera", AT: "Austria", IE: "Irlanda", LU: "Lussemburgo", DK: "Danimarca", SE: "Svezia", NO: "Norvegia", FI: "Finlandia", PL: "Polonia", CZ: "Cechia", SK: "Slovacchia", HU: "Ungheria", RO: "Romania", BG: "Bulgaria", - SI: "Slovenia", HR: "Croazia", GR: "Grecia", LT: "Lituania", LV: "Lettonia", EE: "Estonia", UA: "Ucraina" + SI: "Slovenia", HR: "Croazia", GR: "Grecia", LT: "Lituania", LV: "Lettonia", EE: "Estonia", UA: "Ucraina", MD: "Moldavia" }, }, en: { @@ -762,7 +762,7 @@ const DICT: Record< countries:{ IT: "Italy", UK: "United Kingdom", DE: "Germany", FR: "France", ES: "Spain", PT: "Portugal", NL: "Netherlands", BE: "Belgium", CH: "Switzerland", AT: "Austria", IE: "Ireland", LU: "Luxembourg", DK: "Denmark", SE: "Sweden", NO: "Norway", FI: "Finland", PL: "Poland", CZ: "Czechia", SK: "Slovakia", HU: "Hungary", RO: "Romania", BG: "Bulgaria", SI: "Slovenia", - HR: "Croatia", GR: "Greece", LT: "Lithuania", LV: "Latvia", EE: "Estonia", UA: "Ukraine" + HR: "Croatia", GR: "Greece", LT: "Lithuania", LV: "Latvia", EE: "Estonia", UA: "Ukraine", MD: "Moldova" }, }, }; @@ -1213,7 +1213,14 @@ export function createEuroPlate(EuroMod: any, opts: EuroPlateOptions): EuroPlate // .replace(/A\{(\d+)\}/g, (_, n) => "A".repeat(+n)) // .replace(/9\{(\d+)\}/g, (_, n) => "9".repeat(+n)); - const normalizePattern = (p: string) => String(p).replace(/([ALH9X])\{(\d)\}/g, (_, t, n) => String(t).repeat(n)); + function normalizePattern(p: string): string; + function normalizePattern(p: string[]): string[]; + function normalizePattern(p: string | string[]): string | string[]; + function normalizePattern(p: string | string[]): string | string[] { + return Array.isArray(p) + ? p.map((part) => normalizePattern(part)) + : p.replace(/([ALH9X])\{(\d+)\}/g, (_, t, n) => t.repeat(Number(n))); + } // ===== Logging centralizzato (usa BADGE/LOG se presenti) ===== function imLog(level: "debug" | "info" | "warn" | "error", title: string, payload?: any) { diff --git a/src/countries.ts b/src/countries.ts index 9490b88..96d3153 100644 --- a/src/countries.ts +++ b/src/countries.ts @@ -3,7 +3,7 @@ import { finalizeInputMaskLayouts } from "./utils/placeholders.js"; // prettier-ignore /** Tutti i country code supportati (Russia esclusa) */ -export type CountryKey = "IT" | "UK" | "DE" | "FR" | "ES" | "PT" | "NL" | "BE" | "CH" | "AT" | "IE" | "LU" | "DK" | "SE" | "NO" | "FI" | "PL" | "CZ" | "SK" | "HU" | "RO" | "BG" | "SI" | "HR" | "GR" | "LT" | "LV" | "EE" | "UA"; +export type CountryKey = "IT" | "UK" | "DE" | "FR" | "ES" | "PT" | "NL" | "BE" | "CH" | "AT" | "IE" | "LU" | "DK" | "SE" | "NO" | "FI" | "PL" | "CZ" | "SK" | "HU" | "RO" | "BG" | "SI" | "HR" | "GR" | "LT" | "LV" | "EE" | "UA" | "MD"; /** Tipo veicolo */ export type VehicleType = "car" | "motorcycle" | "any"; @@ -11,14 +11,14 @@ export type VehicleType = "car" | "motorcycle" | "any"; // prettier-ignore /** Lista di paesi supportati (const + tipizzato) */ export const supportedCountries = [ - "IT", "UK", "DE", "FR", "ES", "PT", "NL", "BE", "CH", "AT", "IE", "LU", "DK", "SE", "NO", "FI", "PL", "CZ", "SK", "HU", "RO", "BG", "SI", "HR", "GR", "LT", "LV", "EE", "UA", + "IT", "UK", "DE", "FR", "ES", "PT", "NL", "BE", "CH", "AT", "IE", "LU", "DK", "SE", "NO", "FI", "PL", "CZ", "SK", "HU", "RO", "BG", "SI", "HR", "GR", "LT", "LV", "EE", "UA", "MD", ] as const satisfies ReadonlyArray