The phone as an API-direct provider receives it: the stripped candidate
normalisePhoneNumber validates, which is the canonical form when
the input is an Israeli mobile and the stripped digits otherwise. Every
consumer that must agree with what is sent — the credentials builder and
the login fingerprint — calls this one function, so they cannot drift.
It needs no validation of its own, so a caller that already validated the
phone, to warn about it, does not parse it twice.
Parameters
raw: string
Raw phone string as supplied by config.json or env.
Returns string
Canonical 972XXXXXXXXX, or the stripped digits on mismatch.
The phone as an API-direct provider receives it: the stripped candidate normalisePhoneNumber validates, which is the canonical form when the input is an Israeli mobile and the stripped digits otherwise. Every consumer that must agree with what is sent — the credentials builder and the login fingerprint — calls this one function, so they cannot drift. It needs no validation of its own, so a caller that already validated the phone, to warn about it, does not parse it twice.