fix: canonicalize phone numbers as E.164

This commit is contained in:
richjohnrambo
2026-08-18 01:23:18 +08:00
parent bf562c7d56
commit e063e7879e
7 changed files with 103 additions and 6 deletions
+13
View File
@@ -0,0 +1,13 @@
package tel
import "testing"
func TestPreCheckDefaultsToChina(t *testing.T) {
got, err := (&validator{}).PreCheck("13800138000", map[string]any{})
if err != nil {
t.Fatal(err)
}
if got != "tel:+8613800138000" {
t.Fatalf("got %q, want tel:+8613800138000", got)
}
}