()
| 133 | } |
| 134 | |
| 135 | function createId(): string { |
| 136 | const nanoid = customRandom( |
| 137 | "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", |
| 138 | 12, |
| 139 | (bytes: number): Uint8Array => { |
| 140 | const array = new Uint8Array(bytes); |
| 141 | crypto.getRandomValues(array); |
| 142 | return array; |
| 143 | } |
| 144 | ); |
| 145 | return nanoid(); |
| 146 | } |
| 147 | |
| 148 | function isUrl(possibleUrl: string): boolean { |
| 149 | try { |
no outgoing calls
no test coverage detected