(value = "")
| 59 | } |
| 60 | |
| 61 | function normalizeAuthorization(value = "") { |
| 62 | const token = String(value || "").trim(); |
| 63 | if (!token) return ""; |
| 64 | if (/^bearer/i.test(token)) return token; |
| 65 | if (/^Bearer\s+/i.test(token)) return `bearer${token.replace(/^Bearer\s+/i, "")}`; |
| 66 | return `bearer${token}`; |
| 67 | } |
| 68 | |
| 69 | function maskMobile(mobile = "") { |
| 70 | return String(mobile || "").replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2"); |