NormalizeAuto applies address.PRECISFold to valid emails and plain UsernameCaseMapped profile to other strings.
(s string)
| 16 | // NormalizeAuto applies address.PRECISFold to valid emails and |
| 17 | // plain UsernameCaseMapped profile to other strings. |
| 18 | func NormalizeAuto(s string) (string, error) { |
| 19 | if address.Valid(s) { |
| 20 | return address.PRECISFold(s) |
| 21 | } |
| 22 | return precis.UsernameCaseMapped.CompareKey(s) |
| 23 | } |
| 24 | |
| 25 | // NormalizeFuncs defines configurable normalization functions to be used |
| 26 | // in authentication and authorization routines. |
nothing calls this directly
no test coverage detected