source: trip-planner-front/node_modules/socks/build/common/util.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 753 bytes
RevLine 
[6a3a178]1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.shuffleArray = exports.SocksClientError = void 0;
4/**
5 * Error wrapper for SocksClient
6 */
7class SocksClientError extends Error {
8 constructor(message, options) {
9 super(message);
10 this.options = options;
11 }
12}
13exports.SocksClientError = SocksClientError;
14/**
15 * Shuffles a given array.
16 * @param array The array to shuffle.
17 */
18function shuffleArray(array) {
19 // tslint:disable-next-line:no-increment-decrement
20 for (let i = array.length - 1; i > 0; i--) {
21 const j = Math.floor(Math.random() * (i + 1));
22 [array[i], array[j]] = [array[j], array[i]];
23 }
24}
25exports.shuffleArray = shuffleArray;
26//# sourceMappingURL=util.js.map
Note: See TracBrowser for help on using the repository browser.