(value: string)
| 112 | } |
| 113 | |
| 114 | function decodeAlphaRank(value: string): number | null { |
| 115 | if (!ALPHA_RANK_PATTERN.test(value)) { |
| 116 | return null; |
| 117 | } |
| 118 | |
| 119 | let result = 0; |
| 120 | for (const char of value.slice(ALPHA_RANK_PREFIX.length)) { |
| 121 | result = result * ALPHA_RANK_BASE + (char.charCodeAt(0) - 97); |
| 122 | } |
| 123 | return result; |
| 124 | } |
| 125 | |
| 126 | function createAlphaRankForDisplayIndex( |
| 127 | index: number, |
no outgoing calls
no test coverage detected