()
| 714 | } |
| 715 | |
| 716 | function getUUID() { |
| 717 | if (crypto.randomUUID) { |
| 718 | return crypto.randomUUID().replaceAll('-', ''); |
| 719 | } else { |
| 720 | let result = ''; |
| 721 | const buf = new Uint16Array(8); |
| 722 | crypto.getRandomValues(buf); |
| 723 | for (let i = 0; i < buf.length; i++) { |
| 724 | result += buf[i].toString(16); |
| 725 | } |
| 726 | return result; |
| 727 | } |
| 728 | } |
| 729 | |
| 730 | function mapError(obj) { |
| 731 | const error = new Error(obj.message); |