tele_number_utils 1.0.10 → 1.0.12
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 +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Handles tricky scenarios like **shared country codes** (e.g., +1, +44, +7) and *
|
|
|
15
15
|
- +672 → Australian territories
|
|
16
16
|
|
|
17
17
|
- Format phone numbers **dynamically** with custom group sizes and separators:
|
|
18
|
-
- Separators: space (` `), dash (`-`),
|
|
18
|
+
- Separators: space (` `), dash (`-`), parentheses (`()`)
|
|
19
19
|
|
|
20
20
|
- Fully **TypeScript-ready** with types and interfaces
|
|
21
21
|
- Minimal **dependency-free** footprint
|
|
@@ -78,13 +78,13 @@ interface Country {
|
|
|
78
78
|
import { formatter } from "tele_number_utils";
|
|
79
79
|
|
|
80
80
|
// Default grouping [3,3,4]
|
|
81
|
-
console.log(formatter("1234567890")); // "
|
|
81
|
+
console.log(formatter("+1234567890")); // "+1 2345 67890"
|
|
82
82
|
|
|
83
83
|
// Custom grouping with dash separator
|
|
84
|
-
console.log(formatter("123456789012345", [4, 4, 4, 4], "-")); // "
|
|
84
|
+
console.log(formatter("+123456789012345", [4, 4, 4, 4], "-")); // "+1 2345-6789-0123-45"
|
|
85
85
|
|
|
86
86
|
// Parentheses style
|
|
87
|
-
console.log(formatter("1234567890", [3, 3, 4], "()")); // "(
|
|
87
|
+
console.log(formatter("+1234567890", [3, 3, 4], "()")); // "(+1) 2345 678 90"
|
|
88
88
|
|
|
89
89
|
// Short numbers <= 6 digits remain unchanged
|
|
90
90
|
console.log(formatter("12345")); // "12345"
|