(length: number = 15)
| 4 | Returns an ID of only numbers, i.e 123456789 |
| 5 | */ |
| 6 | export function getRandomId(length: number = 15): string { |
| 7 | // 10 to the power of length |
| 8 | const max = Math.pow(10, length); |
| 9 | return Math.floor(Math.random() * max).toString(); |
| 10 | } |
| 11 | |
| 12 | export function getRandomIdGreaterThan(min: number): string { |
| 13 | const max = Math.pow(10, min.toString().length); |
no outgoing calls
no test coverage detected