@jonahsnider/util
Advanced tools
Comparing version 7.0.1 to 7.1.0
import { DirectionFn } from './types'; | ||
/** A 2-dimensional table of type `T`. */ | ||
export declare type Table<T> = T[][]; | ||
/** An array with at least one element. */ | ||
/** An array with at least 1 element. */ | ||
export declare type NonEmptyArray<T> = [T, ...T[]]; | ||
@@ -121,3 +121,3 @@ /** | ||
/** | ||
* Arrange two objects in a tuple by their length/size. | ||
* Arrange 2 objects in a tuple by their length/size. | ||
* Useful for situations where you are iterating `a` or `b` depending on which is larger. | ||
@@ -155,3 +155,3 @@ * | ||
*/ | ||
export declare function holes<T>(array: readonly T[]): number[]; | ||
export declare function holes(array: readonly unknown[]): number[]; | ||
/** | ||
@@ -178,2 +178,42 @@ * Remove an element from an array. | ||
/** | ||
* Replace the first occurrence of `searchElement` with `replacement` in an array. | ||
* Strict equality (`===`) is used to compare elements. | ||
* | ||
* @example | ||
* ```js | ||
* const array = [1, 2, 1, 3, 1]; | ||
* | ||
* replace(array, 1, 2); | ||
* | ||
* console.log(array); // [2, 2, 1, 3, 1] | ||
* ``` | ||
* | ||
* @param array - The array to replace elements in | ||
* @param searchElement - The element to search for | ||
* @param replacement - The element to replace `searchElement` with | ||
* | ||
* @returns The index of the replaced element, or `-1` if it is not present. | ||
*/ | ||
export declare function replace<T>(array: T[], searchElement: T, replacement: T): number; | ||
/** | ||
* Replace all occurrences of `searchElement` with `replacement` in an array. | ||
* Strict equality (`===`) is used to compare elements. | ||
* | ||
* @example | ||
* ```js | ||
* const array = [1, 2, 1, 3, 1]; | ||
* | ||
* replaceAll(array, 1, 2); | ||
* | ||
* console.log(array); // [2, 2, 2, 3, 2] | ||
* ``` | ||
* | ||
* @param array - The array to replace elements in | ||
* @param searchElement - The element to search for | ||
* @param replacement - The element to replace `searchElement` with | ||
* | ||
* @returns The number of elements replaced | ||
*/ | ||
export declare function replaceAll<T>(array: T[], searchElement: T, replacement: T): number; | ||
/** | ||
* Create a new array of a specified length and fill it with a given value. | ||
@@ -252,2 +292,16 @@ * | ||
export declare function padEnd<T>(array: T[], maxLength: number, fillValue: T): void; | ||
/** | ||
* Get an array of indexes of `searchElement` in an array. | ||
* | ||
* @example | ||
* ```js | ||
* indexOfAll([1, 2, 1, 3, 1], 1); // [0, 2, 4] | ||
* ``` | ||
* | ||
* @param array - The array to search in | ||
* @param searchElement - The element to search for | ||
* | ||
* @returns An array of indexes of `searchElement` in `array` | ||
*/ | ||
export declare function indexOfAll<T>(array: readonly T[], searchElement: T): number[]; | ||
export {}; |
export * from './status'; | ||
export * from './method'; | ||
export * as StatusRange from './status-range'; |
/** | ||
* Set of HTTP request methods to indicate the desired action to be performed for a given resource. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods | MDN docs} | ||
*/ | ||
@@ -9,3 +9,3 @@ export declare enum Method { | ||
* Requests using GET should only retrieve data. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET | MDN docs} | ||
*/ | ||
@@ -15,3 +15,3 @@ Get = "GET", | ||
* The `HEAD` method asks for a response identical to that of a `GET` request, but without the response body. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD | MDN docs} | ||
*/ | ||
@@ -21,3 +21,3 @@ Head = "HEAD", | ||
* The `POST` method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST | MDN docs} | ||
*/ | ||
@@ -27,3 +27,3 @@ Post = "POST", | ||
* The `PUT` method replaces all current representations of the target resource with the request payload. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT | MDN docs} | ||
*/ | ||
@@ -33,3 +33,3 @@ Put = "PUT", | ||
* The `DELETE` method deletes the specified resource. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE | MDN docs} | ||
*/ | ||
@@ -39,3 +39,3 @@ Delete = "DELETE", | ||
* The `CONNECT` method establishes a tunnel to the server identified by the target resource. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT | MDN docs} | ||
*/ | ||
@@ -45,3 +45,3 @@ Connect = "CONNECT", | ||
* The `OPTIONS` method is used to describe the communication options for the target resource. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS | MDN docs} | ||
*/ | ||
@@ -51,3 +51,3 @@ Options = "OPTIONS", | ||
* The `TRACE` method performs a message loop-back test along the path to the target resource. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/TRACE MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/TRACE | MDN docs} | ||
*/ | ||
@@ -57,5 +57,5 @@ Trace = "TRACE", | ||
* The `PATCH` method is used to apply partial modifications to a resource. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATC MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATC | MDN docs} | ||
*/ | ||
Patch = "PATCH" | ||
} |
/** | ||
* HTTP response status codes indicate whether a specific HTTP request has been successfully completed. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status | MDN docs} | ||
*/ | ||
@@ -8,3 +8,3 @@ export declare enum Status { | ||
* 100 Continue. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100 | MDN docs} | ||
*/ | ||
@@ -14,3 +14,3 @@ Continue = 100, | ||
* 101 Switching Protocols. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/101 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/101 | MDN docs} | ||
*/ | ||
@@ -20,3 +20,3 @@ SwitchingProtocols = 101, | ||
* 103 Early Hints. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103 | MDN docs} | ||
*/ | ||
@@ -26,3 +26,3 @@ EarlyHints = 103, | ||
* 200 OK. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200 | MDN docs} | ||
*/ | ||
@@ -32,3 +32,3 @@ Ok = 200, | ||
* 201 Created. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201 | MDN docs} | ||
*/ | ||
@@ -38,3 +38,3 @@ Created = 201, | ||
* 202 Accepted. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202 | MDN docs} | ||
*/ | ||
@@ -44,3 +44,3 @@ Accepted = 202, | ||
* 203 Non-Authoritative Information. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/203 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/203 | MDN docs} | ||
*/ | ||
@@ -50,3 +50,3 @@ NonAuthoritativeInformation = 203, | ||
* 204 No Content. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204 | MDN docs} | ||
*/ | ||
@@ -56,3 +56,3 @@ NoContent = 204, | ||
* 205 Reset Content. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/205 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/205 | MDN docs} | ||
*/ | ||
@@ -62,3 +62,3 @@ ResetContent = 205, | ||
* 206 Partial Content. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206 | MDN docs} | ||
*/ | ||
@@ -68,3 +68,3 @@ PartialContent = 206, | ||
* 300 Multiple Choices. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/300 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/300 | MDN docs} | ||
*/ | ||
@@ -74,3 +74,3 @@ MultipleChoices = 300, | ||
* 301 Moved Permanently. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301 | MDN docs} | ||
*/ | ||
@@ -80,3 +80,3 @@ MovedPermanently = 301, | ||
* 302 Found. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302 | MDN docs} | ||
*/ | ||
@@ -86,3 +86,3 @@ Found = 302, | ||
* 303 See Other. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303 | MDN docs} | ||
*/ | ||
@@ -92,3 +92,3 @@ SeeOther = 303, | ||
* 304 Not Modified. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304 | MDN docs} | ||
*/ | ||
@@ -98,3 +98,3 @@ NotModified = 304, | ||
* 307 Temporary Redirect. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307 | MDN docs} | ||
*/ | ||
@@ -104,3 +104,3 @@ TemporaryRedirect = 307, | ||
* 308 Permanent Redirect. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308 | MDN docs} | ||
*/ | ||
@@ -110,3 +110,3 @@ PermanentRedirect = 308, | ||
* 400 Bad Request. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400 | MDN docs} | ||
*/ | ||
@@ -116,3 +116,3 @@ BadRequest = 400, | ||
* 401 Unauthorized. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401 | MDN docs} | ||
*/ | ||
@@ -122,3 +122,3 @@ Unauthorized = 401, | ||
* 402 Payment Required. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/402 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/402 | MDN docs} | ||
*/ | ||
@@ -128,3 +128,3 @@ PaymentRequired = 402, | ||
* 403 Forbidden. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403 | MDN docs} | ||
*/ | ||
@@ -134,3 +134,3 @@ Forbidden = 403, | ||
* 404 Not Found. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404 | MDN docs} | ||
*/ | ||
@@ -140,3 +140,3 @@ NotFound = 404, | ||
* 405 Method Not Allowed. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 | MDN docs} | ||
*/ | ||
@@ -146,3 +146,3 @@ MethodNotAllowed = 405, | ||
* 406 Not Acceptable. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406 | MDN docs} | ||
*/ | ||
@@ -152,3 +152,3 @@ NotAcceptable = 406, | ||
* 407 Proxy Authentication Required. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/407 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/407 | MDN docs} | ||
*/ | ||
@@ -158,3 +158,3 @@ ProxyAuthenticationRequired = 407, | ||
* 408 Request Timeout. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408 | MDN docs} | ||
*/ | ||
@@ -164,3 +164,3 @@ RequestTimeout = 408, | ||
* 409 Conflict. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409 | MDN docs} | ||
*/ | ||
@@ -170,3 +170,3 @@ Conflict = 409, | ||
* 410 Gone. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410 | MDN docs} | ||
*/ | ||
@@ -176,3 +176,3 @@ Gone = 410, | ||
* 411 Length Required. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/411 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/411 | MDN docs} | ||
*/ | ||
@@ -182,3 +182,3 @@ LengthRequired = 411, | ||
* 412 Precondition Failed. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/412 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/412 | MDN docs} | ||
*/ | ||
@@ -188,3 +188,3 @@ PreconditionFailed = 412, | ||
* 413 Payload Too Large. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413 | MDN docs} | ||
*/ | ||
@@ -194,3 +194,3 @@ PayloadTooLarge = 413, | ||
* 414 URI Too Long. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414 | MDN docs} | ||
*/ | ||
@@ -200,3 +200,3 @@ UriTooLong = 414, | ||
* 415 Unsupported Media Type. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415 | MDN docs} | ||
*/ | ||
@@ -206,3 +206,3 @@ UnsupportedMediaType = 415, | ||
* 416 Range Not Satisfiable. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416 | MDN docs} | ||
*/ | ||
@@ -212,3 +212,3 @@ RangeNotSatisfiable = 416, | ||
* 417 Expectation Failed. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/417 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/417 | MDN docs} | ||
*/ | ||
@@ -218,3 +218,3 @@ ExpectationFailed = 417, | ||
* 418 I'm a teapot. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418 | MDN docs} | ||
*/ | ||
@@ -224,3 +224,3 @@ ImATeapot = 418, | ||
* 422 Unprocessable Entity. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422 | MDN docs} | ||
*/ | ||
@@ -230,3 +230,3 @@ UnprocessableEntity = 422, | ||
* 425 Too Early. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/425 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/425 | MDN docs} | ||
*/ | ||
@@ -236,3 +236,3 @@ TooEarly = 425, | ||
* 426 Upgrade Required. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/426 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/426 | MDN docs} | ||
*/ | ||
@@ -242,3 +242,3 @@ UpgradeRequired = 426, | ||
* 428 Precondition Required. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/428 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/428 | MDN docs} | ||
*/ | ||
@@ -248,3 +248,3 @@ PreconditionRequired = 428, | ||
* 429 Too Many Requests. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429 | MDN docs} | ||
*/ | ||
@@ -254,3 +254,3 @@ TooManyRequests = 429, | ||
* 431 Request Header Fields Too Large. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/431 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/431 | MDN docs} | ||
*/ | ||
@@ -260,3 +260,3 @@ RequestHeaderFieldsTooLarge = 431, | ||
* 451 Unavailable For Legal Reasons. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/451 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/451 | MDN docs} | ||
*/ | ||
@@ -266,3 +266,3 @@ UnavailableForLegalReasons = 451, | ||
* 500 Internal Server Error. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500 | MDN docs} | ||
*/ | ||
@@ -272,3 +272,3 @@ InternalServerError = 500, | ||
* 501 Not Implemented. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/501 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/501 | MDN docs} | ||
*/ | ||
@@ -278,3 +278,3 @@ NotImplemented = 501, | ||
* 502 Bad Gateway. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502 | MDN docs} | ||
*/ | ||
@@ -284,3 +284,3 @@ BadGateway = 502, | ||
* 503 Service Unavailable. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503 | MDN docs} | ||
*/ | ||
@@ -290,3 +290,3 @@ ServiceUnavailable = 503, | ||
* 504 Gateway Timeout. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504 | MDN docs} | ||
*/ | ||
@@ -296,3 +296,3 @@ GatewayTimeout = 504, | ||
* 505 HTTP Version Not Supported. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/505 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/505 | MDN docs} | ||
*/ | ||
@@ -302,3 +302,3 @@ HttpVersionNotSupported = 505, | ||
* 506 Variant Also Negotiates. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/506 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/506 | MDN docs} | ||
*/ | ||
@@ -308,3 +308,3 @@ VariantAlsoNegotiates = 506, | ||
* 507 Insufficient Storage. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/507 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/507 | MDN docs} | ||
*/ | ||
@@ -314,3 +314,3 @@ InsufficientStorage = 507, | ||
* 508 Loop Detected. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/508 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/508 | MDN docs} | ||
*/ | ||
@@ -320,3 +320,3 @@ LoopDetected = 508, | ||
* 510 Not Extended. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/510 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/510 | MDN docs} | ||
*/ | ||
@@ -326,5 +326,5 @@ NotExtended = 510, | ||
* 511 Network Authentication Required. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/51 MDN docs | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/51 | MDN docs} | ||
*/ | ||
NetworkAuthenticationRequired = 511 | ||
} |
/** | ||
* Check if two arrays have the same elements in the same order. | ||
* Check if 2 arrays have the same elements in the same order. | ||
* Strict equality (`===`) is used to compare elements. | ||
@@ -20,3 +20,3 @@ * | ||
/** | ||
* Check if two `Set`s have the same elements. | ||
* Check if 2 `Set`s have the same elements. | ||
* Strict equality (`===`) is used to compare elements. | ||
@@ -39,3 +39,3 @@ * | ||
/** | ||
* Check if two `Map`s have the same key-value pairs. | ||
* Check if 2 `Map`s have the same key-value pairs. | ||
* Strict equality (`===`) is used to compare values. | ||
@@ -42,0 +42,0 @@ * |
@@ -12,2 +12,3 @@ export * from './array'; | ||
export * from './object'; | ||
export * from './auto-percentage'; | ||
export * from './promise'; | ||
@@ -14,0 +15,0 @@ export * from './range'; |
@@ -32,3 +32,3 @@ /** | ||
*/ | ||
export declare function join<T>(iterable: Iterable<T>, separator?: string): string; | ||
export declare function join(iterable: Iterable<unknown>, separator?: string): string; | ||
/** | ||
@@ -115,2 +115,3 @@ * Determines whether all the elements of an iterable are truthy. | ||
* Construct a frequency table from an iterable. | ||
* Similar to [Python's `Counter` class](https://docs.python.org/3/library/collections.html#collections.Counter). | ||
* | ||
@@ -130,6 +131,24 @@ * @example | ||
/** | ||
* Split an iterable into two arrays of elements that passed or failed a provided predicate. | ||
* Split an iterable into 2 arrays of elements that passed or failed a provided type guard. | ||
* | ||
* @example | ||
* ```js | ||
* const [numbers, strings] = partition(['a', 1, 'b', 2, 'c', 3], (element): element is number => typeof element === 'number'); | ||
* | ||
* console.log(numbers); // [1, 2, 3] | ||
* console.log(strings); // ['a', 'b', 'c'] | ||
* ``` | ||
* | ||
* @param iterable - The iterable to partition | ||
* @param typeGuard - The type guard to apply to each element of `iterable`. If the type guard returns a truthy value the element will be added to the `passed` | ||
* array in the result. Otherwise, it will be added to the `failed` array. | ||
* | ||
* @returns A tuple where the 1st element is an array of elements that passed the predicate (`passed`) and the 2nd element are the elements that failed the predicate (`failed`) | ||
*/ | ||
export declare function partition<S extends T, T>(iterable: Iterable<T>, typeGuard: (element: T) => element is S): [passed: S[], failed: Array<Exclude<T, S>>]; | ||
/** | ||
* Split an iterable into 2 arrays of elements that passed or failed a provided predicate. | ||
* | ||
* @example | ||
* ```js | ||
* const [odd, even] = partition([1, 2, 3, 4, 5, 6], num => num % 2); | ||
@@ -166,3 +185,3 @@ * | ||
* ```js | ||
* first([1, 2, 3], 1); // [1] | ||
* [...first([1, 2, 3], 1)]; // [1] | ||
* ``` | ||
@@ -172,3 +191,3 @@ * | ||
* ```js | ||
* first([1, 2, 3], 2); // [1, 2] | ||
* [...first([1, 2, 3], 2)]; // [1, 2] | ||
* ``` | ||
@@ -175,0 +194,0 @@ * |
import { Comparable } from './types'; | ||
/** | ||
* A range between two values. | ||
* A range between 2 values. | ||
*/ | ||
@@ -5,0 +5,0 @@ export declare class Range { |
@@ -72,3 +72,3 @@ import { Comparable } from '../types'; | ||
/** | ||
* Get the largest value of the two parameters. | ||
* Get the largest value of the 2 parameters. | ||
* Meant to be used with `Array.prototype.reduce`. | ||
@@ -90,3 +90,3 @@ * | ||
/** | ||
* Get the lowest value of the two parameters. | ||
* Get the lowest value of the 2 parameters. | ||
* Meant to be used with `Array.prototype.reduce`. | ||
@@ -93,0 +93,0 @@ * |
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
export declare function isSuperset<A, B>(a: ReadonlySet<A | B>, b: Iterable<B>): boolean; | ||
export declare function isSuperset<T>(a: ReadonlySet<T>, b: Iterable<T>): boolean; | ||
/** | ||
@@ -23,3 +23,3 @@ * Check if `a` is a subset of `b`. | ||
*/ | ||
export declare function isSubset<A, B>(a: Iterable<A>, b: ReadonlySet<A | B>): boolean; | ||
export declare function isSubset<T>(a: Iterable<T>, b: ReadonlySet<T>): boolean; | ||
/** | ||
@@ -44,3 +44,3 @@ * Get the union of 2 iterables. | ||
*/ | ||
export declare function isDisjoint<A, B>(a: Iterable<A>, b: Iterable<B>): boolean; | ||
export declare function isDisjoint<T>(a: Iterable<T>, b: Iterable<T>): boolean; | ||
/** | ||
@@ -74,2 +74,2 @@ * Get the intersection of 2 `Set`s. | ||
*/ | ||
export declare function difference<A, B>(a: Iterable<A>, b: Iterable<A | B>): Set<A>; | ||
export declare function difference<T>(a: Iterable<T>, b: Iterable<T>): Set<T>; |
/** | ||
* Helper to record the amount of time elapsed between two points during execution. | ||
* Helper to record the amount of time elapsed between 2 points during execution. | ||
* | ||
@@ -4,0 +4,0 @@ * @example |
@@ -76,1 +76,21 @@ /** | ||
export declare function lines(string: string): string[]; | ||
/** | ||
* Check if 2 strings are anagrams of each other. | ||
* Case-sensitive. | ||
* | ||
* @example | ||
* ```js | ||
* isAnagram('abc', 'cba'); // true | ||
* ``` | ||
* | ||
* @example | ||
* ```js | ||
* isAnagram('abc', 'Cba'); // false | ||
* ``` | ||
* | ||
* @param a - First string to compare | ||
* @param b - Second string to compare | ||
* | ||
* @returns Whether the strings are anagrams of each other | ||
*/ | ||
export declare function isAnagram(a: string, b: string): boolean; |
@@ -29,4 +29,4 @@ /** | ||
/** | ||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort MDN docs on this function | ||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort | MDN docs on this function} | ||
*/ | ||
export declare type CompareFn<T = Comparable> = Exclude<Parameters<Array<T>['sort']>[0], undefined>; |
@@ -1,2 +0,2 @@ | ||
"use strict";function t(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function e(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=e.apply(r,n);function u(e){t(a,o,i,u,s,"next",e)}function s(e){t(a,o,i,u,s,"throw",e)}u(void 0)}))}}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function n(t){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function a(t,e,r){return(a=i()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&o(i,r.prototype),i}).apply(null,arguments)}function u(t){var e="function"==typeof Map?new Map:void 0;return(u=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,n(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)})(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return s(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)}function p(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}Object.defineProperty(exports,"__esModule",{value:!0});var f,l,d,h=(function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new w(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===p)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var p={};function f(){}function l(){}function d(){}var h={};h[o]=function(){return this};var v=Object.getPrototypeOf,x=v&&v(v(R([])));x&&x!==e&&r.call(x,o)&&(h=x);var y=d.prototype=f.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var s=c(t[o],t,i);if("throw"!==s.type){var p=s.arg,f=p.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){p.value=t,a(p)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function k(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function R(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return l.prototype=y.constructor=d,d.constructor=l,l.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},m(g.prototype),g.prototype[i]=function(){return this},t.AsyncIterator=g,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new g(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(y),u(y,a,"Generator"),y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=R,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:R(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(d={exports:{}}),d.exports),v=h.mark(k),x=h.mark(S),y=h.mark(b),m=h.mark(w),g=h.mark(R);function k(){var t,e,r,n,o,i=arguments;return h.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:for(t=i.length,e=new Array(t),r=0;r<t;r++)e[r]=i[r];n=0,o=e;case 2:if(!(n<o.length)){a.next=8;break}return a.delegateYield(o[n],"t0",5);case 5:n++,a.next=2;break;case 8:case"end":return a.stop()}}),v)}function S(t,e){var r,n,o;return h.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:r=c(t);case 1:if((n=r()).done){i.next=11;break}if(o=n.value,!e--){i.next=8;break}return i.next=6,o;case 6:i.next=9;break;case 8:return i.abrupt("break",11);case 9:i.next=1;break;case 11:case"end":return i.stop()}}),x)}function b(t,e){var r;return h.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=0;case 1:if(!(r<e)){n.next=6;break}return n.delegateYield(t,"t0",3);case 3:r++,n.next=1;break;case 6:case"end":return n.stop()}}),y)}function w(t,e){var r;return h.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=0;case 1:if(!(r<e)){n.next=7;break}return n.next=4,t;case 4:r++,n.next=1;break;case 7:case"end":return n.stop()}}),m)}function R(t,e){var r;return h.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=0;case 1:if(!(r<e)){n.next=7;break}return n.next=4,t(r);case 4:r++,n.next=1;break;case 7:case"end":return n.stop()}}),g)}function T(t,e){var r=void 0;if("size"in t?r="size":"length"in t&&(r="length"),!r)throw new RangeError;return t[r]<e[r]?[e,t]:[t,e]}function E(t,e){return Array.from({length:e},(function(e,r){return t(r)}))}(f=exports.Rank||(exports.Rank={}))[f.Ace=1]="Ace",f[f.Two=2]="Two",f[f.Three=3]="Three",f[f.Four=4]="Four",f[f.Five=5]="Five",f[f.Six=6]="Six",f[f.Seven=7]="Seven",f[f.Eight=8]="Eight",f[f.Nine=9]="Nine",f[f.Ten=10]="Ten",f[f.Jack=11]="Jack",f[f.Queen=12]="Queen",f[f.King=13]="King",(l=exports.Suit||(exports.Suit={}))[l.Clubs=0]="Clubs",l[l.Diamonds=1]="Diamonds",l[l.Hearts=2]="Hearts",l[l.Spades=3]="Spades";var O,N,P=[{rank:exports.Rank.Ace,suit:exports.Suit.Clubs},{rank:exports.Rank.Two,suit:exports.Suit.Clubs},{rank:exports.Rank.Three,suit:exports.Suit.Clubs},{rank:exports.Rank.Four,suit:exports.Suit.Clubs},{rank:exports.Rank.Five,suit:exports.Suit.Clubs},{rank:exports.Rank.Six,suit:exports.Suit.Clubs},{rank:exports.Rank.Seven,suit:exports.Suit.Clubs},{rank:exports.Rank.Eight,suit:exports.Suit.Clubs},{rank:exports.Rank.Nine,suit:exports.Suit.Clubs},{rank:exports.Rank.Ten,suit:exports.Suit.Clubs},{rank:exports.Rank.Jack,suit:exports.Suit.Clubs},{rank:exports.Rank.Queen,suit:exports.Suit.Clubs},{rank:exports.Rank.King,suit:exports.Suit.Clubs},{rank:exports.Rank.Ace,suit:exports.Suit.Diamonds},{rank:exports.Rank.Two,suit:exports.Suit.Diamonds},{rank:exports.Rank.Three,suit:exports.Suit.Diamonds},{rank:exports.Rank.Four,suit:exports.Suit.Diamonds},{rank:exports.Rank.Five,suit:exports.Suit.Diamonds},{rank:exports.Rank.Six,suit:exports.Suit.Diamonds},{rank:exports.Rank.Seven,suit:exports.Suit.Diamonds},{rank:exports.Rank.Eight,suit:exports.Suit.Diamonds},{rank:exports.Rank.Nine,suit:exports.Suit.Diamonds},{rank:exports.Rank.Ten,suit:exports.Suit.Diamonds},{rank:exports.Rank.Jack,suit:exports.Suit.Diamonds},{rank:exports.Rank.Queen,suit:exports.Suit.Diamonds},{rank:exports.Rank.King,suit:exports.Suit.Diamonds},{rank:exports.Rank.Ace,suit:exports.Suit.Hearts},{rank:exports.Rank.Two,suit:exports.Suit.Hearts},{rank:exports.Rank.Three,suit:exports.Suit.Hearts},{rank:exports.Rank.Four,suit:exports.Suit.Hearts},{rank:exports.Rank.Five,suit:exports.Suit.Hearts},{rank:exports.Rank.Six,suit:exports.Suit.Hearts},{rank:exports.Rank.Seven,suit:exports.Suit.Hearts},{rank:exports.Rank.Eight,suit:exports.Suit.Hearts},{rank:exports.Rank.Nine,suit:exports.Suit.Hearts},{rank:exports.Rank.Ten,suit:exports.Suit.Hearts},{rank:exports.Rank.Jack,suit:exports.Suit.Hearts},{rank:exports.Rank.Queen,suit:exports.Suit.Hearts},{rank:exports.Rank.King,suit:exports.Suit.Hearts},{rank:exports.Rank.Ace,suit:exports.Suit.Spades},{rank:exports.Rank.Two,suit:exports.Suit.Spades},{rank:exports.Rank.Three,suit:exports.Suit.Spades},{rank:exports.Rank.Four,suit:exports.Suit.Spades},{rank:exports.Rank.Five,suit:exports.Suit.Spades},{rank:exports.Rank.Six,suit:exports.Suit.Spades},{rank:exports.Rank.Seven,suit:exports.Suit.Spades},{rank:exports.Rank.Eight,suit:exports.Suit.Spades},{rank:exports.Rank.Nine,suit:exports.Suit.Spades},{rank:exports.Rank.Ten,suit:exports.Suit.Spades},{rank:exports.Rank.Jack,suit:exports.Suit.Spades},{rank:exports.Rank.Queen,suit:exports.Suit.Spades},{rank:exports.Rank.King,suit:exports.Suit.Spades}],A=function(t){var e,r;function n(e,r){var n;return(n=t.call(this,r)||this).defaultValueOrDefaultValueFn=e,n.defaultValueIsFunction="function"==typeof n.defaultValueOrDefaultValueFn,n}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,n.prototype.get=function(e){return this.has(e)?t.prototype.get.call(this,e):this.defaultValueIsFunction?this.defaultValueOrDefaultValueFn(e):this.defaultValueOrDefaultValueFn},n}(u(Map));function L(t){for(var e,r=t[0].map((function(t){return t.length})),n=c(t);!(e=n()).done;)for(var o=e.value,i=0;i<o.length;i++){var a=o[i].length;r[i]<a&&(r[i]=a)}return r}!function(t){t[t.Continue=100]="Continue",t[t.SwitchingProtocols=101]="SwitchingProtocols",t[t.EarlyHints=103]="EarlyHints",t[t.Ok=200]="Ok",t[t.Created=201]="Created",t[t.Accepted=202]="Accepted",t[t.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",t[t.NoContent=204]="NoContent",t[t.ResetContent=205]="ResetContent",t[t.PartialContent=206]="PartialContent",t[t.MultipleChoices=300]="MultipleChoices",t[t.MovedPermanently=301]="MovedPermanently",t[t.Found=302]="Found",t[t.SeeOther=303]="SeeOther",t[t.NotModified=304]="NotModified",t[t.TemporaryRedirect=307]="TemporaryRedirect",t[t.PermanentRedirect=308]="PermanentRedirect",t[t.BadRequest=400]="BadRequest",t[t.Unauthorized=401]="Unauthorized",t[t.PaymentRequired=402]="PaymentRequired",t[t.Forbidden=403]="Forbidden",t[t.NotFound=404]="NotFound",t[t.MethodNotAllowed=405]="MethodNotAllowed",t[t.NotAcceptable=406]="NotAcceptable",t[t.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",t[t.RequestTimeout=408]="RequestTimeout",t[t.Conflict=409]="Conflict",t[t.Gone=410]="Gone",t[t.LengthRequired=411]="LengthRequired",t[t.PreconditionFailed=412]="PreconditionFailed",t[t.PayloadTooLarge=413]="PayloadTooLarge",t[t.UriTooLong=414]="UriTooLong",t[t.UnsupportedMediaType=415]="UnsupportedMediaType",t[t.RangeNotSatisfiable=416]="RangeNotSatisfiable",t[t.ExpectationFailed=417]="ExpectationFailed",t[t.ImATeapot=418]="ImATeapot",t[t.UnprocessableEntity=422]="UnprocessableEntity",t[t.TooEarly=425]="TooEarly",t[t.UpgradeRequired=426]="UpgradeRequired",t[t.PreconditionRequired=428]="PreconditionRequired",t[t.TooManyRequests=429]="TooManyRequests",t[t.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",t[t.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",t[t.InternalServerError=500]="InternalServerError",t[t.NotImplemented=501]="NotImplemented",t[t.BadGateway=502]="BadGateway",t[t.ServiceUnavailable=503]="ServiceUnavailable",t[t.GatewayTimeout=504]="GatewayTimeout",t[t.HttpVersionNotSupported=505]="HttpVersionNotSupported",t[t.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",t[t.InsufficientStorage=507]="InsufficientStorage",t[t.LoopDetected=508]="LoopDetected",t[t.NotExtended=510]="NotExtended",t[t.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired"}(O||(O={})),function(t){t.Get="GET",t.Head="HEAD",t.Post="POST",t.Put="PUT",t.Delete="DELETE",t.Connect="CONNECT",t.Options="OPTIONS",t.Trace="TRACE",t.Patch="PATCH"}(N||(N={}));var M={__proto__:null,get Status(){return O},get Method(){return N}};function F(t,e){return t+e}function _(t){var e=j(t);return t.map((function(t){return Math.pow(t-e,2)})).reduce(F)/(t.length-1)}function C(t,e,r){return 1/(e*Math.sqrt(2*Math.PI))*Math.pow(Math.E,-.5*Math.pow(t-r/e,2))}function j(t){var e=t.reduce(F);return e/("bigint"==typeof e?BigInt(t.length):t.length)}function D(t,e){return Math.random()*(e-t)+t}function H(){return(H=e(h.mark((function t(e){return h.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e;case 3:return t.t0=t.sent,t.t1=void 0,t.abrupt("return",[t.t0,t.t1]);case 8:return t.prev=8,t.t2=t.catch(0),t.abrupt("return",[void 0,t.t2]);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))).apply(this,arguments)}var I=function(){function t(t,e){if(this.lower=t,this.upper=e,t>e)throw new RangeError("lower must be less than upper")}t.from=function(e){return new t(e[0],e[1])};var e=t.prototype;return e.has=function(t){return t>=this.lower&&t<=this.upper},e[Symbol.iterator]=h.mark((function t(){return h.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.lower;case 2:return t.next=4,this.upper;case 4:case"end":return t.stop()}}),t,this)})),t}();function q(t,e){return t<e?-1:t>e?1:0}function U(t,e){return t<e?1:t>e?-1:0}var G={__proto__:null,ascending:function(t,e){return void 0===e&&"function"==typeof t?function(e,r){return q(t(e),t(r))}:q(t,e)},descending:function(t,e){return void 0===e&&"function"==typeof t?function(e,r){return U(t(e),t(r))}:U(t,e)}},V=function(){function t(){}t.start=function(){var t=new this;return t.start(),t};var e,r=t.prototype;return r.start=function(){this.startTime=process.hrtime.bigint()},r.end=function(){return Number(process.hrtime.bigint()-this.startTime)/1e6},(e=[{key:"started",get:function(){return void 0!==this.startTime}}])&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,e),t}();exports.Bitwise={__proto__:null,and:function(t,e){return t&e},or:function(t,e){return t|e},xor:function(t,e){return t^e}},exports.DefaultMap=A,exports.Http=M,exports.Range=I,exports.Sort=G,exports.Stopwatch=V,exports.allDuplicates=function(t){for(var e,r=new Set,n=[],o=c(t);!(e=o()).done;){var i=e.value;r.has(i)?n.push(i):r.add(i)}return n},exports.binarySearch=function(t,e){for(var r=0,n=t.length-1;r<=n;){var o=Math.trunc((r+n)/2),i=e(t[o]);if(i<0)r=o+1;else{if(!(i>0))return t[o];n=o-1}}},exports.capitalize=function(t){var e=t.charAt(0).toUpperCase();return""+e+t.slice(e.length)},exports.chunk=function(t,e){return t.length===e?t.map((function(t){return[t]})):E((function(r){return t.slice(r*e,r*e+e)}),Math.ceil(t.length/e))},exports.clamp=function(t,e,r){return t<e?e:t>r?r:t},exports.combineIterables=k,exports.count=function(t,e){for(var r,n=0,o=c(t);!(r=o()).done;)r.value===e&&n++;return n},exports.cycle=b,exports.difference=function(t,e){for(var r,n=new Set(t),o=c(e);!(r=o()).done;)n.delete(r.value);return n},exports.duplicates=function(t){for(var e,r=new Set,n=new Set,o=c(t);!(e=o()).done;){var i=e.value;r.has(i)?n.add(i):r.add(i)}return n},exports.every=function(t,e){for(var r,n=c(t);!(r=n()).done;)if(!e(r.value))return!1;return!0},exports.fill=function(t,e){return Array.from({length:e},(function(){return t}))},exports.find=function(t,e){for(var r,n=c(t);!(r=n()).done;){var o=r.value;if(e(o))return o}},exports.first=function(t,e){if(void 0!==e)return S(t,e);for(var r,n=c(t);!(r=n()).done;)return r.value},exports.formatTable=function(t,e){void 0===e&&(e=" ");var r=L(t);return t.map((function(t){return t.map((function(t,e){return t.padEnd(r[e])})).join(e)})).join("\n")},exports.frequencyTable=function(t){for(var e,r=new Map,n=c(t);!(e=n()).done;){var o=e.value,i=r.get(o);r.set(o,(null!=i?i:0)+1)}return r},exports.holes=function(t){for(var e=[],r=0;r<t.length;r++)r in t||e.push(r);return e},exports.identical=function(t,e){if(Array.isArray(t)&&Array.isArray(e))return function(t,e){return t===e||t.length===e.length&&t.every((function(t,r){return t===e[r]}))}(t,e);if(t instanceof Set&&e instanceof Set)return function(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(var r,n=c(t);!(r=n()).done;)if(!e.has(r.value))return!1;return!0}(t,e);if(t instanceof Map&&e instanceof Map)return function(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(var r,n=c(t.entries());!(r=n()).done;){var o=r.value,i=o[0],a=o[1];if(!e.has(i)||e.get(i)!==a)return!1}return!0}(t,e);throw new RangeError("Expected both parameters to be an array, Set, or Map")},exports.includes=function(t,e){for(var r,n=c(t);!(r=n()).done;)if(r.value===e)return!0;return!1},exports.intersection=function(t,e){for(var r,n=new Set,o=T(t,e),i=o[1],a=c(o[0]);!(r=a()).done;){var u=r.value;i.has(u)&&n.add(u)}return n},exports.invert=function(t){return function(){return-t.apply(void 0,arguments)}},exports.isDisjoint=function(t,e){for(var r,n=t instanceof Set?t:new Set(t),o=c(e);!(r=o()).done;)if(n.has(r.value))return!1;return!0},exports.isSubset=function(t,e){for(var r,n=c(t);!(r=n()).done;)if(!e.has(r.value))return!1;return!0},exports.isSuperset=function(t,e){for(var r,n=c(e);!(r=n()).done;)if(!t.has(r.value))return!1;return!0},exports.join=function(t,e){void 0===e&&(e=",");for(var r="",n=t[Symbol.iterator](),o=n.next();;){var i=o;if(o=n.next(),r+=i.value,o.done)return r;r+=e}},exports.largeToSmall=T,exports.lines=function(t){return t.split("\n").map((function(t){return t.trim()})).filter((function(t){return t.length>0}))},exports.mapFill=E,exports.mapRepeat=R,exports.max=function(t,e){return e>t?e:t},exports.maxColumnLength=L,exports.mean=j,exports.median=function(t){var e=t.length/2;return t.length%2==0?(t[e-1]+t[e])/("bigint"==typeof t[0]?2n:2):t[Math.floor(e)]},exports.min=function(t,e){return e<t?e:t},exports.mode=function(t){for(var e,r=new Map,n=0,o=[],i=c(t);!(e=i()).done;){var a=e.value,u=r.get(a),s=void 0===u?1:u+1;r.set(a,s),s>n?(n=s,o=[a]):s===n&&o.push(a)}return o},exports.multiReplace=function(t,e){for(var r=Object.entries(e),n="",o=0;o<t.length;)t:do{for(var i,a=c(r);!(i=a()).done;){var u=i.value,s=u[0],p=u[1];if(t.slice(o).startsWith(s)){n+=p,o+=s.length;break t}}n+=t[o++]}while(0);return n},exports.newDeck=function(){return[].concat(P)},exports.normaldist=C,exports.not=function(t){return function(){return!t.apply(void 0,arguments)}},exports.nullish=function(t){return null==t},exports.padEnd=function(t,e,r){t.push.apply(t,w(r,e-t.length))},exports.padStart=function(t,e,r){t.unshift.apply(t,w(r,e-t.length))},exports.partition=function(t,e){for(var r,n=[],o=[],i=0,a=c(t);!(r=a()).done;){var u=r.value;(e(u,i++)?n:o).push(u)}return[n,o]},exports.product=function(t,e){return t*e},exports.pull=function(t,e){var r=t.indexOf(e);return-1===r?[]:t.splice(r,1)},exports.random=D,exports.randomInt=function(t,e){return Math.floor(D(Math.ceil(t),Math.floor(e)))},exports.regExpUnion=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return new RegExp(e.map((function(t){return"("+t.source+")"})).join("|"))},exports.rename=function(t,e,n){var o;return e===n?r({},t):function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e.indexOf(r=i[n])>=0||(o[r]=t[r]);return o}(r({},t,((o={})[n]=t[e],o)),[e].map(p))},exports.repeat=w,exports.same=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=e.map((function(t){return t[Symbol.iterator]()})),o=function(){for(var t,e=n.map((function(t){return t.next()})),r=e[0],o=r.done,i=r.value,a=c(e);!(t=a()).done;){var u=t.value;if(u.done)return{v:e.every((function(t){return t.done===o}))};if(u.value!==i)return{v:!1}}};;){var i=o();if("object"==typeof i)return i.v}},exports.sample=function(t){return t[Math.floor(Math.random()*t.length)]},exports.settled=function(t){return H.apply(this,arguments)},exports.shuffle=function(t,e){void 0===e&&(e=!0);for(var r=e?t:[].concat(t),n=r.length-1;n>0;n--){var o=Math.floor(Math.random()*(n+1)),i=[r[o],r[n]];r[n]=i[0],r[o]=i[1]}if(!e)return r},exports.some=function(t,e){for(var r,n=c(t);!(r=n()).done;)if(e(r.value))return!0;return!1},exports.sortObject=function(t,e){return Object.entries(t).sort((function(t,r){return e(t[1],r[1])}))},exports.standardNormaldist=function(t){return C(t,1,0)},exports.stddev=function(t){return Math.sqrt(_(t))},exports.sum=F,exports.symmetricDifference=function(t,e){for(var r,n=new Set(t),o=c(e);!(r=o()).done;){var i=r.value;n.has(i)?n.delete(i):n.add(i)}return n},exports.toDigits=function(t,e){var r=Math.pow(10,e);return Math.round(t*r*(1+Number.EPSILON))/r},exports.truncate=function(t,e,r){return void 0===r&&(r=""),t.length>e?""+t.slice(0,e)+r:t},exports.uncapitalize=function(t){var e=t.charAt(0).toLowerCase();return""+e+t.slice(e.length)},exports.union=function(t,e){return new Set(k(t,e))},exports.variance=_; | ||
"use strict";function t(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function e(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=e.apply(r,n);function u(e){t(a,o,i,u,s,"next",e)}function s(e){t(a,o,i,u,s,"throw",e)}u(void 0)}))}}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function n(t){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function a(t,e,r){return(a=i()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&o(i,r.prototype),i}).apply(null,arguments)}function u(t){var e="function"==typeof Map?new Map:void 0;return(u=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,n(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)})(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return s(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)}function p(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}Object.defineProperty(exports,"__esModule",{value:!0});var f,l,d,h=(function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new w(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===p)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var p={};function f(){}function l(){}function d(){}var h={};h[o]=function(){return this};var v=Object.getPrototypeOf,x=v&&v(v(R([])));x&&x!==e&&r.call(x,o)&&(h=x);var y=d.prototype=f.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function m(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var s=c(t[o],t,i);if("throw"!==s.type){var p=s.arg,f=p.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){p.value=t,a(p)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function k(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function R(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return l.prototype=y.constructor=d,d.constructor=l,l.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(m.prototype),m.prototype[i]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new m(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),u(y,a,"Generator"),y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=R,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:R(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(d={exports:{}}),d.exports),v=h.mark(k),x=h.mark(b),y=h.mark(w),g=h.mark(R),m=h.mark(E);function k(){var t,e,r,n,o,i=arguments;return h.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:for(t=i.length,e=new Array(t),r=0;r<t;r++)e[r]=i[r];n=0,o=e;case 2:if(!(n<o.length)){a.next=8;break}return a.delegateYield(o[n],"t0",5);case 5:n++,a.next=2;break;case 8:case"end":return a.stop()}}),v)}function S(t){for(var e,r=new Map,n=c(t);!(e=n()).done;){var o,i=e.value,a=(null!=(o=r.get(i))?o:0)+1;r.set(i,a)}return r}function b(t,e){var r,n,o;return h.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:r=c(t);case 1:if((n=r()).done){i.next=11;break}if(o=n.value,!e--){i.next=8;break}return i.next=6,o;case 6:i.next=9;break;case 8:return i.abrupt("break",11);case 9:i.next=1;break;case 11:case"end":return i.stop()}}),x)}function w(t,e){var r;return h.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=0;case 1:if(!(r<e)){n.next=6;break}return n.delegateYield(t,"t0",3);case 3:r++,n.next=1;break;case 6:case"end":return n.stop()}}),y)}function R(t,e){var r;return h.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=0;case 1:if(!(r<e)){n.next=7;break}return n.next=4,t;case 4:r++,n.next=1;break;case 7:case"end":return n.stop()}}),g)}function E(t,e){var r;return h.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=0;case 1:if(!(r<e)){n.next=7;break}return n.next=4,t(r);case 4:r++,n.next=1;break;case 7:case"end":return n.stop()}}),m)}function T(t,e){var r=void 0;if("size"in t?r="size":"length"in t&&(r="length"),!r)throw new RangeError;return t[r]<e[r]?[e,t]:[t,e]}function O(t,e){return Array.from({length:e},(function(e,r){return t(r)}))}(f=exports.Rank||(exports.Rank={}))[f.Ace=1]="Ace",f[f.Two=2]="Two",f[f.Three=3]="Three",f[f.Four=4]="Four",f[f.Five=5]="Five",f[f.Six=6]="Six",f[f.Seven=7]="Seven",f[f.Eight=8]="Eight",f[f.Nine=9]="Nine",f[f.Ten=10]="Ten",f[f.Jack=11]="Jack",f[f.Queen=12]="Queen",f[f.King=13]="King",(l=exports.Suit||(exports.Suit={}))[l.Clubs=0]="Clubs",l[l.Diamonds=1]="Diamonds",l[l.Hearts=2]="Hearts",l[l.Spades=3]="Spades";var _,A,P=[{rank:exports.Rank.Ace,suit:exports.Suit.Clubs},{rank:exports.Rank.Two,suit:exports.Suit.Clubs},{rank:exports.Rank.Three,suit:exports.Suit.Clubs},{rank:exports.Rank.Four,suit:exports.Suit.Clubs},{rank:exports.Rank.Five,suit:exports.Suit.Clubs},{rank:exports.Rank.Six,suit:exports.Suit.Clubs},{rank:exports.Rank.Seven,suit:exports.Suit.Clubs},{rank:exports.Rank.Eight,suit:exports.Suit.Clubs},{rank:exports.Rank.Nine,suit:exports.Suit.Clubs},{rank:exports.Rank.Ten,suit:exports.Suit.Clubs},{rank:exports.Rank.Jack,suit:exports.Suit.Clubs},{rank:exports.Rank.Queen,suit:exports.Suit.Clubs},{rank:exports.Rank.King,suit:exports.Suit.Clubs},{rank:exports.Rank.Ace,suit:exports.Suit.Diamonds},{rank:exports.Rank.Two,suit:exports.Suit.Diamonds},{rank:exports.Rank.Three,suit:exports.Suit.Diamonds},{rank:exports.Rank.Four,suit:exports.Suit.Diamonds},{rank:exports.Rank.Five,suit:exports.Suit.Diamonds},{rank:exports.Rank.Six,suit:exports.Suit.Diamonds},{rank:exports.Rank.Seven,suit:exports.Suit.Diamonds},{rank:exports.Rank.Eight,suit:exports.Suit.Diamonds},{rank:exports.Rank.Nine,suit:exports.Suit.Diamonds},{rank:exports.Rank.Ten,suit:exports.Suit.Diamonds},{rank:exports.Rank.Jack,suit:exports.Suit.Diamonds},{rank:exports.Rank.Queen,suit:exports.Suit.Diamonds},{rank:exports.Rank.King,suit:exports.Suit.Diamonds},{rank:exports.Rank.Ace,suit:exports.Suit.Hearts},{rank:exports.Rank.Two,suit:exports.Suit.Hearts},{rank:exports.Rank.Three,suit:exports.Suit.Hearts},{rank:exports.Rank.Four,suit:exports.Suit.Hearts},{rank:exports.Rank.Five,suit:exports.Suit.Hearts},{rank:exports.Rank.Six,suit:exports.Suit.Hearts},{rank:exports.Rank.Seven,suit:exports.Suit.Hearts},{rank:exports.Rank.Eight,suit:exports.Suit.Hearts},{rank:exports.Rank.Nine,suit:exports.Suit.Hearts},{rank:exports.Rank.Ten,suit:exports.Suit.Hearts},{rank:exports.Rank.Jack,suit:exports.Suit.Hearts},{rank:exports.Rank.Queen,suit:exports.Suit.Hearts},{rank:exports.Rank.King,suit:exports.Suit.Hearts},{rank:exports.Rank.Ace,suit:exports.Suit.Spades},{rank:exports.Rank.Two,suit:exports.Suit.Spades},{rank:exports.Rank.Three,suit:exports.Suit.Spades},{rank:exports.Rank.Four,suit:exports.Suit.Spades},{rank:exports.Rank.Five,suit:exports.Suit.Spades},{rank:exports.Rank.Six,suit:exports.Suit.Spades},{rank:exports.Rank.Seven,suit:exports.Suit.Spades},{rank:exports.Rank.Eight,suit:exports.Suit.Spades},{rank:exports.Rank.Nine,suit:exports.Suit.Spades},{rank:exports.Rank.Ten,suit:exports.Suit.Spades},{rank:exports.Rank.Jack,suit:exports.Suit.Spades},{rank:exports.Rank.Queen,suit:exports.Suit.Spades},{rank:exports.Rank.King,suit:exports.Suit.Spades}],N=function(t){var e,r;function n(e,r){var n;return(n=t.call(this,r)||this).defaultValueOrDefaultValueFn=e,n.defaultValueIsFunction="function"==typeof n.defaultValueOrDefaultValueFn,n}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,n.prototype.get=function(e){return this.has(e)?t.prototype.get.call(this,e):this.defaultValueIsFunction?this.defaultValueOrDefaultValueFn(e):this.defaultValueOrDefaultValueFn},n}(u(Map));function L(t){for(var e,r=t[0].map((function(t){return t.length})),n=c(t);!(e=n()).done;)for(var o=e.value,i=0;i<o.length;i++){var a=o[i].length;r[i]<a&&(r[i]=a)}return r}!function(t){t[t.Continue=100]="Continue",t[t.SwitchingProtocols=101]="SwitchingProtocols",t[t.EarlyHints=103]="EarlyHints",t[t.Ok=200]="Ok",t[t.Created=201]="Created",t[t.Accepted=202]="Accepted",t[t.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",t[t.NoContent=204]="NoContent",t[t.ResetContent=205]="ResetContent",t[t.PartialContent=206]="PartialContent",t[t.MultipleChoices=300]="MultipleChoices",t[t.MovedPermanently=301]="MovedPermanently",t[t.Found=302]="Found",t[t.SeeOther=303]="SeeOther",t[t.NotModified=304]="NotModified",t[t.TemporaryRedirect=307]="TemporaryRedirect",t[t.PermanentRedirect=308]="PermanentRedirect",t[t.BadRequest=400]="BadRequest",t[t.Unauthorized=401]="Unauthorized",t[t.PaymentRequired=402]="PaymentRequired",t[t.Forbidden=403]="Forbidden",t[t.NotFound=404]="NotFound",t[t.MethodNotAllowed=405]="MethodNotAllowed",t[t.NotAcceptable=406]="NotAcceptable",t[t.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",t[t.RequestTimeout=408]="RequestTimeout",t[t.Conflict=409]="Conflict",t[t.Gone=410]="Gone",t[t.LengthRequired=411]="LengthRequired",t[t.PreconditionFailed=412]="PreconditionFailed",t[t.PayloadTooLarge=413]="PayloadTooLarge",t[t.UriTooLong=414]="UriTooLong",t[t.UnsupportedMediaType=415]="UnsupportedMediaType",t[t.RangeNotSatisfiable=416]="RangeNotSatisfiable",t[t.ExpectationFailed=417]="ExpectationFailed",t[t.ImATeapot=418]="ImATeapot",t[t.UnprocessableEntity=422]="UnprocessableEntity",t[t.TooEarly=425]="TooEarly",t[t.UpgradeRequired=426]="UpgradeRequired",t[t.PreconditionRequired=428]="PreconditionRequired",t[t.TooManyRequests=429]="TooManyRequests",t[t.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",t[t.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",t[t.InternalServerError=500]="InternalServerError",t[t.NotImplemented=501]="NotImplemented",t[t.BadGateway=502]="BadGateway",t[t.ServiceUnavailable=503]="ServiceUnavailable",t[t.GatewayTimeout=504]="GatewayTimeout",t[t.HttpVersionNotSupported=505]="HttpVersionNotSupported",t[t.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",t[t.InsufficientStorage=507]="InsufficientStorage",t[t.LoopDetected=508]="LoopDetected",t[t.NotExtended=510]="NotExtended",t[t.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired"}(_||(_={})),function(t){t.Get="GET",t.Head="HEAD",t.Post="POST",t.Put="PUT",t.Delete="DELETE",t.Connect="CONNECT",t.Options="OPTIONS",t.Trace="TRACE",t.Patch="PATCH"}(A||(A={}));var M=function(){function t(t,e){if(this.lower=t,this.upper=e,t>e)throw new RangeError("lower must be less than upper")}t.from=function(e){return new t(e[0],e[1])};var e=t.prototype;return e.has=function(t){return t>=this.lower&&t<=this.upper},e[Symbol.iterator]=h.mark((function t(){return h.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.lower;case 2:return t.next=4,this.upper;case 4:case"end":return t.stop()}}),t,this)})),t}(),j={__proto__:null,StatusRange:{__proto__:null,informational:Object.freeze(new M(100,200)),success:Object.freeze(new M(200,300)),redirects:Object.freeze(new M(300,400)),clientErrors:Object.freeze(new M(400,500)),serverErrors:Object.freeze(new M(500,600))},get Status(){return _},get Method(){return A}};function F(t,e){if(Array.isArray(t)&&Array.isArray(e))return function(t,e){return t===e||t.length===e.length&&t.every((function(t,r){return t===e[r]}))}(t,e);if(t instanceof Set&&e instanceof Set)return function(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(var r,n=c(t);!(r=n()).done;)if(!e.has(r.value))return!1;return!0}(t,e);if(t instanceof Map&&e instanceof Map)return function(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(var r,n=c(t.entries());!(r=n()).done;){var o=r.value,i=o[0],a=o[1];if(!e.has(i)||e.get(i)!==a)return!1}return!0}(t,e);throw new RangeError("Expected both parameters to be an array, Set, or Map")}function C(t,e){return t+e}function D(t){var e=I(t);return t.map((function(t){return Math.pow(t-e,2)})).reduce(C)/(t.length-1)}function H(t,e,r){return 1/(e*Math.sqrt(2*Math.PI))*Math.pow(Math.E,-.5*Math.pow(t-r/e,2))}function I(t){var e=t.reduce(C);return e/("bigint"==typeof e?BigInt(t.length):t.length)}function q(t,e){return Math.random()*(e-t)+t}var U=function(){function t(){this._count=0}var e=t.prototype;return e.percentage=function(){var t,e=this;return this._count++,(t={})[Symbol.toPrimitive]=function(){return 1/e._count},t},e.count=function(){var t,e=this;return this._count++,(t={})[Symbol.toPrimitive]=function(){return e._count},t},t}();function G(){return(G=e(h.mark((function t(e){return h.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e;case 3:return t.t0=t.sent,t.t1=void 0,t.abrupt("return",[t.t0,t.t1]);case 8:return t.prev=8,t.t2=t.catch(0),t.abrupt("return",[void 0,t.t2]);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))).apply(this,arguments)}function z(t,e){return t<e?-1:t>e?1:0}function V(t,e){return t<e?1:t>e?-1:0}var B={__proto__:null,ascending:function(t,e){return void 0===e&&"function"==typeof t?function(e,r){return z(t(e),t(r))}:z(t,e)},descending:function(t,e){return void 0===e&&"function"==typeof t?function(e,r){return V(t(e),t(r))}:V(t,e)}},J=function(){function t(){}t.start=function(){var t=new this;return t.start(),t};var e,r=t.prototype;return r.start=function(){this.startTime=process.hrtime.bigint()},r.end=function(){return Number(process.hrtime.bigint()-this.startTime)/1e6},(e=[{key:"started",get:function(){return void 0!==this.startTime}}])&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,e),t}();exports.AutoPercentage=U,exports.Bitwise={__proto__:null,and:function(t,e){return t&e},or:function(t,e){return t|e},xor:function(t,e){return t^e}},exports.DefaultMap=N,exports.Http=j,exports.Range=M,exports.Sort=B,exports.Stopwatch=J,exports.allDuplicates=function(t){for(var e,r=new Set,n=[],o=c(t);!(e=o()).done;){var i=e.value;r.has(i)?n.push(i):r.add(i)}return n},exports.binarySearch=function(t,e){for(var r=0,n=t.length-1;r<=n;){var o=Math.trunc((r+n)/2),i=e(t[o]);if(i<0)r=o+1;else{if(!(i>0))return t[o];n=o-1}}},exports.capitalize=function(t){var e=t.charAt(0).toUpperCase();return""+e+t.slice(e.length)},exports.chunk=function(t,e){return t.length===e?t.map((function(t){return[t]})):O((function(r){return t.slice(r*e,r*e+e)}),Math.ceil(t.length/e))},exports.clamp=function(t,e,r){return t<e?e:t>r?r:t},exports.combineIterables=k,exports.count=function(t,e){for(var r,n=0,o=c(t);!(r=o()).done;)r.value===e&&n++;return n},exports.cycle=w,exports.difference=function(t,e){for(var r,n=new Set(t),o=c(e);!(r=o()).done;)n.delete(r.value);return n},exports.duplicates=function(t){for(var e,r=new Set,n=new Set,o=c(t);!(e=o()).done;){var i=e.value;r.has(i)?n.add(i):r.add(i)}return n},exports.every=function(t,e){for(var r,n=c(t);!(r=n()).done;)if(!e(r.value))return!1;return!0},exports.fill=function(t,e){return Array.from({length:e},(function(){return t}))},exports.find=function(t,e){for(var r,n=c(t);!(r=n()).done;){var o=r.value;if(e(o))return o}},exports.first=function(t,e){if(void 0!==e)return b(t,e);for(var r,n=c(t);!(r=n()).done;)return r.value},exports.formatTable=function(t,e){void 0===e&&(e=" ");var r=L(t);return t.map((function(t){return t.map((function(t,e){return t.padEnd(r[e])})).join(e)})).join("\n")},exports.frequencyTable=S,exports.holes=function(t){for(var e=[],r=0;r<t.length;r++)r in t||e.push(r);return e},exports.identical=F,exports.includes=function(t,e){for(var r,n=c(t);!(r=n()).done;)if(r.value===e)return!0;return!1},exports.indexOfAll=function(t,e){for(var r=[],n=0;n<t.length;n++)t[n]===e&&r.push(n);return r},exports.intersection=function(t,e){for(var r,n=new Set,o=T(t,e),i=o[1],a=c(o[0]);!(r=a()).done;){var u=r.value;i.has(u)&&n.add(u)}return n},exports.invert=function(t){return function(){return-t.apply(void 0,arguments)}},exports.isAnagram=function(t,e){return t===e||t.length===e.length&&F(S(t),S(e))},exports.isDisjoint=function(t,e){for(var r,n=t instanceof Set?t:new Set(t),o=c(e);!(r=o()).done;)if(n.has(r.value))return!1;return!0},exports.isSubset=function(t,e){for(var r,n=c(t);!(r=n()).done;)if(!e.has(r.value))return!1;return!0},exports.isSuperset=function(t,e){for(var r,n=c(e);!(r=n()).done;)if(!t.has(r.value))return!1;return!0},exports.join=function(t,e){void 0===e&&(e=",");for(var r="",n=t[Symbol.iterator](),o=n.next();;){var i=o;if(o=n.next(),r+=i.value,o.done)return r;r+=e}},exports.largeToSmall=T,exports.lines=function(t){return t.split("\n").map((function(t){return t.trim()})).filter((function(t){return t.length>0}))},exports.mapFill=O,exports.mapRepeat=E,exports.max=function(t,e){return e>t?e:t},exports.maxColumnLength=L,exports.mean=I,exports.median=function(t){var e=t.length/2;return t.length%2==0?(t[e-1]+t[e])/("bigint"==typeof t[0]?2n:2):t[Math.floor(e)]},exports.min=function(t,e){return e<t?e:t},exports.mode=function(t){for(var e,r=new Map,n=0,o=[],i=c(t);!(e=i()).done;){var a=e.value,u=r.get(a),s=void 0===u?1:u+1;r.set(a,s),s>n?(n=s,o=[a]):s===n&&o.push(a)}return o},exports.multiReplace=function(t,e){for(var r=Object.entries(e),n="",o=0;o<t.length;)t:do{for(var i,a=c(r);!(i=a()).done;){var u=i.value,s=u[0],p=u[1];if(t.slice(o).startsWith(s)){n+=p,o+=s.length;break t}}n+=t[o++]}while(0);return n},exports.newDeck=function(){return[].concat(P)},exports.normaldist=H,exports.not=function(t){return function(){return!t.apply(void 0,arguments)}},exports.nullish=function(t){return null==t},exports.padEnd=function(t,e,r){t.push.apply(t,R(r,e-t.length))},exports.padStart=function(t,e,r){t.unshift.apply(t,R(r,e-t.length))},exports.partition=function(t,e){for(var r,n=[],o=[],i=0,a=c(t);!(r=a()).done;){var u=r.value;(e(u,i++)?n:o).push(u)}return[n,o]},exports.product=function(t,e){return t*e},exports.pull=function(t,e){var r=t.indexOf(e);return-1===r?[]:t.splice(r,1)},exports.random=q,exports.randomInt=function(t,e){return Math.floor(q(Math.ceil(t),Math.floor(e)))},exports.regExpUnion=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return new RegExp(e.map((function(t){return"("+t.source+")"})).join("|"))},exports.rename=function(t,e,n){var o;return e===n?r({},t):function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e.indexOf(r=i[n])>=0||(o[r]=t[r]);return o}(r({},t,((o={})[n]=t[e],o)),[e].map(p))},exports.repeat=R,exports.replace=function(t,e,r){var n=t.indexOf(e);return-1!==n&&(t[n]=r),n},exports.replaceAll=function(t,e,r){for(var n=0,o=0;o<t.length;o++)t[o]===e&&(t[o]=r,n++);return n},exports.same=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=e.map((function(t){return t[Symbol.iterator]()})),o=function(){for(var t,e=n.map((function(t){return t.next()})),r=e[0],o=r.done,i=r.value,a=c(e);!(t=a()).done;){var u=t.value;if(u.done)return{v:e.every((function(t){return t.done===o}))};if(u.value!==i)return{v:!1}}};;){var i=o();if("object"==typeof i)return i.v}},exports.sample=function(t){return t[Math.floor(Math.random()*t.length)]},exports.settled=function(t){return G.apply(this,arguments)},exports.shuffle=function(t,e){void 0===e&&(e=!0);for(var r=e?t:[].concat(t),n=r.length-1;n>0;n--){var o=Math.floor(Math.random()*(n+1)),i=[r[o],r[n]];r[n]=i[0],r[o]=i[1]}if(!e)return r},exports.some=function(t,e){for(var r,n=c(t);!(r=n()).done;)if(e(r.value))return!0;return!1},exports.sortObject=function(t,e){return Object.entries(t).sort((function(t,r){return e(t[1],r[1])}))},exports.standardNormaldist=function(t){return H(t,1,0)},exports.stddev=function(t){return Math.sqrt(D(t))},exports.sum=C,exports.symmetricDifference=function(t,e){for(var r,n=new Set(t),o=c(e);!(r=o()).done;){var i=r.value;n.has(i)?n.delete(i):n.add(i)}return n},exports.toDigits=function(t,e){var r=Math.pow(10,e);return Math.round(t*r*(1+Number.EPSILON))/r},exports.truncate=function(t,e,r){return void 0===r&&(r=""),t.length>e?""+t.slice(0,e)+r:t},exports.uncapitalize=function(t){var e=t.charAt(0).toLowerCase();return""+e+t.slice(e.length)},exports.union=function(t,e){return new Set(k(t,e))},exports.variance=D; | ||
//# sourceMappingURL=util.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self)["@jonahsnider/util"]={})}(this,(function(t){"use strict";function e(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function u(t){e(a,o,i,u,c,"next",t)}function c(t){e(a,o,i,u,c,"throw",t)}u(void 0)}))}}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t,e,n){return(u=a()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&i(o,n.prototype),o}).apply(null,arguments)}function c(t){var e="function"==typeof Map?new Map:void 0;return(c=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,o(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,t)})(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return s(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function l(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var p,d,h=function(t,e){return function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new R(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,i),o}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function d(){}var h={};h[o]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(x([])));y&&y!==e&&n.call(y,o)&&(h=y);var m=d.prototype=l.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){var r;this._invoke=function(o,i){function a(){return new e((function(r,a){!function r(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function S(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,f;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function x(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return p.prototype=m.constructor=d,d.constructor=p,p.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(k.prototype),k.prototype[i]=function(){return this},t.AsyncIterator=k,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new k(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),u(m,a,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;w(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(e={exports:{}}),e.exports}(),v=h.mark(S),y=h.mark(b),m=h.mark(w),g=h.mark(R),k=h.mark(x);function S(){var t,e,n,r,o,i=arguments;return h.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:for(t=i.length,e=new Array(t),n=0;n<t;n++)e[n]=i[n];r=0,o=e;case 2:if(!(r<o.length)){a.next=8;break}return a.delegateYield(o[r],"t0",5);case 5:r++,a.next=2;break;case 8:case"end":return a.stop()}}),v)}function b(t,e){var n,r,o;return h.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:n=f(t);case 1:if((r=n()).done){i.next=11;break}if(o=r.value,!e--){i.next=8;break}return i.next=6,o;case 6:i.next=9;break;case 8:return i.abrupt("break",11);case 9:i.next=1;break;case 11:case"end":return i.stop()}}),y)}function w(t,e){var n;return h.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=0;case 1:if(!(n<e)){r.next=6;break}return r.delegateYield(t,"t0",3);case 3:n++,r.next=1;break;case 6:case"end":return r.stop()}}),m)}function R(t,e){var n;return h.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=0;case 1:if(!(n<e)){r.next=7;break}return r.next=4,t;case 4:n++,r.next=1;break;case 7:case"end":return r.stop()}}),g)}function x(t,e){var n;return h.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=0;case 1:if(!(n<e)){r.next=7;break}return r.next=4,t(n);case 4:n++,r.next=1;break;case 7:case"end":return r.stop()}}),k)}function T(t,e){var n=void 0;if("size"in t?n="size":"length"in t&&(n="length"),!n)throw new RangeError;return t[n]<e[n]?[e,t]:[t,e]}function E(t,e){return Array.from({length:e},(function(e,n){return t(n)}))}(p=t.Rank||(t.Rank={}))[p.Ace=1]="Ace",p[p.Two=2]="Two",p[p.Three=3]="Three",p[p.Four=4]="Four",p[p.Five=5]="Five",p[p.Six=6]="Six",p[p.Seven=7]="Seven",p[p.Eight=8]="Eight",p[p.Nine=9]="Nine",p[p.Ten=10]="Ten",p[p.Jack=11]="Jack",p[p.Queen=12]="Queen",p[p.King=13]="King",(d=t.Suit||(t.Suit={}))[d.Clubs=0]="Clubs",d[d.Diamonds=1]="Diamonds",d[d.Hearts=2]="Hearts",d[d.Spades=3]="Spades";var O,N,P=[{rank:t.Rank.Ace,suit:t.Suit.Clubs},{rank:t.Rank.Two,suit:t.Suit.Clubs},{rank:t.Rank.Three,suit:t.Suit.Clubs},{rank:t.Rank.Four,suit:t.Suit.Clubs},{rank:t.Rank.Five,suit:t.Suit.Clubs},{rank:t.Rank.Six,suit:t.Suit.Clubs},{rank:t.Rank.Seven,suit:t.Suit.Clubs},{rank:t.Rank.Eight,suit:t.Suit.Clubs},{rank:t.Rank.Nine,suit:t.Suit.Clubs},{rank:t.Rank.Ten,suit:t.Suit.Clubs},{rank:t.Rank.Jack,suit:t.Suit.Clubs},{rank:t.Rank.Queen,suit:t.Suit.Clubs},{rank:t.Rank.King,suit:t.Suit.Clubs},{rank:t.Rank.Ace,suit:t.Suit.Diamonds},{rank:t.Rank.Two,suit:t.Suit.Diamonds},{rank:t.Rank.Three,suit:t.Suit.Diamonds},{rank:t.Rank.Four,suit:t.Suit.Diamonds},{rank:t.Rank.Five,suit:t.Suit.Diamonds},{rank:t.Rank.Six,suit:t.Suit.Diamonds},{rank:t.Rank.Seven,suit:t.Suit.Diamonds},{rank:t.Rank.Eight,suit:t.Suit.Diamonds},{rank:t.Rank.Nine,suit:t.Suit.Diamonds},{rank:t.Rank.Ten,suit:t.Suit.Diamonds},{rank:t.Rank.Jack,suit:t.Suit.Diamonds},{rank:t.Rank.Queen,suit:t.Suit.Diamonds},{rank:t.Rank.King,suit:t.Suit.Diamonds},{rank:t.Rank.Ace,suit:t.Suit.Hearts},{rank:t.Rank.Two,suit:t.Suit.Hearts},{rank:t.Rank.Three,suit:t.Suit.Hearts},{rank:t.Rank.Four,suit:t.Suit.Hearts},{rank:t.Rank.Five,suit:t.Suit.Hearts},{rank:t.Rank.Six,suit:t.Suit.Hearts},{rank:t.Rank.Seven,suit:t.Suit.Hearts},{rank:t.Rank.Eight,suit:t.Suit.Hearts},{rank:t.Rank.Nine,suit:t.Suit.Hearts},{rank:t.Rank.Ten,suit:t.Suit.Hearts},{rank:t.Rank.Jack,suit:t.Suit.Hearts},{rank:t.Rank.Queen,suit:t.Suit.Hearts},{rank:t.Rank.King,suit:t.Suit.Hearts},{rank:t.Rank.Ace,suit:t.Suit.Spades},{rank:t.Rank.Two,suit:t.Suit.Spades},{rank:t.Rank.Three,suit:t.Suit.Spades},{rank:t.Rank.Four,suit:t.Suit.Spades},{rank:t.Rank.Five,suit:t.Suit.Spades},{rank:t.Rank.Six,suit:t.Suit.Spades},{rank:t.Rank.Seven,suit:t.Suit.Spades},{rank:t.Rank.Eight,suit:t.Suit.Spades},{rank:t.Rank.Nine,suit:t.Suit.Spades},{rank:t.Rank.Ten,suit:t.Suit.Spades},{rank:t.Rank.Jack,suit:t.Suit.Spades},{rank:t.Rank.Queen,suit:t.Suit.Spades},{rank:t.Rank.King,suit:t.Suit.Spades}],A=function(t){var e,n;function r(e,n){var r;return(r=t.call(this,n)||this).defaultValueOrDefaultValueFn=e,r.defaultValueIsFunction="function"==typeof r.defaultValueOrDefaultValueFn,r}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.get=function(e){return this.has(e)?t.prototype.get.call(this,e):this.defaultValueIsFunction?this.defaultValueOrDefaultValueFn(e):this.defaultValueOrDefaultValueFn},r}(c(Map));function L(t){for(var e,n=t[0].map((function(t){return t.length})),r=f(t);!(e=r()).done;)for(var o=e.value,i=0;i<o.length;i++){var a=o[i].length;n[i]<a&&(n[i]=a)}return n}!function(t){t[t.Continue=100]="Continue",t[t.SwitchingProtocols=101]="SwitchingProtocols",t[t.EarlyHints=103]="EarlyHints",t[t.Ok=200]="Ok",t[t.Created=201]="Created",t[t.Accepted=202]="Accepted",t[t.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",t[t.NoContent=204]="NoContent",t[t.ResetContent=205]="ResetContent",t[t.PartialContent=206]="PartialContent",t[t.MultipleChoices=300]="MultipleChoices",t[t.MovedPermanently=301]="MovedPermanently",t[t.Found=302]="Found",t[t.SeeOther=303]="SeeOther",t[t.NotModified=304]="NotModified",t[t.TemporaryRedirect=307]="TemporaryRedirect",t[t.PermanentRedirect=308]="PermanentRedirect",t[t.BadRequest=400]="BadRequest",t[t.Unauthorized=401]="Unauthorized",t[t.PaymentRequired=402]="PaymentRequired",t[t.Forbidden=403]="Forbidden",t[t.NotFound=404]="NotFound",t[t.MethodNotAllowed=405]="MethodNotAllowed",t[t.NotAcceptable=406]="NotAcceptable",t[t.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",t[t.RequestTimeout=408]="RequestTimeout",t[t.Conflict=409]="Conflict",t[t.Gone=410]="Gone",t[t.LengthRequired=411]="LengthRequired",t[t.PreconditionFailed=412]="PreconditionFailed",t[t.PayloadTooLarge=413]="PayloadTooLarge",t[t.UriTooLong=414]="UriTooLong",t[t.UnsupportedMediaType=415]="UnsupportedMediaType",t[t.RangeNotSatisfiable=416]="RangeNotSatisfiable",t[t.ExpectationFailed=417]="ExpectationFailed",t[t.ImATeapot=418]="ImATeapot",t[t.UnprocessableEntity=422]="UnprocessableEntity",t[t.TooEarly=425]="TooEarly",t[t.UpgradeRequired=426]="UpgradeRequired",t[t.PreconditionRequired=428]="PreconditionRequired",t[t.TooManyRequests=429]="TooManyRequests",t[t.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",t[t.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",t[t.InternalServerError=500]="InternalServerError",t[t.NotImplemented=501]="NotImplemented",t[t.BadGateway=502]="BadGateway",t[t.ServiceUnavailable=503]="ServiceUnavailable",t[t.GatewayTimeout=504]="GatewayTimeout",t[t.HttpVersionNotSupported=505]="HttpVersionNotSupported",t[t.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",t[t.InsufficientStorage=507]="InsufficientStorage",t[t.LoopDetected=508]="LoopDetected",t[t.NotExtended=510]="NotExtended",t[t.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired"}(O||(O={})),function(t){t.Get="GET",t.Head="HEAD",t.Post="POST",t.Put="PUT",t.Delete="DELETE",t.Connect="CONNECT",t.Options="OPTIONS",t.Trace="TRACE",t.Patch="PATCH"}(N||(N={}));var M={__proto__:null,get Status(){return O},get Method(){return N}};function F(t,e){return t+e}function _(t){var e=C(t);return t.map((function(t){return Math.pow(t-e,2)})).reduce(F)/(t.length-1)}function j(t,e,n){return 1/(e*Math.sqrt(2*Math.PI))*Math.pow(Math.E,-.5*Math.pow(t-n/e,2))}function C(t){var e=t.reduce(F);return e/("bigint"==typeof e?BigInt(t.length):t.length)}function D(t,e){return Math.random()*(e-t)+t}function H(){return(H=n(h.mark((function t(e){return h.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e;case 3:return t.t0=t.sent,t.t1=void 0,t.abrupt("return",[t.t0,t.t1]);case 8:return t.prev=8,t.t2=t.catch(0),t.abrupt("return",[void 0,t.t2]);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))).apply(this,arguments)}var I=function(){function t(t,e){if(this.lower=t,this.upper=e,t>e)throw new RangeError("lower must be less than upper")}t.from=function(e){return new t(e[0],e[1])};var e=t.prototype;return e.has=function(t){return t>=this.lower&&t<=this.upper},e[Symbol.iterator]=h.mark((function t(){return h.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.lower;case 2:return t.next=4,this.upper;case 4:case"end":return t.stop()}}),t,this)})),t}();function q(t,e){return t<e?-1:t>e?1:0}function U(t,e){return t<e?1:t>e?-1:0}var G={__proto__:null,ascending:function(t,e){return void 0===e&&"function"==typeof t?function(e,n){return q(t(e),t(n))}:q(t,e)},descending:function(t,e){return void 0===e&&"function"==typeof t?function(e,n){return U(t(e),t(n))}:U(t,e)}},V=function(){function t(){}t.start=function(){var t=new this;return t.start(),t};var e,n=t.prototype;return n.start=function(){this.startTime=process.hrtime.bigint()},n.end=function(){return Number(process.hrtime.bigint()-this.startTime)/1e6},(e=[{key:"started",get:function(){return void 0!==this.startTime}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}();t.Bitwise={__proto__:null,and:function(t,e){return t&e},or:function(t,e){return t|e},xor:function(t,e){return t^e}},t.DefaultMap=A,t.Http=M,t.Range=I,t.Sort=G,t.Stopwatch=V,t.allDuplicates=function(t){for(var e,n=new Set,r=[],o=f(t);!(e=o()).done;){var i=e.value;n.has(i)?r.push(i):n.add(i)}return r},t.binarySearch=function(t,e){for(var n=0,r=t.length-1;n<=r;){var o=Math.trunc((n+r)/2),i=e(t[o]);if(i<0)n=o+1;else{if(!(i>0))return t[o];r=o-1}}},t.capitalize=function(t){var e=t.charAt(0).toUpperCase();return""+e+t.slice(e.length)},t.chunk=function(t,e){return t.length===e?t.map((function(t){return[t]})):E((function(n){return t.slice(n*e,n*e+e)}),Math.ceil(t.length/e))},t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.combineIterables=S,t.count=function(t,e){for(var n,r=0,o=f(t);!(n=o()).done;)n.value===e&&r++;return r},t.cycle=w,t.difference=function(t,e){for(var n,r=new Set(t),o=f(e);!(n=o()).done;)r.delete(n.value);return r},t.duplicates=function(t){for(var e,n=new Set,r=new Set,o=f(t);!(e=o()).done;){var i=e.value;n.has(i)?r.add(i):n.add(i)}return r},t.every=function(t,e){for(var n,r=f(t);!(n=r()).done;)if(!e(n.value))return!1;return!0},t.fill=function(t,e){return Array.from({length:e},(function(){return t}))},t.find=function(t,e){for(var n,r=f(t);!(n=r()).done;){var o=n.value;if(e(o))return o}},t.first=function(t,e){if(void 0!==e)return b(t,e);for(var n,r=f(t);!(n=r()).done;)return n.value},t.formatTable=function(t,e){void 0===e&&(e=" ");var n=L(t);return t.map((function(t){return t.map((function(t,e){return t.padEnd(n[e])})).join(e)})).join("\n")},t.frequencyTable=function(t){for(var e,n=new Map,r=f(t);!(e=r()).done;){var o=e.value,i=n.get(o);n.set(o,(null!=i?i:0)+1)}return n},t.holes=function(t){for(var e=[],n=0;n<t.length;n++)n in t||e.push(n);return e},t.identical=function(t,e){if(Array.isArray(t)&&Array.isArray(e))return function(t,e){return t===e||t.length===e.length&&t.every((function(t,n){return t===e[n]}))}(t,e);if(t instanceof Set&&e instanceof Set)return function(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(var n,r=f(t);!(n=r()).done;)if(!e.has(n.value))return!1;return!0}(t,e);if(t instanceof Map&&e instanceof Map)return function(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(var n,r=f(t.entries());!(n=r()).done;){var o=n.value,i=o[0],a=o[1];if(!e.has(i)||e.get(i)!==a)return!1}return!0}(t,e);throw new RangeError("Expected both parameters to be an array, Set, or Map")},t.includes=function(t,e){for(var n,r=f(t);!(n=r()).done;)if(n.value===e)return!0;return!1},t.intersection=function(t,e){for(var n,r=new Set,o=T(t,e),i=o[1],a=f(o[0]);!(n=a()).done;){var u=n.value;i.has(u)&&r.add(u)}return r},t.invert=function(t){return function(){return-t.apply(void 0,arguments)}},t.isDisjoint=function(t,e){for(var n,r=t instanceof Set?t:new Set(t),o=f(e);!(n=o()).done;)if(r.has(n.value))return!1;return!0},t.isSubset=function(t,e){for(var n,r=f(t);!(n=r()).done;)if(!e.has(n.value))return!1;return!0},t.isSuperset=function(t,e){for(var n,r=f(e);!(n=r()).done;)if(!t.has(n.value))return!1;return!0},t.join=function(t,e){void 0===e&&(e=",");for(var n="",r=t[Symbol.iterator](),o=r.next();;){var i=o;if(o=r.next(),n+=i.value,o.done)return n;n+=e}},t.largeToSmall=T,t.lines=function(t){return t.split("\n").map((function(t){return t.trim()})).filter((function(t){return t.length>0}))},t.mapFill=E,t.mapRepeat=x,t.max=function(t,e){return e>t?e:t},t.maxColumnLength=L,t.mean=C,t.median=function(t){var e=t.length/2;return t.length%2==0?(t[e-1]+t[e])/("bigint"==typeof t[0]?2n:2):t[Math.floor(e)]},t.min=function(t,e){return e<t?e:t},t.mode=function(t){for(var e,n=new Map,r=0,o=[],i=f(t);!(e=i()).done;){var a=e.value,u=n.get(a),c=void 0===u?1:u+1;n.set(a,c),c>r?(r=c,o=[a]):c===r&&o.push(a)}return o},t.multiReplace=function(t,e){for(var n=Object.entries(e),r="",o=0;o<t.length;)t:do{for(var i,a=f(n);!(i=a()).done;){var u=i.value,c=u[0],s=u[1];if(t.slice(o).startsWith(c)){r+=s,o+=c.length;break t}}r+=t[o++]}while(0);return r},t.newDeck=function(){return[].concat(P)},t.normaldist=j,t.not=function(t){return function(){return!t.apply(void 0,arguments)}},t.nullish=function(t){return null==t},t.padEnd=function(t,e,n){t.push.apply(t,R(n,e-t.length))},t.padStart=function(t,e,n){t.unshift.apply(t,R(n,e-t.length))},t.partition=function(t,e){for(var n,r=[],o=[],i=0,a=f(t);!(n=a()).done;){var u=n.value;(e(u,i++)?r:o).push(u)}return[r,o]},t.product=function(t,e){return t*e},t.pull=function(t,e){var n=t.indexOf(e);return-1===n?[]:t.splice(n,1)},t.random=D,t.randomInt=function(t,e){return Math.floor(D(Math.ceil(t),Math.floor(e)))},t.regExpUnion=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new RegExp(e.map((function(t){return"("+t.source+")"})).join("|"))},t.rename=function(t,e,n){var o;return e===n?r({},t):function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(o[n]=t[n]);return o}(r({},t,((o={})[n]=t[e],o)),[e].map(l))},t.repeat=R,t.same=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=e.map((function(t){return t[Symbol.iterator]()})),o=function(){for(var t,e=r.map((function(t){return t.next()})),n=e[0],o=n.done,i=n.value,a=f(e);!(t=a()).done;){var u=t.value;if(u.done)return{v:e.every((function(t){return t.done===o}))};if(u.value!==i)return{v:!1}}};;){var i=o();if("object"==typeof i)return i.v}},t.sample=function(t){return t[Math.floor(Math.random()*t.length)]},t.settled=function(t){return H.apply(this,arguments)},t.shuffle=function(t,e){void 0===e&&(e=!0);for(var n=e?t:[].concat(t),r=n.length-1;r>0;r--){var o=Math.floor(Math.random()*(r+1)),i=[n[o],n[r]];n[r]=i[0],n[o]=i[1]}if(!e)return n},t.some=function(t,e){for(var n,r=f(t);!(n=r()).done;)if(e(n.value))return!0;return!1},t.sortObject=function(t,e){return Object.entries(t).sort((function(t,n){return e(t[1],n[1])}))},t.standardNormaldist=function(t){return j(t,1,0)},t.stddev=function(t){return Math.sqrt(_(t))},t.sum=F,t.symmetricDifference=function(t,e){for(var n,r=new Set(t),o=f(e);!(n=o()).done;){var i=n.value;r.has(i)?r.delete(i):r.add(i)}return r},t.toDigits=function(t,e){var n=Math.pow(10,e);return Math.round(t*n*(1+Number.EPSILON))/n},t.truncate=function(t,e,n){return void 0===n&&(n=""),t.length>e?""+t.slice(0,e)+n:t},t.uncapitalize=function(t){var e=t.charAt(0).toLowerCase();return""+e+t.slice(e.length)},t.union=function(t,e){return new Set(S(t,e))},t.variance=_,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self)["@jonahsnider/util"]={})}(this,(function(t){"use strict";function e(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function u(t){e(a,o,i,u,c,"next",t)}function c(t){e(a,o,i,u,c,"throw",t)}u(void 0)}))}}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t,e,n){return(u=a()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&i(o,n.prototype),o}).apply(null,arguments)}function c(t){var e="function"==typeof Map?new Map:void 0;return(c=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,o(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,t)})(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return s(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function l(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var p,d,h=function(t,e){return function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new R(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,i),o}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function d(){}var h={};h[o]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(x([])));y&&y!==e&&n.call(y,o)&&(h=y);var m=d.prototype=l.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){var r;this._invoke=function(o,i){function a(){return new e((function(r,a){!function r(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function S(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,f;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function x(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return p.prototype=m.constructor=d,d.constructor=p,p.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(k.prototype),k.prototype[i]=function(){return this},t.AsyncIterator=k,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new k(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),u(m,a,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;w(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(e={exports:{}}),e.exports}(),v=h.mark(S),y=h.mark(w),m=h.mark(R),g=h.mark(x),k=h.mark(E);function S(){var t,e,n,r,o,i=arguments;return h.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:for(t=i.length,e=new Array(t),n=0;n<t;n++)e[n]=i[n];r=0,o=e;case 2:if(!(r<o.length)){a.next=8;break}return a.delegateYield(o[r],"t0",5);case 5:r++,a.next=2;break;case 8:case"end":return a.stop()}}),v)}function b(t){for(var e,n=new Map,r=f(t);!(e=r()).done;){var o,i=e.value,a=(null!=(o=n.get(i))?o:0)+1;n.set(i,a)}return n}function w(t,e){var n,r,o;return h.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:n=f(t);case 1:if((r=n()).done){i.next=11;break}if(o=r.value,!e--){i.next=8;break}return i.next=6,o;case 6:i.next=9;break;case 8:return i.abrupt("break",11);case 9:i.next=1;break;case 11:case"end":return i.stop()}}),y)}function R(t,e){var n;return h.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=0;case 1:if(!(n<e)){r.next=6;break}return r.delegateYield(t,"t0",3);case 3:n++,r.next=1;break;case 6:case"end":return r.stop()}}),m)}function x(t,e){var n;return h.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=0;case 1:if(!(n<e)){r.next=7;break}return r.next=4,t;case 4:n++,r.next=1;break;case 7:case"end":return r.stop()}}),g)}function E(t,e){var n;return h.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=0;case 1:if(!(n<e)){r.next=7;break}return r.next=4,t(n);case 4:n++,r.next=1;break;case 7:case"end":return r.stop()}}),k)}function T(t,e){var n=void 0;if("size"in t?n="size":"length"in t&&(n="length"),!n)throw new RangeError;return t[n]<e[n]?[e,t]:[t,e]}function O(t,e){return Array.from({length:e},(function(e,n){return t(n)}))}(p=t.Rank||(t.Rank={}))[p.Ace=1]="Ace",p[p.Two=2]="Two",p[p.Three=3]="Three",p[p.Four=4]="Four",p[p.Five=5]="Five",p[p.Six=6]="Six",p[p.Seven=7]="Seven",p[p.Eight=8]="Eight",p[p.Nine=9]="Nine",p[p.Ten=10]="Ten",p[p.Jack=11]="Jack",p[p.Queen=12]="Queen",p[p.King=13]="King",(d=t.Suit||(t.Suit={}))[d.Clubs=0]="Clubs",d[d.Diamonds=1]="Diamonds",d[d.Hearts=2]="Hearts",d[d.Spades=3]="Spades";var _,A,P=[{rank:t.Rank.Ace,suit:t.Suit.Clubs},{rank:t.Rank.Two,suit:t.Suit.Clubs},{rank:t.Rank.Three,suit:t.Suit.Clubs},{rank:t.Rank.Four,suit:t.Suit.Clubs},{rank:t.Rank.Five,suit:t.Suit.Clubs},{rank:t.Rank.Six,suit:t.Suit.Clubs},{rank:t.Rank.Seven,suit:t.Suit.Clubs},{rank:t.Rank.Eight,suit:t.Suit.Clubs},{rank:t.Rank.Nine,suit:t.Suit.Clubs},{rank:t.Rank.Ten,suit:t.Suit.Clubs},{rank:t.Rank.Jack,suit:t.Suit.Clubs},{rank:t.Rank.Queen,suit:t.Suit.Clubs},{rank:t.Rank.King,suit:t.Suit.Clubs},{rank:t.Rank.Ace,suit:t.Suit.Diamonds},{rank:t.Rank.Two,suit:t.Suit.Diamonds},{rank:t.Rank.Three,suit:t.Suit.Diamonds},{rank:t.Rank.Four,suit:t.Suit.Diamonds},{rank:t.Rank.Five,suit:t.Suit.Diamonds},{rank:t.Rank.Six,suit:t.Suit.Diamonds},{rank:t.Rank.Seven,suit:t.Suit.Diamonds},{rank:t.Rank.Eight,suit:t.Suit.Diamonds},{rank:t.Rank.Nine,suit:t.Suit.Diamonds},{rank:t.Rank.Ten,suit:t.Suit.Diamonds},{rank:t.Rank.Jack,suit:t.Suit.Diamonds},{rank:t.Rank.Queen,suit:t.Suit.Diamonds},{rank:t.Rank.King,suit:t.Suit.Diamonds},{rank:t.Rank.Ace,suit:t.Suit.Hearts},{rank:t.Rank.Two,suit:t.Suit.Hearts},{rank:t.Rank.Three,suit:t.Suit.Hearts},{rank:t.Rank.Four,suit:t.Suit.Hearts},{rank:t.Rank.Five,suit:t.Suit.Hearts},{rank:t.Rank.Six,suit:t.Suit.Hearts},{rank:t.Rank.Seven,suit:t.Suit.Hearts},{rank:t.Rank.Eight,suit:t.Suit.Hearts},{rank:t.Rank.Nine,suit:t.Suit.Hearts},{rank:t.Rank.Ten,suit:t.Suit.Hearts},{rank:t.Rank.Jack,suit:t.Suit.Hearts},{rank:t.Rank.Queen,suit:t.Suit.Hearts},{rank:t.Rank.King,suit:t.Suit.Hearts},{rank:t.Rank.Ace,suit:t.Suit.Spades},{rank:t.Rank.Two,suit:t.Suit.Spades},{rank:t.Rank.Three,suit:t.Suit.Spades},{rank:t.Rank.Four,suit:t.Suit.Spades},{rank:t.Rank.Five,suit:t.Suit.Spades},{rank:t.Rank.Six,suit:t.Suit.Spades},{rank:t.Rank.Seven,suit:t.Suit.Spades},{rank:t.Rank.Eight,suit:t.Suit.Spades},{rank:t.Rank.Nine,suit:t.Suit.Spades},{rank:t.Rank.Ten,suit:t.Suit.Spades},{rank:t.Rank.Jack,suit:t.Suit.Spades},{rank:t.Rank.Queen,suit:t.Suit.Spades},{rank:t.Rank.King,suit:t.Suit.Spades}],N=function(t){var e,n;function r(e,n){var r;return(r=t.call(this,n)||this).defaultValueOrDefaultValueFn=e,r.defaultValueIsFunction="function"==typeof r.defaultValueOrDefaultValueFn,r}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.get=function(e){return this.has(e)?t.prototype.get.call(this,e):this.defaultValueIsFunction?this.defaultValueOrDefaultValueFn(e):this.defaultValueOrDefaultValueFn},r}(c(Map));function L(t){for(var e,n=t[0].map((function(t){return t.length})),r=f(t);!(e=r()).done;)for(var o=e.value,i=0;i<o.length;i++){var a=o[i].length;n[i]<a&&(n[i]=a)}return n}!function(t){t[t.Continue=100]="Continue",t[t.SwitchingProtocols=101]="SwitchingProtocols",t[t.EarlyHints=103]="EarlyHints",t[t.Ok=200]="Ok",t[t.Created=201]="Created",t[t.Accepted=202]="Accepted",t[t.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",t[t.NoContent=204]="NoContent",t[t.ResetContent=205]="ResetContent",t[t.PartialContent=206]="PartialContent",t[t.MultipleChoices=300]="MultipleChoices",t[t.MovedPermanently=301]="MovedPermanently",t[t.Found=302]="Found",t[t.SeeOther=303]="SeeOther",t[t.NotModified=304]="NotModified",t[t.TemporaryRedirect=307]="TemporaryRedirect",t[t.PermanentRedirect=308]="PermanentRedirect",t[t.BadRequest=400]="BadRequest",t[t.Unauthorized=401]="Unauthorized",t[t.PaymentRequired=402]="PaymentRequired",t[t.Forbidden=403]="Forbidden",t[t.NotFound=404]="NotFound",t[t.MethodNotAllowed=405]="MethodNotAllowed",t[t.NotAcceptable=406]="NotAcceptable",t[t.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",t[t.RequestTimeout=408]="RequestTimeout",t[t.Conflict=409]="Conflict",t[t.Gone=410]="Gone",t[t.LengthRequired=411]="LengthRequired",t[t.PreconditionFailed=412]="PreconditionFailed",t[t.PayloadTooLarge=413]="PayloadTooLarge",t[t.UriTooLong=414]="UriTooLong",t[t.UnsupportedMediaType=415]="UnsupportedMediaType",t[t.RangeNotSatisfiable=416]="RangeNotSatisfiable",t[t.ExpectationFailed=417]="ExpectationFailed",t[t.ImATeapot=418]="ImATeapot",t[t.UnprocessableEntity=422]="UnprocessableEntity",t[t.TooEarly=425]="TooEarly",t[t.UpgradeRequired=426]="UpgradeRequired",t[t.PreconditionRequired=428]="PreconditionRequired",t[t.TooManyRequests=429]="TooManyRequests",t[t.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",t[t.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",t[t.InternalServerError=500]="InternalServerError",t[t.NotImplemented=501]="NotImplemented",t[t.BadGateway=502]="BadGateway",t[t.ServiceUnavailable=503]="ServiceUnavailable",t[t.GatewayTimeout=504]="GatewayTimeout",t[t.HttpVersionNotSupported=505]="HttpVersionNotSupported",t[t.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",t[t.InsufficientStorage=507]="InsufficientStorage",t[t.LoopDetected=508]="LoopDetected",t[t.NotExtended=510]="NotExtended",t[t.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired"}(_||(_={})),function(t){t.Get="GET",t.Head="HEAD",t.Post="POST",t.Put="PUT",t.Delete="DELETE",t.Connect="CONNECT",t.Options="OPTIONS",t.Trace="TRACE",t.Patch="PATCH"}(A||(A={}));var M=function(){function t(t,e){if(this.lower=t,this.upper=e,t>e)throw new RangeError("lower must be less than upper")}t.from=function(e){return new t(e[0],e[1])};var e=t.prototype;return e.has=function(t){return t>=this.lower&&t<=this.upper},e[Symbol.iterator]=h.mark((function t(){return h.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.lower;case 2:return t.next=4,this.upper;case 4:case"end":return t.stop()}}),t,this)})),t}(),j={__proto__:null,StatusRange:{__proto__:null,informational:Object.freeze(new M(100,200)),success:Object.freeze(new M(200,300)),redirects:Object.freeze(new M(300,400)),clientErrors:Object.freeze(new M(400,500)),serverErrors:Object.freeze(new M(500,600))},get Status(){return _},get Method(){return A}};function F(t,e){if(Array.isArray(t)&&Array.isArray(e))return function(t,e){return t===e||t.length===e.length&&t.every((function(t,n){return t===e[n]}))}(t,e);if(t instanceof Set&&e instanceof Set)return function(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(var n,r=f(t);!(n=r()).done;)if(!e.has(n.value))return!1;return!0}(t,e);if(t instanceof Map&&e instanceof Map)return function(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(var n,r=f(t.entries());!(n=r()).done;){var o=n.value,i=o[0],a=o[1];if(!e.has(i)||e.get(i)!==a)return!1}return!0}(t,e);throw new RangeError("Expected both parameters to be an array, Set, or Map")}function C(t,e){return t+e}function D(t){var e=I(t);return t.map((function(t){return Math.pow(t-e,2)})).reduce(C)/(t.length-1)}function H(t,e,n){return 1/(e*Math.sqrt(2*Math.PI))*Math.pow(Math.E,-.5*Math.pow(t-n/e,2))}function I(t){var e=t.reduce(C);return e/("bigint"==typeof e?BigInt(t.length):t.length)}function q(t,e){return Math.random()*(e-t)+t}var U=function(){function t(){this._count=0}var e=t.prototype;return e.percentage=function(){var t,e=this;return this._count++,(t={})[Symbol.toPrimitive]=function(){return 1/e._count},t},e.count=function(){var t,e=this;return this._count++,(t={})[Symbol.toPrimitive]=function(){return e._count},t},t}();function G(){return(G=n(h.mark((function t(e){return h.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e;case 3:return t.t0=t.sent,t.t1=void 0,t.abrupt("return",[t.t0,t.t1]);case 8:return t.prev=8,t.t2=t.catch(0),t.abrupt("return",[void 0,t.t2]);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))).apply(this,arguments)}function z(t,e){return t<e?-1:t>e?1:0}function V(t,e){return t<e?1:t>e?-1:0}var B={__proto__:null,ascending:function(t,e){return void 0===e&&"function"==typeof t?function(e,n){return z(t(e),t(n))}:z(t,e)},descending:function(t,e){return void 0===e&&"function"==typeof t?function(e,n){return V(t(e),t(n))}:V(t,e)}},J=function(){function t(){}t.start=function(){var t=new this;return t.start(),t};var e,n=t.prototype;return n.start=function(){this.startTime=process.hrtime.bigint()},n.end=function(){return Number(process.hrtime.bigint()-this.startTime)/1e6},(e=[{key:"started",get:function(){return void 0!==this.startTime}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}();t.AutoPercentage=U,t.Bitwise={__proto__:null,and:function(t,e){return t&e},or:function(t,e){return t|e},xor:function(t,e){return t^e}},t.DefaultMap=N,t.Http=j,t.Range=M,t.Sort=B,t.Stopwatch=J,t.allDuplicates=function(t){for(var e,n=new Set,r=[],o=f(t);!(e=o()).done;){var i=e.value;n.has(i)?r.push(i):n.add(i)}return r},t.binarySearch=function(t,e){for(var n=0,r=t.length-1;n<=r;){var o=Math.trunc((n+r)/2),i=e(t[o]);if(i<0)n=o+1;else{if(!(i>0))return t[o];r=o-1}}},t.capitalize=function(t){var e=t.charAt(0).toUpperCase();return""+e+t.slice(e.length)},t.chunk=function(t,e){return t.length===e?t.map((function(t){return[t]})):O((function(n){return t.slice(n*e,n*e+e)}),Math.ceil(t.length/e))},t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.combineIterables=S,t.count=function(t,e){for(var n,r=0,o=f(t);!(n=o()).done;)n.value===e&&r++;return r},t.cycle=R,t.difference=function(t,e){for(var n,r=new Set(t),o=f(e);!(n=o()).done;)r.delete(n.value);return r},t.duplicates=function(t){for(var e,n=new Set,r=new Set,o=f(t);!(e=o()).done;){var i=e.value;n.has(i)?r.add(i):n.add(i)}return r},t.every=function(t,e){for(var n,r=f(t);!(n=r()).done;)if(!e(n.value))return!1;return!0},t.fill=function(t,e){return Array.from({length:e},(function(){return t}))},t.find=function(t,e){for(var n,r=f(t);!(n=r()).done;){var o=n.value;if(e(o))return o}},t.first=function(t,e){if(void 0!==e)return w(t,e);for(var n,r=f(t);!(n=r()).done;)return n.value},t.formatTable=function(t,e){void 0===e&&(e=" ");var n=L(t);return t.map((function(t){return t.map((function(t,e){return t.padEnd(n[e])})).join(e)})).join("\n")},t.frequencyTable=b,t.holes=function(t){for(var e=[],n=0;n<t.length;n++)n in t||e.push(n);return e},t.identical=F,t.includes=function(t,e){for(var n,r=f(t);!(n=r()).done;)if(n.value===e)return!0;return!1},t.indexOfAll=function(t,e){for(var n=[],r=0;r<t.length;r++)t[r]===e&&n.push(r);return n},t.intersection=function(t,e){for(var n,r=new Set,o=T(t,e),i=o[1],a=f(o[0]);!(n=a()).done;){var u=n.value;i.has(u)&&r.add(u)}return r},t.invert=function(t){return function(){return-t.apply(void 0,arguments)}},t.isAnagram=function(t,e){return t===e||t.length===e.length&&F(b(t),b(e))},t.isDisjoint=function(t,e){for(var n,r=t instanceof Set?t:new Set(t),o=f(e);!(n=o()).done;)if(r.has(n.value))return!1;return!0},t.isSubset=function(t,e){for(var n,r=f(t);!(n=r()).done;)if(!e.has(n.value))return!1;return!0},t.isSuperset=function(t,e){for(var n,r=f(e);!(n=r()).done;)if(!t.has(n.value))return!1;return!0},t.join=function(t,e){void 0===e&&(e=",");for(var n="",r=t[Symbol.iterator](),o=r.next();;){var i=o;if(o=r.next(),n+=i.value,o.done)return n;n+=e}},t.largeToSmall=T,t.lines=function(t){return t.split("\n").map((function(t){return t.trim()})).filter((function(t){return t.length>0}))},t.mapFill=O,t.mapRepeat=E,t.max=function(t,e){return e>t?e:t},t.maxColumnLength=L,t.mean=I,t.median=function(t){var e=t.length/2;return t.length%2==0?(t[e-1]+t[e])/("bigint"==typeof t[0]?2n:2):t[Math.floor(e)]},t.min=function(t,e){return e<t?e:t},t.mode=function(t){for(var e,n=new Map,r=0,o=[],i=f(t);!(e=i()).done;){var a=e.value,u=n.get(a),c=void 0===u?1:u+1;n.set(a,c),c>r?(r=c,o=[a]):c===r&&o.push(a)}return o},t.multiReplace=function(t,e){for(var n=Object.entries(e),r="",o=0;o<t.length;)t:do{for(var i,a=f(n);!(i=a()).done;){var u=i.value,c=u[0],s=u[1];if(t.slice(o).startsWith(c)){r+=s,o+=c.length;break t}}r+=t[o++]}while(0);return r},t.newDeck=function(){return[].concat(P)},t.normaldist=H,t.not=function(t){return function(){return!t.apply(void 0,arguments)}},t.nullish=function(t){return null==t},t.padEnd=function(t,e,n){t.push.apply(t,x(n,e-t.length))},t.padStart=function(t,e,n){t.unshift.apply(t,x(n,e-t.length))},t.partition=function(t,e){for(var n,r=[],o=[],i=0,a=f(t);!(n=a()).done;){var u=n.value;(e(u,i++)?r:o).push(u)}return[r,o]},t.product=function(t,e){return t*e},t.pull=function(t,e){var n=t.indexOf(e);return-1===n?[]:t.splice(n,1)},t.random=q,t.randomInt=function(t,e){return Math.floor(q(Math.ceil(t),Math.floor(e)))},t.regExpUnion=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new RegExp(e.map((function(t){return"("+t.source+")"})).join("|"))},t.rename=function(t,e,n){var o;return e===n?r({},t):function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(o[n]=t[n]);return o}(r({},t,((o={})[n]=t[e],o)),[e].map(l))},t.repeat=x,t.replace=function(t,e,n){var r=t.indexOf(e);return-1!==r&&(t[r]=n),r},t.replaceAll=function(t,e,n){for(var r=0,o=0;o<t.length;o++)t[o]===e&&(t[o]=n,r++);return r},t.same=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=e.map((function(t){return t[Symbol.iterator]()})),o=function(){for(var t,e=r.map((function(t){return t.next()})),n=e[0],o=n.done,i=n.value,a=f(e);!(t=a()).done;){var u=t.value;if(u.done)return{v:e.every((function(t){return t.done===o}))};if(u.value!==i)return{v:!1}}};;){var i=o();if("object"==typeof i)return i.v}},t.sample=function(t){return t[Math.floor(Math.random()*t.length)]},t.settled=function(t){return G.apply(this,arguments)},t.shuffle=function(t,e){void 0===e&&(e=!0);for(var n=e?t:[].concat(t),r=n.length-1;r>0;r--){var o=Math.floor(Math.random()*(r+1)),i=[n[o],n[r]];n[r]=i[0],n[o]=i[1]}if(!e)return n},t.some=function(t,e){for(var n,r=f(t);!(n=r()).done;)if(e(n.value))return!0;return!1},t.sortObject=function(t,e){return Object.entries(t).sort((function(t,n){return e(t[1],n[1])}))},t.standardNormaldist=function(t){return H(t,1,0)},t.stddev=function(t){return Math.sqrt(D(t))},t.sum=C,t.symmetricDifference=function(t,e){for(var n,r=new Set(t),o=f(e);!(n=o()).done;){var i=n.value;r.has(i)?r.delete(i):r.add(i)}return r},t.toDigits=function(t,e){var n=Math.pow(10,e);return Math.round(t*n*(1+Number.EPSILON))/n},t.truncate=function(t,e,n){return void 0===n&&(n=""),t.length>e?""+t.slice(0,e)+n:t},t.uncapitalize=function(t){var e=t.charAt(0).toLowerCase();return""+e+t.slice(e.length)},t.union=function(t,e){return new Set(S(t,e))},t.variance=D,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=util.umd.production.min.js.map |
{ | ||
"name": "@jonahsnider/util", | ||
"version": "7.0.1", | ||
"version": "7.1.0", | ||
"description": "A useful collection of optimized utility functions", | ||
@@ -40,15 +40,15 @@ "homepage": "https://util.jonah.pw/", | ||
"devDependencies": { | ||
"@size-limit/preset-small-lib": "5.0.2", | ||
"@typescript-eslint/eslint-plugin": "4.29.1", | ||
"@typescript-eslint/parser": "4.29.1", | ||
"eslint-plugin-prettier": "3.4.0", | ||
"@size-limit/preset-small-lib": "5.0.3", | ||
"@typescript-eslint/eslint-plugin": "4.29.2", | ||
"@typescript-eslint/parser": "4.29.2", | ||
"eslint-plugin-prettier": "3.4.1", | ||
"eslint-plugin-tsdoc": "0.2.14", | ||
"prettier": "2.3.2", | ||
"prettier-config-xo": "2.0.0", | ||
"semantic-release": "17.4.4", | ||
"size-limit": "5.0.2", | ||
"semantic-release": "17.4.5", | ||
"size-limit": "5.0.3", | ||
"tsd": "0.17.0", | ||
"tsdx": "0.14.1", | ||
"tslib": "2.3.0", | ||
"typedoc": "0.21.5", | ||
"tslib": "2.3.1", | ||
"typedoc": "0.21.6", | ||
"typescript": "4.2.4" | ||
@@ -55,0 +55,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1190480
43
12900