soff-phone 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -14
- package/dist/ar-BRemFHRv.d.ts +10 -0
- package/dist/ar-JxzqPct0.d.cts +10 -0
- package/dist/br-COFIo49r.d.cts +10 -0
- package/dist/br-Ct41H5gk.d.ts +10 -0
- package/dist/ca-C0PYBvZK.d.cts +10 -0
- package/dist/ca-CNnuf6qY.d.ts +10 -0
- package/dist/cl-BSQlXUww.d.cts +10 -0
- package/dist/cl-W_f2Hza8.d.ts +10 -0
- package/dist/cr-C3m9H-RU.d.cts +10 -0
- package/dist/cr-UzSwttKD.d.ts +10 -0
- package/dist/de-ZAyw44MG.d.cts +10 -0
- package/dist/de-bIFBVR-K.d.ts +10 -0
- package/dist/ec-CCV5mLhv.d.ts +10 -0
- package/dist/ec-D7HUkRKn.d.cts +10 -0
- package/dist/es-C7dIuFpf.d.cts +10 -0
- package/dist/es-DVVnhfSE.d.ts +10 -0
- package/dist/fr-BSghMzs5.d.cts +10 -0
- package/dist/fr-C8OxubJ3.d.ts +10 -0
- package/dist/gb-B5NBNoma.d.cts +10 -0
- package/dist/gb-DDivDdMy.d.ts +10 -0
- package/dist/gt-DiiNa6Vm.d.ts +10 -0
- package/dist/gt-uZfIOMWw.d.cts +10 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/it-BtfZnlF6.d.cts +10 -0
- package/dist/it-DollYcFl.d.ts +10 -0
- package/dist/locales/ar.cjs +2 -0
- package/dist/locales/ar.cjs.map +1 -0
- package/dist/locales/ar.d.cts +2 -0
- package/dist/locales/ar.d.ts +2 -0
- package/dist/locales/ar.js +2 -0
- package/dist/locales/ar.js.map +1 -0
- package/dist/locales/br.cjs +2 -0
- package/dist/locales/br.cjs.map +1 -0
- package/dist/locales/br.d.cts +2 -0
- package/dist/locales/br.d.ts +2 -0
- package/dist/locales/br.js +2 -0
- package/dist/locales/br.js.map +1 -0
- package/dist/locales/ca.cjs +2 -0
- package/dist/locales/ca.cjs.map +1 -0
- package/dist/locales/ca.d.cts +2 -0
- package/dist/locales/ca.d.ts +2 -0
- package/dist/locales/ca.js +2 -0
- package/dist/locales/ca.js.map +1 -0
- package/dist/locales/cl.cjs +2 -0
- package/dist/locales/cl.cjs.map +1 -0
- package/dist/locales/cl.d.cts +2 -0
- package/dist/locales/cl.d.ts +2 -0
- package/dist/locales/cl.js +2 -0
- package/dist/locales/cl.js.map +1 -0
- package/dist/locales/cr.cjs +2 -0
- package/dist/locales/cr.cjs.map +1 -0
- package/dist/locales/cr.d.cts +2 -0
- package/dist/locales/cr.d.ts +2 -0
- package/dist/locales/cr.js +2 -0
- package/dist/locales/cr.js.map +1 -0
- package/dist/locales/de.cjs +2 -0
- package/dist/locales/de.cjs.map +1 -0
- package/dist/locales/de.d.cts +2 -0
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/de.js +2 -0
- package/dist/locales/de.js.map +1 -0
- package/dist/locales/ec.cjs +2 -0
- package/dist/locales/ec.cjs.map +1 -0
- package/dist/locales/ec.d.cts +2 -0
- package/dist/locales/ec.d.ts +2 -0
- package/dist/locales/ec.js +2 -0
- package/dist/locales/ec.js.map +1 -0
- package/dist/locales/es.cjs +2 -0
- package/dist/locales/es.cjs.map +1 -0
- package/dist/locales/es.d.cts +2 -0
- package/dist/locales/es.d.ts +2 -0
- package/dist/locales/es.js +2 -0
- package/dist/locales/es.js.map +1 -0
- package/dist/locales/fr.cjs +2 -0
- package/dist/locales/fr.cjs.map +1 -0
- package/dist/locales/fr.d.cts +2 -0
- package/dist/locales/fr.d.ts +2 -0
- package/dist/locales/fr.js +2 -0
- package/dist/locales/fr.js.map +1 -0
- package/dist/locales/gb.cjs +2 -0
- package/dist/locales/gb.cjs.map +1 -0
- package/dist/locales/gb.d.cts +2 -0
- package/dist/locales/gb.d.ts +2 -0
- package/dist/locales/gb.js +2 -0
- package/dist/locales/gb.js.map +1 -0
- package/dist/locales/gt.cjs +2 -0
- package/dist/locales/gt.cjs.map +1 -0
- package/dist/locales/gt.d.cts +2 -0
- package/dist/locales/gt.d.ts +2 -0
- package/dist/locales/gt.js +2 -0
- package/dist/locales/gt.js.map +1 -0
- package/dist/locales/it.cjs +2 -0
- package/dist/locales/it.cjs.map +1 -0
- package/dist/locales/it.d.cts +2 -0
- package/dist/locales/it.d.ts +2 -0
- package/dist/locales/it.js +2 -0
- package/dist/locales/it.js.map +1 -0
- package/dist/locales/pa.cjs +2 -0
- package/dist/locales/pa.cjs.map +1 -0
- package/dist/locales/pa.d.cts +2 -0
- package/dist/locales/pa.d.ts +2 -0
- package/dist/locales/pa.js +2 -0
- package/dist/locales/pa.js.map +1 -0
- package/dist/locales/pe.cjs +2 -0
- package/dist/locales/pe.cjs.map +1 -0
- package/dist/locales/pe.d.cts +2 -0
- package/dist/locales/pe.d.ts +2 -0
- package/dist/locales/pe.js +2 -0
- package/dist/locales/pe.js.map +1 -0
- package/dist/locales/us.cjs +2 -0
- package/dist/locales/us.cjs.map +1 -0
- package/dist/locales/us.d.cts +2 -0
- package/dist/locales/us.d.ts +2 -0
- package/dist/locales/us.js +2 -0
- package/dist/locales/us.js.map +1 -0
- package/dist/locales/ve.cjs +2 -0
- package/dist/locales/ve.cjs.map +1 -0
- package/dist/locales/ve.d.cts +2 -0
- package/dist/locales/ve.d.ts +2 -0
- package/dist/locales/ve.js +2 -0
- package/dist/locales/ve.js.map +1 -0
- package/dist/pa-CEAa_MLu.d.cts +10 -0
- package/dist/pa-CeerPsSh.d.ts +10 -0
- package/dist/pe-CHVFUsc1.d.cts +10 -0
- package/dist/pe-ZpTRwvEa.d.ts +10 -0
- package/dist/us-BV-jF4X9.d.cts +10 -0
- package/dist/us-DcxF3Jrz.d.ts +10 -0
- package/dist/ve-Czf_bYd9.d.ts +10 -0
- package/dist/ve-DMPrCtKR.d.cts +10 -0
- package/package.json +191 -8
package/README.md
CHANGED
|
@@ -1,14 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/bledxs/soff-monorepo/master/assets/logo.png" alt="Soff Logo" width="100" height="100">
|
|
3
|
+
<h1>Soff Phone</h1>
|
|
4
|
+
<p>Lightweight, tree-shakeable phone number validation and formatting library for global markets.</p>
|
|
5
|
+
</div>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<div align="center">
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
---
|
|
4
12
|
|
|
5
13
|
## Features
|
|
6
14
|
|
|
7
15
|
- 🌲 **Tree-shakeable**: Import only the locales you need
|
|
8
16
|
- 📦 **Zero dependencies**: Lightweight and fast
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
17
|
+
- 🌍 **Global coverage**: Support for 17 countries across Latin America, North America, and Europe
|
|
18
|
+
- ⚡ **TypeScript**: Fully typed
|
|
19
|
+
- 📱 **Mobile & Landline**: Distinguish between mobile and landline numbers where applicable
|
|
20
|
+
|
|
21
|
+
## Supported Countries
|
|
22
|
+
|
|
23
|
+
### Latin America 🌎
|
|
24
|
+
|
|
25
|
+
- 🇦🇷 **Argentina** (ar) - 10 digits
|
|
26
|
+
- 🇧🇷 **Brazil** (br) - 10-11 digits
|
|
27
|
+
- 🇨🇱 **Chile** (cl) - 9 digits
|
|
28
|
+
- 🇨🇴 **Colombia** (co) - 10 digits
|
|
29
|
+
- 🇨🇷 **Costa Rica** (cr) - 8 digits
|
|
30
|
+
- 🇪🇨 **Ecuador** (ec) - 9 digits
|
|
31
|
+
- 🇬🇹 **Guatemala** (gt) - 8 digits
|
|
32
|
+
- 🇲🇽 **Mexico** (mx) - 10 digits
|
|
33
|
+
- 🇵🇦 **Panama** (pa) - 8 digits
|
|
34
|
+
- 🇵🇪 **Peru** (pe) - 9 digits
|
|
35
|
+
- 🇻🇪 **Venezuela** (ve) - 10 digits
|
|
36
|
+
|
|
37
|
+
### North America 🌐
|
|
38
|
+
|
|
39
|
+
- 🇨🇦 **Canada** (ca) - 10 digits
|
|
40
|
+
- 🇺🇸 **United States** (us) - 10 digits
|
|
41
|
+
|
|
42
|
+
### Europe 🇪🇺
|
|
43
|
+
|
|
44
|
+
- 🇩🇪 **Germany** (de) - 9-11 digits
|
|
45
|
+
- 🇪🇸 **Spain** (es) - 9 digits
|
|
46
|
+
- 🇫🇷 **France** (fr) - 9 digits
|
|
47
|
+
- 🇬🇧 **United Kingdom** (gb) - 10 digits
|
|
48
|
+
- 🇮🇹 **Italy** (it) - 9-10 digits
|
|
12
49
|
|
|
13
50
|
## Installation
|
|
14
51
|
|
|
@@ -42,23 +79,74 @@ const e164 = validate('3001234567', { format: 'e164' });
|
|
|
42
79
|
console.log(e164.formatted); // +573001234567
|
|
43
80
|
```
|
|
44
81
|
|
|
45
|
-
###
|
|
82
|
+
### Brazil 🇧🇷
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { validate } from 'soff-phone/br';
|
|
86
|
+
|
|
87
|
+
// Mobile (11 digits with 9 prefix)
|
|
88
|
+
const mobile = validate('11987654321');
|
|
89
|
+
console.log(mobile);
|
|
90
|
+
// { isValid: true, type: 'mobile', formatted: '11987654321' }
|
|
91
|
+
|
|
92
|
+
// Landline (10 digits)
|
|
93
|
+
const landline = validate('1134567890');
|
|
94
|
+
console.log(landline);
|
|
95
|
+
// { isValid: true, type: 'landline', formatted: '1134567890' }
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### United States 🇺🇸
|
|
46
99
|
|
|
47
100
|
```typescript
|
|
48
|
-
import { validate } from 'soff-phone/
|
|
101
|
+
import { validate } from 'soff-phone/us';
|
|
49
102
|
|
|
50
|
-
const result = validate('
|
|
103
|
+
const result = validate('2025551234');
|
|
51
104
|
console.log(result);
|
|
52
|
-
// { isValid: true, type: 'unknown', formatted: '
|
|
105
|
+
// { isValid: true, type: 'unknown', formatted: '2025551234' }
|
|
106
|
+
|
|
107
|
+
// With country code
|
|
108
|
+
const withCode = validate('12025551234');
|
|
109
|
+
console.log(withCode.formatted); // 2025551234
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Spain 🇪🇸
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
import { validate } from 'soff-phone/es';
|
|
116
|
+
|
|
117
|
+
// Mobile
|
|
118
|
+
const mobile = validate('612345678');
|
|
119
|
+
console.log(mobile);
|
|
120
|
+
// { isValid: true, type: 'mobile', formatted: '612345678' }
|
|
121
|
+
|
|
122
|
+
// Landline
|
|
123
|
+
const landline = validate('912345678');
|
|
124
|
+
console.log(landline);
|
|
125
|
+
// { isValid: true, type: 'landline', formatted: '912345678' }
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Other Countries
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
// Argentina
|
|
132
|
+
import { validate as validateAR } from 'soff-phone/ar';
|
|
133
|
+
|
|
134
|
+
// Chile
|
|
135
|
+
import { validate as validateCL } from 'soff-phone/cl';
|
|
136
|
+
|
|
137
|
+
// And so on for: ca, cr, de, ec, fr, gb, gt, it, mx, pa, pe, ve
|
|
53
138
|
```
|
|
54
139
|
|
|
55
140
|
## Bundle Size
|
|
56
141
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
142
|
+
Each locale is individually tree-shakeable, so you only pay for what you use.
|
|
143
|
+
|
|
144
|
+
| Module | Size (minified) | Size (gzipped) |
|
|
145
|
+
| ---------- | --------------- | -------------- |
|
|
146
|
+
| Core | ~0.5KB | ~0.3KB |
|
|
147
|
+
| Per Locale | ~0.5-0.7KB | ~0.3-0.4KB |
|
|
148
|
+
|
|
149
|
+
**Example**: If you only import Colombia validation, your bundle will be ~1KB minified (~0.6KB gzipped).
|
|
62
150
|
|
|
63
151
|
## License
|
|
64
152
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const ar_validate: typeof validate;
|
|
6
|
+
declare namespace ar {
|
|
7
|
+
export { ar_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ar as a, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const ar_validate: typeof validate;
|
|
6
|
+
declare namespace ar {
|
|
7
|
+
export { ar_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ar as a, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const br_validate: typeof validate;
|
|
6
|
+
declare namespace br {
|
|
7
|
+
export { br_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { br as b, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const br_validate: typeof validate;
|
|
6
|
+
declare namespace br {
|
|
7
|
+
export { br_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { br as b, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const ca_validate: typeof validate;
|
|
6
|
+
declare namespace ca {
|
|
7
|
+
export { ca_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ca as c, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const ca_validate: typeof validate;
|
|
6
|
+
declare namespace ca {
|
|
7
|
+
export { ca_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ca as c, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const cl_validate: typeof validate;
|
|
6
|
+
declare namespace cl {
|
|
7
|
+
export { cl_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { cl as c, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const cl_validate: typeof validate;
|
|
6
|
+
declare namespace cl {
|
|
7
|
+
export { cl_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { cl as c, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const cr_validate: typeof validate;
|
|
6
|
+
declare namespace cr {
|
|
7
|
+
export { cr_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { cr as c, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const cr_validate: typeof validate;
|
|
6
|
+
declare namespace cr {
|
|
7
|
+
export { cr_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { cr as c, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const de_validate: typeof validate;
|
|
6
|
+
declare namespace de {
|
|
7
|
+
export { de_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { de as d, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const de_validate: typeof validate;
|
|
6
|
+
declare namespace de {
|
|
7
|
+
export { de_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { de as d, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const ec_validate: typeof validate;
|
|
6
|
+
declare namespace ec {
|
|
7
|
+
export { ec_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ec as e, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const ec_validate: typeof validate;
|
|
6
|
+
declare namespace ec {
|
|
7
|
+
export { ec_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ec as e, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const es_validate: typeof validate;
|
|
6
|
+
declare namespace es {
|
|
7
|
+
export { es_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { es as e, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const es_validate: typeof validate;
|
|
6
|
+
declare namespace es {
|
|
7
|
+
export { es_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { es as e, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const fr_validate: typeof validate;
|
|
6
|
+
declare namespace fr {
|
|
7
|
+
export { fr_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { fr as f, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const fr_validate: typeof validate;
|
|
6
|
+
declare namespace fr {
|
|
7
|
+
export { fr_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { fr as f, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const gb_validate: typeof validate;
|
|
6
|
+
declare namespace gb {
|
|
7
|
+
export { gb_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { gb as g, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const gb_validate: typeof validate;
|
|
6
|
+
declare namespace gb {
|
|
7
|
+
export { gb_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { gb as g, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const gt_validate: typeof validate;
|
|
6
|
+
declare namespace gt {
|
|
7
|
+
export { gt_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { gt as g, validate as v };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
|
|
3
|
+
declare function validate(phone: string, options?: PhoneOptions): PhoneValidationResult;
|
|
4
|
+
|
|
5
|
+
declare const gt_validate: typeof validate;
|
|
6
|
+
declare namespace gt {
|
|
7
|
+
export { gt_validate as validate };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { gt as g, validate as v };
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var H=Object.defineProperty;var s=(r,o)=>{for(var t in o)H(r,t,{get:o[t],enumerable:true});};function l(r){return r.replace(/\D/g,"")}function a(r,o){return `+${r}${o}`}var w={};s(w,{validate:()=>J});var m="54";function J(r,o){let t=l(r),e=t;if(t.startsWith(m)&&t.length>10&&(e=t.slice(m.length)),e.length!==10)return {isValid:false,error:"Phone number must be 10 digits"};let n="unknown";e.startsWith("9")?n="mobile":/^(11|2|3|4)/.test(e)&&(n="landline");let i=e;return o?.format==="e164"?i=a(m,e):o?.format==="international"&&(i=`+${m} ${e}`),{isValid:true,type:n,formatted:i}}var W={};s(W,{validate:()=>K});var h="55";function K(r,o){let t=l(r),e=t;if(t.startsWith(h)&&t.length>10&&(e=t.slice(h.length)),e.length!==10&&e.length!==11)return {isValid:false,error:"Phone number must be 10 or 11 digits"};let n="unknown";if(e.length===11&&e[2]==="9")n="mobile";else if(e.length===10)n="landline";else return {isValid:false,error:"Invalid phone format for Brazil"};let i=e;return o?.format==="e164"?i=a(h,e):o?.format==="international"&&(i=`+${h} ${e}`),{isValid:true,type:n,formatted:i}}var v={};s(v,{validate:()=>L});var d="56";function L(r,o){let t=l(r),e=t;if(t.startsWith(d)&&t.length>9&&(e=t.slice(d.length)),e.length!==9)return {isValid:false,error:"Phone number must be 9 digits"};let n="unknown";if(e.startsWith("9"))n="mobile";else if(/^[2-7]/.test(e))n="landline";else return {isValid:false,error:"Invalid prefix for Chile"};let i=e;return o?.format==="e164"?i=a(d,e):o?.format==="international"&&(i=`+${d} ${e}`),{isValid:true,type:n,formatted:i}}var j={};s(j,{validate:()=>M});var u="57";function M(r,o){let t=l(r),e=t;if(t.startsWith(u)&&t.length>10&&(e=t.slice(u.length)),e.length!==10)return {isValid:false,error:"Phone number must be 10 digits"};let n="unknown";if(e.startsWith("3"))n="mobile";else if(e.startsWith("60"))n="landline";else return {isValid:false,error:"Invalid prefix for Colombia"};let i=e;return o?.format==="e164"?i=a(u,e):o?.format==="international"&&(i=`+${u} ${e}`),{isValid:true,type:n,formatted:i}}var D={};s(D,{validate:()=>Q});var p="506";function Q(r,o){let t=l(r),e=t;if(t.startsWith(p)&&t.length>8&&(e=t.slice(p.length)),e.length!==8)return {isValid:false,error:"Phone number must be 8 digits"};let n="unknown";/^[5678]/.test(e)?n="mobile":e.startsWith("2")&&(n="landline");let i=e;return o?.format==="e164"?i=a(p,e):o?.format==="international"&&(i=`+${p} ${e}`),{isValid:true,type:n,formatted:i}}var N={};s(N,{validate:()=>X});var c="593";function X(r,o){let t=l(r),e=t;if(t.startsWith(c)&&t.length>9&&(e=t.slice(c.length)),e.length!==9)return {isValid:false,error:"Phone number must be 9 digits"};let n="unknown";if(e.startsWith("9"))n="mobile";else if(/^[2-7]/.test(e))n="landline";else return {isValid:false,error:"Invalid prefix for Ecuador"};let i=e;return o?.format==="e164"?i=a(c,e):o?.format==="international"&&(i=`+${c} ${e}`),{isValid:true,type:n,formatted:i}}var T={};s(T,{validate:()=>Z});var P="502";function Z(r,o){let t=l(r),e=t;if(t.startsWith(P)&&t.length>8&&(e=t.slice(P.length)),e.length!==8)return {isValid:false,error:"Phone number must be 8 digits"};let n="unknown";/^[345]/.test(e)?n="mobile":/^[267]/.test(e)&&(n="landline");let i=e;return o?.format==="e164"?i=a(P,e):o?.format==="international"&&(i=`+${P} ${e}`),{isValid:true,type:n,formatted:i}}var U={};s(U,{validate:()=>ee});var g="52";function ee(r,o){let t=l(r),e=t;if(t.startsWith(g)&&t.length>10&&(e=t.slice(g.length)),e.length!==10)return {isValid:false,error:"Phone number must be 10 digits"};let n=e;return o?.format==="e164"?n=a(g,e):o?.format==="international"&&(n=`+${g} ${e}`),{isValid:true,type:"unknown",formatted:n}}var Y={};s(Y,{validate:()=>te});var V="507";function te(r,o){let t=l(r),e=t;if(t.startsWith(V)&&t.length>8&&(e=t.slice(V.length)),e.length!==8)return {isValid:false,error:"Phone number must be 8 digits"};let n="unknown";e.startsWith("6")?n="mobile":/^[2-57-9]/.test(e)&&(n="landline");let i=e;return o?.format==="e164"?i=a(V,e):o?.format==="international"&&(i=`+${V} ${e}`),{isValid:true,type:n,formatted:i}}var _={};s(_,{validate:()=>ne});var b="51";function ne(r,o){let t=l(r),e=t;if(t.startsWith(b)&&t.length>9&&(e=t.slice(b.length)),e.length!==9)return {isValid:false,error:"Phone number must be 9 digits"};let n="unknown";if(e.startsWith("9"))n="mobile";else if(/^[01]/.test(e))n="landline";else return {isValid:false,error:"Invalid prefix for Peru"};let i=e;return o?.format==="e164"?i=a(b,e):o?.format==="international"&&(i=`+${b} ${e}`),{isValid:true,type:n,formatted:i}}var I={};s(I,{validate:()=>ie});var O="58";function ie(r,o){let t=l(r),e=t;if(t.startsWith(O)&&t.length>10&&(e=t.slice(O.length)),e.length!==10)return {isValid:false,error:"Phone number must be 10 digits"};let n="unknown";e.startsWith("4")?n="mobile":/^[2]/.test(e)&&(n="landline");let i=e;return o?.format==="e164"?i=a(O,e):o?.format==="international"&&(i=`+${O} ${e}`),{isValid:true,type:n,formatted:i}}var z={};s(z,{validate:()=>oe});var y="1";function oe(r,o){let t=l(r),e=t;if(t.startsWith(y)&&t.length===11&&(e=t.slice(y.length)),e.length!==10)return {isValid:false,error:"Phone number must be 10 digits"};let n=e.substring(0,3);if(!/^[2-9][0-8][0-9]$/.test(n))return {isValid:false,error:"Invalid area code"};let i=e.substring(3,6);if(!/^[2-9]\d{2}$/.test(i))return {isValid:false,error:"Invalid exchange code"};let f=e;return o?.format==="e164"?f=a(y,e):o?.format==="international"&&(f=`+${y} ${e}`),{isValid:true,type:"unknown",formatted:f}}var B={};s(B,{validate:()=>re});var R="1";function re(r,o){let t=l(r),e=t;if(t.startsWith(R)&&t.length===11&&(e=t.slice(R.length)),e.length!==10)return {isValid:false,error:"Phone number must be 10 digits"};let n=e.substring(0,3);if(!/^[2-9][0-8][0-9]$/.test(n))return {isValid:false,error:"Invalid area code"};let i=e.substring(3,6);if(!/^[2-9]\d{2}$/.test(i))return {isValid:false,error:"Invalid exchange code"};let f=e;return o?.format==="e164"?f=a(R,e):o?.format==="international"&&(f=`+${R} ${e}`),{isValid:true,type:"unknown",formatted:f}}var S={};s(S,{validate:()=>le});var x="49";function le(r,o){let t=l(r),e=t;if(t.startsWith(x)&&(e=t.slice(x.length)),e.startsWith("0")&&(e=e.slice(1)),e.length<9||e.length>11)return {isValid:false,error:"Phone number must be 9-11 digits"};let n="unknown";/^1[567]/.test(e)?n="mobile":n="landline";let i=e;return o?.format==="e164"?i=a(x,e):o?.format==="international"&&(i=`+${x} ${e}`),{isValid:true,type:n,formatted:i}}var q={};s(q,{validate:()=>ae});var C="34";function ae(r,o){let t=l(r),e=t;if(t.startsWith(C)&&t.length>9&&(e=t.slice(C.length)),e.length!==9)return {isValid:false,error:"Phone number must be 9 digits"};let n="unknown";if(/^[67]/.test(e))n="mobile";else if(/^[89]/.test(e))n="landline";else return {isValid:false,error:"Invalid prefix for Spain"};let i=e;return o?.format==="e164"?i=a(C,e):o?.format==="international"&&(i=`+${C} ${e}`),{isValid:true,type:n,formatted:i}}var A={};s(A,{validate:()=>se});var $="33";function se(r,o){let t=l(r),e=t;if(t.startsWith($)&&t.length>9&&(e=t.slice($.length)),e.startsWith("0")&&(e=e.slice(1)),e.length!==9)return {isValid:false,error:"Phone number must be 9 digits"};let n="unknown";/^[67]/.test(e)?n="mobile":/^[1-5,9]/.test(e)&&(n="landline");let i=e;return o?.format==="e164"?i=a($,e):o?.format==="international"&&(i=`+${$} ${e}`),{isValid:true,type:n,formatted:i}}var F={};s(F,{validate:()=>fe});var E="44";function fe(r,o){let t=l(r),e=t;if(t.startsWith(E)&&t.length>10&&(e=t.slice(E.length)),e.startsWith("0")&&(e=e.slice(1)),e.length!==10)return {isValid:false,error:"Phone number must be 10 digits"};let n="unknown";e.startsWith("7")?n="mobile":/^[123]/.test(e)&&(n="landline");let i=e;return o?.format==="e164"?i=a(E,e):o?.format==="international"&&(i=`+${E} ${e}`),{isValid:true,type:n,formatted:i}}var G={};s(G,{validate:()=>me});var k="39";function me(r,o){let t=l(r),e=t;if(t.startsWith(k)&&t.length>9&&(e=t.slice(k.length)),e.startsWith("0")&&(e=e.slice(1)),e.length<9||e.length>10)return {isValid:false,error:"Phone number must be 9-10 digits"};let n="unknown";e.startsWith("3")?n="mobile":n="landline";let i=e;return o?.format==="e164"?i=a(k,e):o?.format==="international"&&(i=`+${k} ${e}`),{isValid:true,type:n,formatted:i}}exports.ar=w;exports.br=W;exports.ca=z;exports.cl=v;exports.cleanPhone=l;exports.co=j;exports.cr=D;exports.de=S;exports.ec=N;exports.es=q;exports.formatE164=a;exports.fr=A;exports.gb=F;exports.gt=T;exports.it=G;exports.mx=U;exports.pa=Y;exports.pe=_;exports.us=B;exports.ve=I;//# sourceMappingURL=index.cjs.map
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/utils.ts","../src/locales/co.ts","../src/locales/mx.ts"],"names":["cleanPhone","phone","formatE164","countryCode","co_exports","__export","validate","COUNTRY_CODE","options","cleaned","national","type","formatted","mx_exports"],"mappings":"0GAAO,SAASA,CAAAA,CAAWC,EAAuB,CAChD,OAAOA,EAAM,OAAA,CAAQ,K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AP,CAAAA,CAAAA,CAAAA,CAGA,IAAMC,CAAAA,CAAe,IAAA,CAEd,SAASD,CAAAA,CAASL,CAAAA,CAAeO,EAA+C,CACrF,IAAMC,EAAUT,CAAAA,CAAWC,CAAK,EAG5BS,CAAAA,CAAWD,CAAAA,CAKf,GAJIA,CAAAA,CAAQ,UAAA,CAAWF,CAAY,GAAKE,CAAAA,CAAQ,MAAA,CAAS,KACvDC,CAAAA,CAAWD,CAAAA,CAAQ,MAAMF,CAAAA,CAAa,MAAM,GAG1CG,CAAAA,CAAS,MAAA,GAAW,GACtB,OAAO,CAAE,QAAS,KAAA,CAAO,KAAA,CAAO,gCAAiC,CAAA,CASnE,IAAIE,CAAAA,CAAYF,CAAAA,CAChB,OAAIF,CAAAA,EAAS,SAAW,MAAA,CACtBI,CAAAA,CAAYV,EAAWK,CAAAA,CAAcG,CAAQ,EACpCF,CAAAA,EAAS,MAAA,GAAW,kBAC7BI,CAAAA,CAAY,CAAA,CAAA,EAAIL,CAAY,CAAA,CAAA,EAAIG,CAAQ,IAGnC,CAAE,OAAA,CAAS,KAAM,IAAA,CAAM,SAAA,CAAW,SAAA,CAAAE,CAAU,CACrD","file":"index.cjs","sourcesContent":["export function cleanPhone(phone: string): string {\n return phone.replace(/\\D/g, '');\n}\n\nexport function formatE164(countryCode: string, phone: string): string {\n return `+${countryCode}${phone}`;\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '57';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 10) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n if (national.length !== 10) {\n return { isValid: false, error: 'Phone number must be 10 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 3\n if (national.startsWith('3')) {\n type = 'mobile';\n }\n // Landline: Starts with 60\n else if (national.startsWith('60')) {\n type = 'landline';\n } else {\n return { isValid: false, error: 'Invalid prefix for Colombia' };\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '52';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 10) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n if (national.length !== 10) {\n return { isValid: false, error: 'Phone number must be 10 digits' };\n }\n\n // Mexico doesn't strictly separate mobile/landline ranges as clearly in the first digit anymore for all cases,\n // but generally we can just validate length.\n // Distinction is harder without a massive database of area codes.\n // We will mark as 'unknown' type unless we want to implement complex area code logic.\n // For now, let's assume valid if 10 digits.\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type: 'unknown', formatted };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/core/utils.ts","../src/locales/ar.ts","../src/locales/br.ts","../src/locales/cl.ts","../src/locales/co.ts","../src/locales/cr.ts","../src/locales/ec.ts","../src/locales/gt.ts","../src/locales/mx.ts","../src/locales/pa.ts","../src/locales/pe.ts","../src/locales/ve.ts","../src/locales/ca.ts","../src/locales/us.ts","../src/locales/de.ts","../src/locales/es.ts","../src/locales/fr.ts","../src/locales/gb.ts","../src/locales/it.ts"],"names":["cleanPhone","phone","formatE164","countryCode","ar_exports","__export","validate","COUNTRY_CODE","options","cleaned","national","type","formatted","br_exports","cl_exports","co_exports","cr_exports","ec_exports","gt_exports","mx_exports","pa_exports","pe_exports","ve_exports","ca_exports","areaCode","exchangeCode","us_exports","de_exports","es_exports","fr_exports","gb_exports","it_exports"],"mappings":"0GAAO,SAASA,CAAAA,CAAWC,EAAuB,CAChD,OAAOA,EAAM,OAAA,CAAQ,KAAA,CAAO,EAAE,CAChC,CAEO,SAASC,EAAWC,CAAAA,CAAqBF,CAAAA,CAAuB,CACrE,OAAO,CAAA,CAAA,EAAIE,CAAW,GAAGF,CAAK,CAAA,CAChC,CCNA,IAAAG,CAAAA,CAAA,GAAAC,EAAAD,CAAAA,CAAA,CAAA,QAAA,CAAA,IAAAE,CAAAA,CAAAA,CAAAA,CAGA,IAAMC,CAAAA,CAAe,IAAA,CAEd,SAASD,CAAAA,CAASL,CAAAA,CAAeO,CAAAA,CAA+C,CACrF,IAAMC,CAAAA,CAAUT,EAAWC,CAAK,CAAA,CAG5BS,CAAAA,CAAWD,CAAAA,CAMf,GALIA,CAAAA,CAAQ,WAAWF,CAAY,CAAA,EAAKE,CAAAA,CAAQ,MAAA,CAAS,EAAA,GACvDC,CAAAA,CAAWD,EAAQ,KAAA,CAAMF,CAAAA,CAAa,MAAM,CAAA,CAAA,CAI1CG,CAAAA,CAAS,MAAA,GAAW,GACtB,OAAO,CAAE,OAAA,CAAS,KAAA,CAAO,KAAA,CAAO,gCAAiC,EAGnE,IAAIC,CAAAA,CAA0C,SAAA,CAG1CD,CAAAA,CAAS,UAAA,CAAW,GAAG,EACzBC,CAAAA,CAAO,QAAA,CAGA,aAAA,CAAc,IAAA,CAAKD,CAAQ,CAAA,GAClCC,EAAO,UAAA,CAAA,CAGT,IAAIC,CAAAA,CAAYF,CAAAA,CAChB,OAAIF,CAAAA,EAAS,SAAW,MAAA,CACtBI,CAAAA,CAAYV,CAAAA,CAAWK,CAAAA,CAAcG,CAAQ,CAAA,CACpCF,GAAS,MAAA,GAAW,eAAA,GAC7BI,CA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KAAA,CAAO,kCAAmC,EAGrE,IAAIC,CAAAA,CAA0C,SAAA,CAG1CD,CAAAA,CAAS,UAAA,CAAW,GAAG,EACzBC,CAAAA,CAAO,QAAA,CAIPA,CAAAA,CAAO,UAAA,CAGT,IAAIC,CAAAA,CAAYF,EAChB,OAAIF,CAAAA,EAAS,MAAA,GAAW,MAAA,CACtBI,CAAAA,CAAYV,CAAAA,CAAWK,EAAcG,CAAQ,CAAA,CACpCF,CAAAA,EAAS,MAAA,GAAW,eAAA,GAC7BI,CAAAA,CAAY,IAAIL,CAAY,CAAA,CAAA,EAAIG,CAAQ,CAAA,CAAA,CAAA,CAGnC,CAAE,OAAA,CAAS,KAAM,IAAA,CAAAC,CAAAA,CAAM,SAAA,CAAAC,CAAU,CAC1C","file":"index.cjs","sourcesContent":["export function cleanPhone(phone: string): string {\n return phone.replace(/\\D/g, '');\n}\n\nexport function formatE164(countryCode: string, phone: string): string {\n return `+${countryCode}${phone}`;\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '54';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 10) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Argentine numbers: 10 digits (including area code)\n if (national.length !== 10) {\n return { isValid: false, error: 'Phone number must be 10 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 9 (e.g., 9 11 xxxx-xxxx)\n if (national.startsWith('9')) {\n type = 'mobile';\n }\n // Landline: Starts with 11, 2, 3, 4 or other area codes\n else if (/^(11|2|3|4)/.test(national)) {\n type = 'landline';\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '55';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 10) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Brazilian numbers: 10 digits (landline) or 11 digits (mobile with 9 prefix)\n if (national.length !== 10 && national.length !== 11) {\n return { isValid: false, error: 'Phone number must be 10 or 11 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: 11 digits starting with 9 (e.g., 11 98765-4321)\n if (national.length === 11 && national[2] === '9') {\n type = 'mobile';\n }\n // Landline: 10 digits\n else if (national.length === 10) {\n type = 'landline';\n } else {\n return { isValid: false, error: 'Invalid phone format for Brazil' };\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '56';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 9) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Chilean numbers: 9 digits\n if (national.length !== 9) {\n return { isValid: false, error: 'Phone number must be 9 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 9\n if (national.startsWith('9')) {\n type = 'mobile';\n }\n // Landline: Starts with 2 (Santiago) or other area codes\n else if (/^[2-7]/.test(national)) {\n type = 'landline';\n } else {\n return { isValid: false, error: 'Invalid prefix for Chile' };\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '57';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 10) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n if (national.length !== 10) {\n return { isValid: false, error: 'Phone number must be 10 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 3\n if (national.startsWith('3')) {\n type = 'mobile';\n }\n // Landline: Starts with 60\n else if (national.startsWith('60')) {\n type = 'landline';\n } else {\n return { isValid: false, error: 'Invalid prefix for Colombia' };\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '506';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 8) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Costa Rican numbers: 8 digits\n if (national.length !== 8) {\n return { isValid: false, error: 'Phone number must be 8 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 5, 6, 7, 8\n if (/^[5678]/.test(national)) {\n type = 'mobile';\n }\n // Landline: Starts with 2\n else if (national.startsWith('2')) {\n type = 'landline';\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '593';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 9) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Ecuadorian numbers: 9 digits\n if (national.length !== 9) {\n return { isValid: false, error: 'Phone number must be 9 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 9\n if (national.startsWith('9')) {\n type = 'mobile';\n }\n // Landline: Starts with 2-7 (area codes)\n else if (/^[2-7]/.test(national)) {\n type = 'landline';\n } else {\n return { isValid: false, error: 'Invalid prefix for Ecuador' };\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '502';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 8) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Guatemalan numbers: 8 digits\n if (national.length !== 8) {\n return { isValid: false, error: 'Phone number must be 8 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 3, 4, 5\n if (/^[345]/.test(national)) {\n type = 'mobile';\n }\n // Landline: Starts with 2, 6, 7\n else if (/^[267]/.test(national)) {\n type = 'landline';\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '52';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 10) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n if (national.length !== 10) {\n return { isValid: false, error: 'Phone number must be 10 digits' };\n }\n\n // Mexico doesn't strictly separate mobile/landline ranges as clearly in the first digit anymore for all cases,\n // but generally we can just validate length.\n // Distinction is harder without a massive database of area codes.\n // We will mark as 'unknown' type unless we want to implement complex area code logic.\n // For now, let's assume valid if 10 digits.\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type: 'unknown', formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '507';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 8) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Panamanian numbers: 8 digits\n if (national.length !== 8) {\n return { isValid: false, error: 'Phone number must be 8 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 6\n if (national.startsWith('6')) {\n type = 'mobile';\n }\n // Landline: Starts with 2-5, 7-9\n else if (/^[2-57-9]/.test(national)) {\n type = 'landline';\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '51';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 9) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Peruvian numbers: 9 digits\n if (national.length !== 9) {\n return { isValid: false, error: 'Phone number must be 9 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 9\n if (national.startsWith('9')) {\n type = 'mobile';\n }\n // Landline: Starts with 1 (Lima) or other area codes (0)\n else if (/^[01]/.test(national)) {\n type = 'landline';\n } else {\n return { isValid: false, error: 'Invalid prefix for Peru' };\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '58';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 10) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Venezuelan numbers: 10 digits (including area code)\n if (national.length !== 10) {\n return { isValid: false, error: 'Phone number must be 10 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 4\n if (national.startsWith('4')) {\n type = 'mobile';\n }\n // Landline: Starts with 2 (Caracas) or other area codes\n else if (/^[2]/.test(national)) {\n type = 'landline';\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '1';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length === 11) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Canadian numbers: 10 digits (NPA-NXX-XXXX) - same format as US\n if (national.length !== 10) {\n return { isValid: false, error: 'Phone number must be 10 digits' };\n }\n\n // Check valid area code (NPA): first digit 2-9, second digit 0-8, third digit 0-9\n const areaCode = national.substring(0, 3);\n if (!/^[2-9][0-8][0-9]$/.test(areaCode)) {\n return { isValid: false, error: 'Invalid area code' };\n }\n\n // Check valid exchange code (NXX): first digit 2-9\n const exchangeCode = national.substring(3, 6);\n if (!/^[2-9]\\d{2}$/.test(exchangeCode)) {\n return { isValid: false, error: 'Invalid exchange code' };\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type: 'unknown', formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '1';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length === 11) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // US/Canada numbers: 10 digits (NPA-NXX-XXXX)\n if (national.length !== 10) {\n return { isValid: false, error: 'Phone number must be 10 digits' };\n }\n\n // Check valid area code (NPA): first digit 2-9, second digit 0-8, third digit 0-9\n const areaCode = national.substring(0, 3);\n if (!/^[2-9][0-8][0-9]$/.test(areaCode)) {\n return { isValid: false, error: 'Invalid area code' };\n }\n\n // Check valid exchange code (NXX): first digit 2-9\n const exchangeCode = national.substring(3, 6);\n if (!/^[2-9]\\d{2}$/.test(exchangeCode)) {\n return { isValid: false, error: 'Invalid exchange code' };\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type: 'unknown', formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '49';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE)) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // German numbers: variable length (10-11 digits including area code)\n // Often start with 0 for domestic dialing\n if (national.startsWith('0')) {\n national = national.slice(1);\n }\n\n if (national.length < 9 || national.length > 11) {\n return { isValid: false, error: 'Phone number must be 9-11 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 15, 16, 17\n if (/^1[567]/.test(national)) {\n type = 'mobile';\n }\n // Landline: various area codes\n else {\n type = 'landline';\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '34';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 9) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Spanish numbers: 9 digits\n if (national.length !== 9) {\n return { isValid: false, error: 'Phone number must be 9 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 6 or 7\n if (/^[67]/.test(national)) {\n type = 'mobile';\n }\n // Landline: Starts with 8 or 9\n else if (/^[89]/.test(national)) {\n type = 'landline';\n } else {\n return { isValid: false, error: 'Invalid prefix for Spain' };\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '33';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 9) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // French numbers: 9 digits (excluding the leading 0)\n // But users often include the leading 0, so we accept both formats\n if (national.startsWith('0')) {\n national = national.slice(1);\n }\n\n if (national.length !== 9) {\n return { isValid: false, error: 'Phone number must be 9 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 6 or 7\n if (/^[67]/.test(national)) {\n type = 'mobile';\n }\n // Landline: Starts with 1, 2, 3, 4, 5, 9\n else if (/^[1-5,9]/.test(national)) {\n type = 'landline';\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '44';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 10) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // UK numbers: 10 digits (excluding the leading 0)\n // But users often include the leading 0, so we accept both formats\n if (national.startsWith('0')) {\n national = national.slice(1);\n }\n\n if (national.length !== 10) {\n return { isValid: false, error: 'Phone number must be 10 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 7\n if (national.startsWith('7')) {\n type = 'mobile';\n }\n // Landline: Starts with 1, 2, 3\n else if (/^[123]/.test(national)) {\n type = 'landline';\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n","import type { PhoneValidationResult, PhoneOptions } from '../core/types.js';\nimport { cleanPhone, formatE164 } from '../core/utils.js';\n\nconst COUNTRY_CODE = '39';\n\nexport function validate(phone: string, options?: PhoneOptions): PhoneValidationResult {\n const cleaned = cleanPhone(phone);\n\n // Check if it includes country code\n let national = cleaned;\n if (cleaned.startsWith(COUNTRY_CODE) && cleaned.length > 9) {\n national = cleaned.slice(COUNTRY_CODE.length);\n }\n\n // Italian numbers: variable length (9-10 digits)\n // Often start with 0 for domestic dialing\n if (national.startsWith('0')) {\n national = national.slice(1);\n }\n\n if (national.length < 9 || national.length > 10) {\n return { isValid: false, error: 'Phone number must be 9-10 digits' };\n }\n\n let type: 'mobile' | 'landline' | 'unknown' = 'unknown';\n\n // Mobile: Starts with 3\n if (national.startsWith('3')) {\n type = 'mobile';\n }\n // Landline: various area codes (0, 1, 2, 4, 5, 6, 7, 8, 9)\n else {\n type = 'landline';\n }\n\n let formatted = national;\n if (options?.format === 'e164') {\n formatted = formatE164(COUNTRY_CODE, national);\n } else if (options?.format === 'international') {\n formatted = `+${COUNTRY_CODE} ${national}`;\n }\n\n return { isValid: true, type, formatted };\n}\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
export { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.cjs';
|
|
2
|
+
export { a as ar } from './ar-JxzqPct0.cjs';
|
|
3
|
+
export { b as br } from './br-COFIo49r.cjs';
|
|
4
|
+
export { c as cl } from './cl-BSQlXUww.cjs';
|
|
2
5
|
export { c as co } from './co-Cmyehxbk.cjs';
|
|
6
|
+
export { c as cr } from './cr-C3m9H-RU.cjs';
|
|
7
|
+
export { e as ec } from './ec-D7HUkRKn.cjs';
|
|
8
|
+
export { g as gt } from './gt-uZfIOMWw.cjs';
|
|
3
9
|
export { m as mx } from './mx-BaMV1Q-C.cjs';
|
|
10
|
+
export { p as pa } from './pa-CEAa_MLu.cjs';
|
|
11
|
+
export { p as pe } from './pe-CHVFUsc1.cjs';
|
|
12
|
+
export { v as ve } from './ve-DMPrCtKR.cjs';
|
|
13
|
+
export { c as ca } from './ca-C0PYBvZK.cjs';
|
|
14
|
+
export { u as us } from './us-BV-jF4X9.cjs';
|
|
15
|
+
export { d as de } from './de-ZAyw44MG.cjs';
|
|
16
|
+
export { e as es } from './es-C7dIuFpf.cjs';
|
|
17
|
+
export { f as fr } from './fr-BSghMzs5.cjs';
|
|
18
|
+
export { g as gb } from './gb-B5NBNoma.cjs';
|
|
19
|
+
export { i as it } from './it-BtfZnlF6.cjs';
|
|
4
20
|
|
|
5
21
|
declare function cleanPhone(phone: string): string;
|
|
6
22
|
declare function formatE164(countryCode: string, phone: string): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
export { a as PhoneOptions, P as PhoneValidationResult } from './types-ClMaPMkH.js';
|
|
2
|
+
export { a as ar } from './ar-BRemFHRv.js';
|
|
3
|
+
export { b as br } from './br-Ct41H5gk.js';
|
|
4
|
+
export { c as cl } from './cl-W_f2Hza8.js';
|
|
2
5
|
export { c as co } from './co-XlKvHbFg.js';
|
|
6
|
+
export { c as cr } from './cr-UzSwttKD.js';
|
|
7
|
+
export { e as ec } from './ec-CCV5mLhv.js';
|
|
8
|
+
export { g as gt } from './gt-DiiNa6Vm.js';
|
|
3
9
|
export { m as mx } from './mx-gjjuvO94.js';
|
|
10
|
+
export { p as pa } from './pa-CeerPsSh.js';
|
|
11
|
+
export { p as pe } from './pe-ZpTRwvEa.js';
|
|
12
|
+
export { v as ve } from './ve-Czf_bYd9.js';
|
|
13
|
+
export { c as ca } from './ca-CNnuf6qY.js';
|
|
14
|
+
export { u as us } from './us-DcxF3Jrz.js';
|
|
15
|
+
export { d as de } from './de-bIFBVR-K.js';
|
|
16
|
+
export { e as es } from './es-DVVnhfSE.js';
|
|
17
|
+
export { f as fr } from './fr-C8OxubJ3.js';
|
|
18
|
+
export { g as gb } from './gb-DDivDdMy.js';
|
|
19
|
+
export { i as it } from './it-DollYcFl.js';
|
|
4
20
|
|
|
5
21
|
declare function cleanPhone(phone: string): string;
|
|
6
22
|
declare function formatE164(countryCode: string, phone: string): string;
|