finki-main
main
|
Last change
on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
698 bytes
|
| Rev | Line | |
|---|
| [81bc7da] | 1 | "use strict";
|
|---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
|---|
| 3 | exports.shuffleArray = exports.SocksClientError = void 0;
|
|---|
| 4 | /**
|
|---|
| 5 | * Error wrapper for SocksClient
|
|---|
| 6 | */
|
|---|
| 7 | class SocksClientError extends Error {
|
|---|
| 8 | constructor(message, options) {
|
|---|
| 9 | super(message);
|
|---|
| 10 | this.options = options;
|
|---|
| 11 | }
|
|---|
| 12 | }
|
|---|
| 13 | exports.SocksClientError = SocksClientError;
|
|---|
| 14 | /**
|
|---|
| 15 | * Shuffles a given array.
|
|---|
| 16 | * @param array The array to shuffle.
|
|---|
| 17 | */
|
|---|
| 18 | function shuffleArray(array) {
|
|---|
| 19 | for (let i = array.length - 1; i > 0; i--) {
|
|---|
| 20 | const j = Math.floor(Math.random() * (i + 1));
|
|---|
| 21 | [array[i], array[j]] = [array[j], array[i]];
|
|---|
| 22 | }
|
|---|
| 23 | }
|
|---|
| 24 | exports.shuffleArray = shuffleArray;
|
|---|
| 25 | //# sourceMappingURL=util.js.map |
|---|
Note:
See
TracBrowser
for help on using the repository browser.