(value string)
| 22 | } |
| 23 | |
| 24 | func (input *request) sanitizeAddress(value string) string { |
| 25 | value = strings.TrimSpace(value) |
| 26 | if !strings.HasPrefix(value, "+") && input.isDigits(value) && len(value) > 9 { |
| 27 | value = "+" + value |
| 28 | } |
| 29 | |
| 30 | if number, err := phonenumbers.Parse(value, phonenumbers.UNKNOWN_REGION); err == nil { |
| 31 | value = phonenumbers.Format(number, phonenumbers.E164) |
| 32 | } |
| 33 | |
| 34 | return value |
| 35 | } |
| 36 | |
| 37 | func (input *request) sanitizeContact(owner string, contact string) string { |
| 38 | contact = strings.TrimSpace(contact) |
no test coverage detected