@jonahsnider/util
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -28,3 +28,3 @@ /** A 2-dimensional table of type `T`. */ | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1, 2, 3]; | ||
@@ -46,3 +46,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1, 2, 3]; | ||
@@ -54,3 +54,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1, 2, 3]; | ||
@@ -74,6 +74,6 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | ||
* | ||
* function directionFn(value) { | ||
* function directionFn(value: number) { | ||
* const squared = value ** 2; | ||
@@ -102,3 +102,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* chunk([1, 2, 3, 4, 5, 6], 2); // [[1, 2 ], [ 3, 4 ], [ 5, 6 ] ] | ||
@@ -108,3 +108,3 @@ * ``` | ||
* @example | ||
* ```ts | ||
* ```js | ||
* chunk([1, 2, 3, 4, 5, 6], 5); // [[1, 2, 3, 4, 5], [6]] | ||
@@ -114,3 +114,3 @@ * ``` | ||
* @example | ||
* ```ts | ||
* ```js | ||
* chunk([1, 2, 3, 4, 5, 6], 6); // [[1], [2], [3], [4], [5], [6]] | ||
@@ -120,3 +120,3 @@ * ``` | ||
* @example | ||
* ```ts | ||
* ```js | ||
* chunk([1, 2, 3, 4, 5, 6], 100); // [[1, 2, 3, 4, 5, 6]] | ||
@@ -132,15 +132,2 @@ * ``` | ||
/** | ||
* Construct a frequency table from an iterable. | ||
* | ||
* @example | ||
* ```ts | ||
* frequencyTable([1, 2, 2, 3, 3, 3]) // Map(3) { 1 => 1, 2 => 2, 3 => 3 }; | ||
* ``` | ||
* | ||
* @param iterable - The iterable to construct a frequency table for | ||
* | ||
* @returns A frequency table represented as a `Map` where keys are the elements and values are the frequency | ||
*/ | ||
export declare function frequencyTable<T>(iterable: Iterable<T>): Map<T, number>; | ||
/** | ||
* A side-effect free reverse operation. | ||
@@ -150,3 +137,3 @@ * For best results `iterable` should be an array so that the returned array doesn't need to be resized as more elements are added. | ||
* @example | ||
* ```ts | ||
* ```js | ||
* reverse([1, 2, 3]); // [3, 2, 1] | ||
@@ -160,83 +147,2 @@ * ``` | ||
export declare function reverse<T>(iterable: readonly T[] | Iterable<T>): T[]; | ||
/** | ||
* Split an iterable into two arrays of elements that passed or failed a provided predicate. | ||
* | ||
* @example | ||
* ```ts | ||
* const [odd, even] = partition([1, 2, 3, 4, 5, 6], num => num % 2); | ||
* ``` | ||
* | ||
* @param iterable - The iterable to partition | ||
* @param predicate - The predicate to apply to each element of `iterable`. If the predicate 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<T>(iterable: Iterable<T>, predicate: (value: T, index: number) => unknown): [passed: T[], failed: T[]]; | ||
/** | ||
* Get the first element from an iterable. | ||
* | ||
* @example | ||
* ```ts | ||
* first([1, 2, 3]); // 1 | ||
* ``` | ||
* | ||
* @param iterable - The iterable to take elements from | ||
* | ||
* @returns The first element of the iterable | ||
*/ | ||
export declare function first<T>(iterable: Iterable<T>, take?: undefined): T | undefined; | ||
/** | ||
* Get the first `n` elements from an iterable. | ||
* | ||
* @example | ||
* ```ts | ||
* first([1, 2, 3], 1); // [1] | ||
* ``` | ||
* | ||
* @example | ||
* ```ts | ||
* first([1, 2, 3], 2); // [1, 2] | ||
* ``` | ||
* | ||
* @param iterable - The iterable to take elements from | ||
* @param take - The number of elements to take from the iterable | ||
* | ||
* @returns The first `take` elements of the iterable | ||
*/ | ||
export declare function first<T>(iterable: Iterable<T>, take?: number): T[]; | ||
/** | ||
* Get an array of all the duplicate elements in an iterable. | ||
* | ||
* @example | ||
* ```ts | ||
* allDuplicates([1, 2, 2, 2, 3]); // [2, 2] | ||
* ``` | ||
* | ||
* @example | ||
* Using {@link frequencyTable} to get the number of times each element was duplicated | ||
* ```ts | ||
* frequencyTable(allDuplicates([1, 2, 2, 2, 3, 3])); // Map(2) { 2 => 2, 3 => 1 } | ||
* ``` | ||
* | ||
* @see {@link duplicates} to receive a `Set` of duplicate elements instead of an array (which can include the same element more than once) | ||
* | ||
* @param iterable - The iterable to find duplicates in | ||
* @returns An array of the duplicated elements | ||
*/ | ||
export declare function allDuplicates<T>(iterable: Iterable<T>): T[]; | ||
/** | ||
* Get a Set of the duplicate elements in an iterable. | ||
* | ||
* @example | ||
* ```ts | ||
* duplicates([1, 2, 2, 2, 3]); // Set(1) { 2 } | ||
* ``` | ||
* | ||
* @see {@link allDuplicates} to receive a array of duplicate elements instead of a `Set` (which doesn't include the same element more than once) | ||
* | ||
* @param iterable - The iterable to find duplicates in | ||
* @returns A `Set` of the duplicated elements | ||
*/ | ||
export declare function duplicates<T>(iterable: Iterable<T>): Set<T>; | ||
declare type ObjectWithLength = { | ||
@@ -254,4 +160,10 @@ length: number; | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const a = [1, 2]; | ||
* const b = [1, 2, 3]; | ||
* | ||
* const [largest, smallest] = arrangeByLength(a, b); | ||
* | ||
* console.log(largest); // [1, 2, 3] | ||
* console.log(smallest); // [1, 2] | ||
* ``` | ||
@@ -266,1 +178,14 @@ * | ||
export declare function largeToSmall<A extends ObjectWithSize, B extends ObjectWithSize>(a: A, b: B): ArrangedLargestToSmallest<A, B>; | ||
/** | ||
* Get an array of indexes of holes in an array. | ||
* | ||
* @example | ||
* ```js | ||
* holes([0, , 2]); // [1] | ||
* ``` | ||
* | ||
* @param array - The array to find holes in | ||
* | ||
* @returns An array of indexes of holes in the array | ||
*/ | ||
export declare function holes<T>(array: readonly T[]): number[]; |
@@ -39,3 +39,3 @@ /** | ||
* @example | ||
* ```ts | ||
* ```js | ||
* import { shuffle } from '@jonahsnider/util'; | ||
@@ -42,0 +42,0 @@ * |
@@ -5,6 +5,8 @@ /** | ||
* @example | ||
* ```ts | ||
* ```js | ||
* import { nullish } from '@jonahsnider/util'; | ||
* | ||
* [0, null, '', undefined, false].filter(not(nullish)); // [0, '', false] | ||
* const array = [0, null, '', undefined, false]; | ||
* | ||
* array.filter(not(nullish)); // [0, '', false] | ||
* ``` | ||
@@ -21,3 +23,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* function sort(a, b) { | ||
@@ -24,0 +26,0 @@ * return a - b; |
@@ -6,4 +6,4 @@ import { Table } from './array'; | ||
* @example | ||
* ```ts | ||
* capitalize('hello') === 'Hello'; | ||
* ```js | ||
* capitalize('hello'); // 'Hello' | ||
* ``` | ||
@@ -22,4 +22,4 @@ * | ||
* @example | ||
* ```ts | ||
* uncapitalize('HELLO') === 'hELLO'; | ||
* ```js | ||
* uncapitalize('HELLO'); // hELLO | ||
* ``` | ||
@@ -38,4 +38,4 @@ * | ||
* @example | ||
* ```ts | ||
* truncate('hello, world', 5, '...') === 'hello...'; | ||
* ```js | ||
* truncate('hello, world', 5, '...'); // 'hello...' | ||
* ``` | ||
@@ -49,3 +49,3 @@ * | ||
*/ | ||
export declare function truncate(text: string, maxLength: number, suffix?: string): string; | ||
export declare function truncate<T extends string>(text: T, maxLength: number, suffix?: string): T | `${string}${typeof suffix}`; | ||
/** | ||
@@ -75,4 +75,4 @@ * Get the lengths of each column in a table. | ||
* @example | ||
* ```ts | ||
* multiReplace('a b c', {a: 'c', c: 'a'}) === 'c b a'; | ||
* ```js | ||
* multiReplace('a b c', {a: 'c', c: 'a'}); // 'c b a' | ||
* ``` | ||
@@ -79,0 +79,0 @@ * |
@@ -6,7 +6,7 @@ /** | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const a = [1]; | ||
* const b = [1]; | ||
* | ||
* identical(a, b) === true; | ||
* identical(a, b); // true | ||
* ``` | ||
@@ -25,7 +25,7 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const a = new Set([1, 2, 3]); | ||
* const b = new Set([3, 2, 1]); | ||
* | ||
* identical(a, b) === true; | ||
* identical(a, b); // true | ||
* ``` | ||
@@ -44,7 +44,7 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const a = new Map([['a', 1]]); | ||
* const b = new Map([['a', 1]]); | ||
* | ||
* identical(a, b) === true; | ||
* identical(a, b); // true | ||
* ``` | ||
@@ -63,3 +63,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const a = [1, 2, 3]; | ||
@@ -71,3 +71,3 @@ * const b = [1, 2, 3]; | ||
* | ||
* same(a, b, c, d, e) === true; | ||
* same(a, b, c, d, e); // true | ||
* ``` | ||
@@ -74,0 +74,0 @@ * |
@@ -7,5 +7,7 @@ export * from './array'; | ||
export * from './identical'; | ||
export * from './iterable'; | ||
export * from './math'; | ||
export * from './nullish'; | ||
export * from './object'; | ||
export * from './promise'; | ||
export * from './reducers'; | ||
@@ -12,0 +14,0 @@ export * from './regExp'; |
@@ -5,4 +5,4 @@ /** | ||
* @example | ||
* ```ts | ||
* variance([1, 2, 3]) === 1; | ||
* ```js | ||
* variance([1, 2, 3]); // 1 | ||
* ``` | ||
@@ -19,4 +19,4 @@ * | ||
* @example | ||
* ```ts | ||
* stddev([1, 2, 3]) === 1; | ||
* ```js | ||
* stddev([1, 2, 3]); // 1 | ||
* ``` | ||
@@ -33,3 +33,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* normaldist(0, 1, 0); | ||
@@ -51,4 +51,4 @@ * ``` | ||
* @example | ||
* ```ts | ||
* standardNormaldist(0) === normaldist(0, 1, 0); | ||
* ```js | ||
* standardNormaldist(0) === normaldist(0, 1, 0); // true | ||
* ``` | ||
@@ -67,6 +67,6 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1, 2, 3]; | ||
* | ||
* mean(array) === 2; | ||
* mean(array); // 2 | ||
* ``` | ||
@@ -86,6 +86,6 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1n, 2n, 3n]; | ||
* | ||
* mean(array) === 2n; | ||
* mean(array); // 2n | ||
* ``` | ||
@@ -105,6 +105,6 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const values = [1, 2, 3]; | ||
* | ||
* median(values) === 2; | ||
* median(values); // 2 | ||
* ``` | ||
@@ -126,3 +126,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const values = [1, 2, 2, 3, 3]; | ||
@@ -145,3 +145,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const value = random(0, 10); | ||
@@ -162,6 +162,4 @@ * | ||
* @example | ||
* ```ts | ||
* const value = randomInt(0, 3); | ||
* | ||
* value === 0 || value === 1 || value === 2; | ||
* ```js | ||
* randomInt(0, 3); // 0, 1, or 2 | ||
* ``` | ||
@@ -179,3 +177,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const value = clamp(Math.random() * 100, 25, 75n); | ||
@@ -182,0 +180,0 @@ * |
@@ -7,3 +7,3 @@ /** `null` or `undefined`. */ | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const value = Math.random() > 0.5 ? 'hello' : null; | ||
@@ -10,0 +10,0 @@ * |
@@ -7,3 +7,3 @@ /** @returns `T` if `T` is not a union type, `never` otherwise. */ | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const object = { a: 1 }; | ||
@@ -10,0 +10,0 @@ * |
@@ -6,6 +6,6 @@ /** | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1, 2, 3]; | ||
* | ||
* array.reduce(sum) === 6; | ||
* array.reduce(sum); // 6 | ||
* ``` | ||
@@ -24,6 +24,6 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1n, 2n, 3n]; | ||
* | ||
* array.reduce(sum) === 6n; | ||
* array.reduce(sum); // 6n | ||
* ``` | ||
@@ -42,6 +42,6 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1, 2, 3]; | ||
* | ||
* array.reduce(max) === 3; | ||
* array.reduce(max); // 3 | ||
* ``` | ||
@@ -60,6 +60,6 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [1, 2, 3]; | ||
* | ||
* array.reduce(min) === 1; | ||
* array.reduce(min); // 1 | ||
* ``` | ||
@@ -66,0 +66,0 @@ * |
@@ -5,3 +5,3 @@ /** | ||
* @example | ||
* ```ts | ||
* ```js | ||
* regExpUnion(/[a-z]/, /\d/); // /([a-z])|(\d)/ | ||
@@ -8,0 +8,0 @@ * ``` |
@@ -6,3 +6,3 @@ import { Comparable, CompareFn } from './sort'; | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [{ value: 2 }, { value: 3 }, { value: 1 }, { value: 3 }]; | ||
@@ -22,3 +22,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [5, 3, 2, 4, 1]; | ||
@@ -39,3 +39,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [{ value: 2 }, { value: 3 }, { value: 1 }, { value: 3 }]; | ||
@@ -54,3 +54,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const array = [5, 3, 2, 4, 1]; | ||
@@ -57,0 +57,0 @@ * |
@@ -13,6 +13,6 @@ /** A value that can be compared numerically using `<`, `>`, `<=`, or `>=`. */ | ||
* @example | ||
* ```ts | ||
* ```js | ||
* import { Sort } from '@jonahsnider/util'; | ||
* | ||
* const object = {a: 3, c: 1, b: 2}; | ||
* const object = { a: 3, c: 1, b: 2 }; | ||
* | ||
@@ -19,0 +19,0 @@ * Object.fromEntries(sortObject(object, Sort.ascending)); |
@@ -5,3 +5,3 @@ /** | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const stopwatch = new Stopwatch(); | ||
@@ -14,3 +14,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const stopwatch = Stopwatch.start(); | ||
@@ -28,3 +28,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const stopwatch = new Stopwatch(); | ||
@@ -48,3 +48,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const stopwatch = Stopwatch.start(); | ||
@@ -57,3 +57,3 @@ * ``` | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const stopwatch = new Stopwatch(); | ||
@@ -69,3 +69,3 @@ * | ||
* @example | ||
* ```ts | ||
* ```js | ||
* stopwatch.end(); | ||
@@ -72,0 +72,0 @@ * ``` |
@@ -5,6 +5,6 @@ /** | ||
* @example | ||
* ```ts | ||
* ```js | ||
* const value = 12.345; | ||
* | ||
* toDigits(value, 2) === 12.35; | ||
* toDigits(value, 2); // 12.35 | ||
* ``` | ||
@@ -11,0 +11,0 @@ * |
@@ -1,2 +0,2 @@ | ||
"use strict";function t(){return(t=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 e(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 r(t,r){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,r){if(t){if("string"==typeof t)return e(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)?e(t,void 0):void 0}}(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}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 n(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)}var o,a;function i(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]}Object.defineProperty(exports,"__esModule",{value:!0}),(o=exports.Rank||(exports.Rank={}))[o.Ace=1]="Ace",o[o.Two=2]="Two",o[o.Three=3]="Three",o[o.Four=4]="Four",o[o.Five=5]="Five",o[o.Six=6]="Six",o[o.Seven=7]="Seven",o[o.Eight=8]="Eight",o[o.Nine=9]="Nine",o[o.Ten=10]="Ten",o[o.Jack=11]="Jack",o[o.Queen=12]="Queen",o[o.King=13]="King",(a=exports.Suit||(exports.Suit={}))[a.Clubs=0]="Clubs",a[a.Diamonds=1]="Diamonds",a[a.Hearts=2]="Hearts",a[a.Spades=3]="Spades";var u,s,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}];function c(t){for(var e,n=t[0].map((function(t){return t.length})),o=r(t);!(e=o()).done;)for(var a=e.value,i=0;i<a.length;i++){var u=a[i].length;n[i]<u&&(n[i]=u)}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"}(u||(u={})),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"}(s||(s={}));var l={__proto__:null,get Status(){return u},get Method(){return s}};function d(t,e){return t+e}function f(t){var e=v(t);return t.map((function(t){return Math.pow(t-e,2)})).reduce(d)/(t.length-1)}function x(t,e,r){return 1/(e*Math.sqrt(2*Math.PI))*Math.pow(Math.E,-.5*Math.pow(t-r/e,2))}function v(t){var e=t.reduce(d);return e/("bigint"==typeof e?BigInt(t.length):t.length)}function h(t,e){return Math.random()*(e-t)+t}function S(t,e){return t<e?-1:t>e?1:0}function k(t,e){return t<e?1:t>e?-1:0}var m={__proto__:null,ascending:function(t,e){return void 0===e&&"function"==typeof t?function(e,r){return S(t(e),t(r))}:S(t,e)},descending:function(t,e){return void 0===e&&"function"==typeof t?function(e,r){return k(t(e),t(r))}:k(t,e)}},g=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.Http=l,exports.Sort=m,exports.Stopwatch=g,exports.allDuplicates=function(t){for(var e,n=new Set,o=[],a=r(t);!(e=a()).done;){var i=e.value;n.has(i)&&o.push(i),n.add(i)}return o},exports.binarySearch=function(t,e){for(var r=0,n=t.length-1;r<=n;){var o=Math.trunc((r+n)/2),a=e(t[o]);if(a<0)r=o+1;else{if(!(a>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]})):Array.from({length:Math.ceil(t.length/e)},(function(r,n){return t.slice(n*e,n*e+e)}))},exports.clamp=function(t,e,r){return t<e?e:t>r?r:t},exports.difference=function(t,e){for(var n,o=new Set(t),a=r(e);!(n=a()).done;)o.delete(n.value);return o},exports.duplicates=function(t){for(var e,n=new Set,o=new Set,a=r(t);!(e=a()).done;){var i=e.value;n.has(i)&&o.add(i),n.add(i)}return o},exports.first=function(t,e){var r=t[Symbol.iterator]();if(void 0===e)return r.next().value;for(var n=[],o=0;o<e;o++){var a=r.next();if(a.done)break;n.push(a.value)}return n},exports.formatTable=function(t,e){void 0===e&&(e=" ");var r=c(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,n=new Map,o=r(t);!(e=o()).done;){var a=e.value,i=n.get(a);n.set(a,i?i+1:1)}return n},exports.identical=function(t,e){if(t===e)return!0;if(Array.isArray(t))return t.length===e.length&&t.every((function(t,r){return t===e[r]}));if(t.size!==e.size)return!1;if(t instanceof Set){for(var n,o=r(t);!(n=o()).done;)if(!e.has(n.value))return!1}else if(t instanceof Map)for(var a,i=r(t.entries());!(a=i()).done;){var u=a.value,s=u[0],p=u[1];if(e.get(s)!==p||!e.has(s))return!1}return!0},exports.intersection=function(t,e){for(var n,o=new Set,a=i(t,e),u=a[1],s=r(a[0]);!(n=s()).done;){var p=n.value;u.has(p)&&o.add(p)}return o},exports.invert=function(t){return function(){return-t.apply(void 0,arguments)}},exports.isDisjoint=function(t,e){for(var n,o=new Set(t),a=r(e);!(n=a()).done;)if(o.has(n.value))return!1;return!0},exports.isSubset=function(t,e){for(var n,o=r(t);!(n=o()).done;)if(!e.has(n.value))return!1;return!0},exports.isSuperset=function(t,e){for(var n,o=r(e);!(n=o()).done;)if(!t.has(n.value))return!1;return!0},exports.largeToSmall=i,exports.max=function(t,e){return Math.max(t,e)},exports.maxColumnLength=c,exports.mean=v,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 Math.min(t,e)},exports.mode=function(t){for(var e,n=new Map,o=0,a=[],i=r(t);!(e=i()).done;){var u=e.value,s=n.get(u),p=void 0===s?1:s+1;n.set(u,p),p>o?(o=p,a=[u]):p===o&&a.push(u)}return a},exports.multiReplace=function(t,e){for(var n=Object.entries(e),o="",a=0;a<t.length;)t:do{for(var i,u=r(n);!(i=u()).done;){var s=i.value,p=s[0],c=s[1];if(t.slice(a).startsWith(p)){o+=c,a+=p.length;break t}}o+=t[a++]}while(0);return o},exports.newDeck=function(){return[].concat(p)},exports.normaldist=x,exports.not=function(t){return function(){return!t.apply(void 0,arguments)}},exports.nullish=function(t){return null==t},exports.partition=function(t,e){for(var n,o=[],a=[],i=0,u=r(t);!(n=u()).done;){var s=n.value;(e(s,i++)?o:a).push(s)}return[o,a]},exports.random=h,exports.randomInt=function(t,e){return Math.floor(h(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(e,r,o){var a;return r===o?t({},e):function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)e.indexOf(r=a[n])>=0||(o[r]=t[r]);return o}(t({},e,((a={})[o]=e[r],a)),[r].map(n))},exports.reverse=function(t){if(Array.isArray(t))return Array.from({length:t.length},(function(e,r){return t[t.length-(r+1)]}));for(var e,n=[],o=r(t);!(e=o()).done;)n.unshift(e.value);return n},exports.same=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var o=e.map((function(t){return t[Symbol.iterator]()})),a=function(){for(var t,e=o.map((function(t){return t.next()})),n=e[0],a=n.done,i=n.value,u=r(e);!(t=u()).done;){var s=t.value;if(s.done)return{v:e.every((function(t){return t.done===a}))};if(s.value!==i)return{v:!1}}};;){var i=a();if("object"==typeof i)return i.v}},exports.sample=function(t){return t[Math.floor(Math.random()*t.length)]},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)),a=[r[o],r[n]];r[n]=a[0],r[o]=a[1]}if(!e)return r},exports.sortObject=function(t,e){return Object.entries(t).sort((function(t,r){return e(t[1],r[1])}))},exports.standardNormaldist=function(t){return x(t,1,0)},exports.stddev=function(t){return Math.sqrt(f(t))},exports.sum=d,exports.symmetricDifference=function(t,e){for(var n,o=new Set(t),a=r(e);!(n=a()).done;){var i=n.value;o.has(i)?o.delete(i):o.add(i)}return o},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){for(var n,o=new Set(t),a=r(e);!(n=a()).done;)o.add(n.value);return o},exports.variance=f; | ||
"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,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 o(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 n(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)?n(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}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 i(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)}var a,u;function s(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]}Object.defineProperty(exports,"__esModule",{value:!0}),(a=exports.Rank||(exports.Rank={}))[a.Ace=1]="Ace",a[a.Two=2]="Two",a[a.Three=3]="Three",a[a.Four=4]="Four",a[a.Five=5]="Five",a[a.Six=6]="Six",a[a.Seven=7]="Seven",a[a.Eight=8]="Eight",a[a.Nine=9]="Nine",a[a.Ten=10]="Ten",a[a.Jack=11]="Jack",a[a.Queen=12]="Queen",a[a.King=13]="King",(u=exports.Suit||(exports.Suit={}))[u.Clubs=0]="Clubs",u[u.Diamonds=1]="Diamonds",u[u.Hearts=2]="Hearts",u[u.Spades=3]="Spades";var c,p,f=[{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}];function l(t){for(var e,r=t[0].map((function(t){return t.length})),n=o(t);!(e=n()).done;)for(var i=e.value,a=0;a<i.length;a++){var u=i[a].length;r[a]<u&&(r[a]=u)}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"}(c||(c={})),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"}(p||(p={}));var d,h={__proto__:null,get Status(){return c},get Method(){return p}},v=(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),x=v.mark(y);function y(){var t,e,r,n,o,i=arguments;return v.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()}}),x)}function m(t,e){return t+e}function g(t){var e=S(t);return t.map((function(t){return Math.pow(t-e,2)})).reduce(m)/(t.length-1)}function k(t,e,r){return 1/(e*Math.sqrt(2*Math.PI))*Math.pow(Math.E,-.5*Math.pow(t-r/e,2))}function S(t){var e=t.reduce(m);return e/("bigint"==typeof e?BigInt(t.length):t.length)}function b(t,e){return Math.random()*(e-t)+t}function w(){return(w=e(v.mark((function t(e){return v.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 R(t,e){return t<e?-1:t>e?1:0}function T(t,e){return t<e?1:t>e?-1:0}var E={__proto__:null,ascending:function(t,e){return void 0===e&&"function"==typeof t?function(e,r){return R(t(e),t(r))}:R(t,e)},descending:function(t,e){return void 0===e&&"function"==typeof t?function(e,r){return T(t(e),t(r))}:T(t,e)}},N=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.Http=h,exports.Sort=E,exports.Stopwatch=N,exports.allDuplicates=function(t){for(var e,r=new Set,n=[],i=o(t);!(e=i()).done;){var a=e.value;r.has(a)&&n.push(a),r.add(a)}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]})):Array.from({length:Math.ceil(t.length/e)},(function(r,n){return t.slice(n*e,n*e+e)}))},exports.clamp=function(t,e,r){return t<e?e:t>r?r:t},exports.combineIterables=y,exports.difference=function(t,e){for(var r,n=new Set(t),i=o(e);!(r=i()).done;)n.delete(r.value);return n},exports.duplicates=function(t){for(var e,r=new Set,n=new Set,i=o(t);!(e=i()).done;){var a=e.value;r.has(a)&&n.add(a),r.add(a)}return n},exports.every=function(t,e){for(var r,n=o(t);!(r=n()).done;)if(!e(r.value))return!1;return!0},exports.find=function(t,e){for(var r,n=o(t);!(r=n()).done;){var i=r.value;if(e(i))return i}},exports.first=function(t,e){var r=t[Symbol.iterator]();if(void 0===e)return r.next().value;for(var n=[],o=0;o<e;o++){var i=r.next();if(i.done)break;n.push(i.value)}return n},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=o(t);!(e=n()).done;){var i=e.value,a=r.get(i);r.set(i,a?a+1: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(t===e)return!0;if(Array.isArray(t))return t.length===e.length&&t.every((function(t,r){return t===e[r]}));if(t.size!==e.size)return!1;if(t instanceof Set){for(var r,n=o(t);!(r=n()).done;)if(!e.has(r.value))return!1}else if(t instanceof Map)for(var i,a=o(t.entries());!(i=a()).done;){var u=i.value,s=u[0],c=u[1];if(e.get(s)!==c||!e.has(s))return!1}return!0},exports.includes=function(t,e){for(var r,n=o(t);!(r=n()).done;)if(r.value===e)return!0;return!1},exports.intersection=function(t,e){for(var r,n=new Set,i=s(t,e),a=i[1],u=o(i[0]);!(r=u()).done;){var c=r.value;a.has(c)&&n.add(c)}return n},exports.invert=function(t){return function(){return-t.apply(void 0,arguments)}},exports.isDisjoint=function(t,e){for(var r,n=new Set(t),i=o(e);!(r=i()).done;)if(n.has(r.value))return!1;return!0},exports.isSubset=function(t,e){for(var r,n=o(t);!(r=n()).done;)if(!e.has(r.value))return!1;return!0},exports.isSuperset=function(t,e){for(var r,n=o(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=s,exports.max=function(t,e){return Math.max(t,e)},exports.maxColumnLength=l,exports.mean=S,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 Math.min(t,e)},exports.mode=function(t){for(var e,r=new Map,n=0,i=[],a=o(t);!(e=a()).done;){var u=e.value,s=r.get(u),c=void 0===s?1:s+1;r.set(u,c),c>n?(n=c,i=[u]):c===n&&i.push(u)}return i},exports.multiReplace=function(t,e){for(var r=Object.entries(e),n="",i=0;i<t.length;)t:do{for(var a,u=o(r);!(a=u()).done;){var s=a.value,c=s[0],p=s[1];if(t.slice(i).startsWith(c)){n+=p,i+=c.length;break t}}n+=t[i++]}while(0);return n},exports.newDeck=function(){return[].concat(f)},exports.normaldist=k,exports.not=function(t){return function(){return!t.apply(void 0,arguments)}},exports.nullish=function(t){return null==t},exports.partition=function(t,e){for(var r,n=[],i=[],a=0,u=o(t);!(r=u()).done;){var s=r.value;(e(s,a++)?n:i).push(s)}return[n,i]},exports.random=b,exports.randomInt=function(t,e){return Math.floor(b(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(i))},exports.reverse=function(t){if(Array.isArray(t))return Array.from({length:t.length},(function(e,r){return t[t.length-(r+1)]}));for(var e,r=[],n=o(t);!(e=n()).done;)r.unshift(e.value);return r},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]()})),i=function(){for(var t,e=n.map((function(t){return t.next()})),r=e[0],i=r.done,a=r.value,u=o(e);!(t=u()).done;){var s=t.value;if(s.done)return{v:e.every((function(t){return t.done===i}))};if(s.value!==a)return{v:!1}}};;){var a=i();if("object"==typeof a)return a.v}},exports.sample=function(t){return t[Math.floor(Math.random()*t.length)]},exports.settled=function(t){return w.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=o(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 k(t,1,0)},exports.stddev=function(t){return Math.sqrt(g(t))},exports.sum=m,exports.symmetricDifference=function(t,e){for(var r,n=new Set(t),i=o(e);!(r=i()).done;){var a=r.value;n.has(a)?n.delete(a):n.add(a)}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){for(var r,n=new Set(t),i=o(e);!(r=i()).done;)n.add(r.value);return n},exports.variance=g; | ||
//# sourceMappingURL=util.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self)["@jonahsnider/util"]={})}(this,(function(e){"use strict";function n(){return(n=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function r(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}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=e[Symbol.iterator]()).next.bind(r)}function i(e){var n=function(e,n){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof n?n:String(n)}var a,o;function u(e,n){var t=void 0;if("size"in e?t="size":"length"in e&&(t="length"),!t)throw new RangeError;return e[t]<n[t]?[n,e]:[e,n]}(a=e.Rank||(e.Rank={}))[a.Ace=1]="Ace",a[a.Two=2]="Two",a[a.Three=3]="Three",a[a.Four=4]="Four",a[a.Five=5]="Five",a[a.Six=6]="Six",a[a.Seven=7]="Seven",a[a.Eight=8]="Eight",a[a.Nine=9]="Nine",a[a.Ten=10]="Ten",a[a.Jack=11]="Jack",a[a.Queen=12]="Queen",a[a.King=13]="King",(o=e.Suit||(e.Suit={}))[o.Clubs=0]="Clubs",o[o.Diamonds=1]="Diamonds",o[o.Hearts=2]="Hearts",o[o.Spades=3]="Spades";var s,c,l=[{rank:e.Rank.Ace,suit:e.Suit.Clubs},{rank:e.Rank.Two,suit:e.Suit.Clubs},{rank:e.Rank.Three,suit:e.Suit.Clubs},{rank:e.Rank.Four,suit:e.Suit.Clubs},{rank:e.Rank.Five,suit:e.Suit.Clubs},{rank:e.Rank.Six,suit:e.Suit.Clubs},{rank:e.Rank.Seven,suit:e.Suit.Clubs},{rank:e.Rank.Eight,suit:e.Suit.Clubs},{rank:e.Rank.Nine,suit:e.Suit.Clubs},{rank:e.Rank.Ten,suit:e.Suit.Clubs},{rank:e.Rank.Jack,suit:e.Suit.Clubs},{rank:e.Rank.Queen,suit:e.Suit.Clubs},{rank:e.Rank.King,suit:e.Suit.Clubs},{rank:e.Rank.Ace,suit:e.Suit.Diamonds},{rank:e.Rank.Two,suit:e.Suit.Diamonds},{rank:e.Rank.Three,suit:e.Suit.Diamonds},{rank:e.Rank.Four,suit:e.Suit.Diamonds},{rank:e.Rank.Five,suit:e.Suit.Diamonds},{rank:e.Rank.Six,suit:e.Suit.Diamonds},{rank:e.Rank.Seven,suit:e.Suit.Diamonds},{rank:e.Rank.Eight,suit:e.Suit.Diamonds},{rank:e.Rank.Nine,suit:e.Suit.Diamonds},{rank:e.Rank.Ten,suit:e.Suit.Diamonds},{rank:e.Rank.Jack,suit:e.Suit.Diamonds},{rank:e.Rank.Queen,suit:e.Suit.Diamonds},{rank:e.Rank.King,suit:e.Suit.Diamonds},{rank:e.Rank.Ace,suit:e.Suit.Hearts},{rank:e.Rank.Two,suit:e.Suit.Hearts},{rank:e.Rank.Three,suit:e.Suit.Hearts},{rank:e.Rank.Four,suit:e.Suit.Hearts},{rank:e.Rank.Five,suit:e.Suit.Hearts},{rank:e.Rank.Six,suit:e.Suit.Hearts},{rank:e.Rank.Seven,suit:e.Suit.Hearts},{rank:e.Rank.Eight,suit:e.Suit.Hearts},{rank:e.Rank.Nine,suit:e.Suit.Hearts},{rank:e.Rank.Ten,suit:e.Suit.Hearts},{rank:e.Rank.Jack,suit:e.Suit.Hearts},{rank:e.Rank.Queen,suit:e.Suit.Hearts},{rank:e.Rank.King,suit:e.Suit.Hearts},{rank:e.Rank.Ace,suit:e.Suit.Spades},{rank:e.Rank.Two,suit:e.Suit.Spades},{rank:e.Rank.Three,suit:e.Suit.Spades},{rank:e.Rank.Four,suit:e.Suit.Spades},{rank:e.Rank.Five,suit:e.Suit.Spades},{rank:e.Rank.Six,suit:e.Suit.Spades},{rank:e.Rank.Seven,suit:e.Suit.Spades},{rank:e.Rank.Eight,suit:e.Suit.Spades},{rank:e.Rank.Nine,suit:e.Suit.Spades},{rank:e.Rank.Ten,suit:e.Suit.Spades},{rank:e.Rank.Jack,suit:e.Suit.Spades},{rank:e.Rank.Queen,suit:e.Suit.Spades},{rank:e.Rank.King,suit:e.Suit.Spades}];function f(e){for(var n,t=e[0].map((function(e){return e.length})),i=r(e);!(n=i()).done;)for(var a=n.value,o=0;o<a.length;o++){var u=a[o].length;t[o]<u&&(t[o]=u)}return t}!function(e){e[e.Continue=100]="Continue",e[e.SwitchingProtocols=101]="SwitchingProtocols",e[e.EarlyHints=103]="EarlyHints",e[e.Ok=200]="Ok",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",e[e.NoContent=204]="NoContent",e[e.ResetContent=205]="ResetContent",e[e.PartialContent=206]="PartialContent",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.Found=302]="Found",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.LengthRequired=411]="LengthRequired",e[e.PreconditionFailed=412]="PreconditionFailed",e[e.PayloadTooLarge=413]="PayloadTooLarge",e[e.UriTooLong=414]="UriTooLong",e[e.UnsupportedMediaType=415]="UnsupportedMediaType",e[e.RangeNotSatisfiable=416]="RangeNotSatisfiable",e[e.ExpectationFailed=417]="ExpectationFailed",e[e.ImATeapot=418]="ImATeapot",e[e.UnprocessableEntity=422]="UnprocessableEntity",e[e.TooEarly=425]="TooEarly",e[e.UpgradeRequired=426]="UpgradeRequired",e[e.PreconditionRequired=428]="PreconditionRequired",e[e.TooManyRequests=429]="TooManyRequests",e[e.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",e[e.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout",e[e.HttpVersionNotSupported=505]="HttpVersionNotSupported",e[e.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",e[e.InsufficientStorage=507]="InsufficientStorage",e[e.LoopDetected=508]="LoopDetected",e[e.NotExtended=510]="NotExtended",e[e.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired"}(s||(s={})),function(e){e.Get="GET",e.Head="HEAD",e.Post="POST",e.Put="PUT",e.Delete="DELETE",e.Connect="CONNECT",e.Options="OPTIONS",e.Trace="TRACE",e.Patch="PATCH"}(c||(c={}));var d={__proto__:null,get Status(){return s},get Method(){return c}};function v(e,n){return e+n}function h(e){var n=S(e);return e.map((function(e){return Math.pow(e-n,2)})).reduce(v)/(e.length-1)}function p(e,n,t){return 1/(n*Math.sqrt(2*Math.PI))*Math.pow(Math.E,-.5*Math.pow(e-t/n,2))}function S(e){var n=e.reduce(v);return n/("bigint"==typeof n?BigInt(e.length):e.length)}function k(e,n){return Math.random()*(n-e)+e}function m(e,n){return e<n?-1:e>n?1:0}function g(e,n){return e<n?1:e>n?-1:0}var R={__proto__:null,ascending:function(e,n){return void 0===n&&"function"==typeof e?function(n,t){return m(e(n),e(t))}:m(e,n)},descending:function(e,n){return void 0===n&&"function"==typeof e?function(n,t){return g(e(n),e(t))}:g(e,n)}},y=function(){function e(){}e.start=function(){var e=new this;return e.start(),e};var n,t=e.prototype;return t.start=function(){this.startTime=process.hrtime.bigint()},t.end=function(){return Number(process.hrtime.bigint()-this.startTime)/1e6},(n=[{key:"started",get:function(){return void 0!==this.startTime}}])&&function(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,n),e}();e.Http=d,e.Sort=R,e.Stopwatch=y,e.allDuplicates=function(e){for(var n,t=new Set,i=[],a=r(e);!(n=a()).done;){var o=n.value;t.has(o)&&i.push(o),t.add(o)}return i},e.binarySearch=function(e,n){for(var t=0,r=e.length-1;t<=r;){var i=Math.trunc((t+r)/2),a=n(e[i]);if(a<0)t=i+1;else{if(!(a>0))return e[i];r=i-1}}},e.capitalize=function(e){var n=e.charAt(0).toUpperCase();return""+n+e.slice(n.length)},e.chunk=function(e,n){return e.length===n?e.map((function(e){return[e]})):Array.from({length:Math.ceil(e.length/n)},(function(t,r){return e.slice(r*n,r*n+n)}))},e.clamp=function(e,n,t){return e<n?n:e>t?t:e},e.difference=function(e,n){for(var t,i=new Set(e),a=r(n);!(t=a()).done;)i.delete(t.value);return i},e.duplicates=function(e){for(var n,t=new Set,i=new Set,a=r(e);!(n=a()).done;){var o=n.value;t.has(o)&&i.add(o),t.add(o)}return i},e.first=function(e,n){var t=e[Symbol.iterator]();if(void 0===n)return t.next().value;for(var r=[],i=0;i<n;i++){var a=t.next();if(a.done)break;r.push(a.value)}return r},e.formatTable=function(e,n){void 0===n&&(n=" ");var t=f(e);return e.map((function(e){return e.map((function(e,n){return e.padEnd(t[n])})).join(n)})).join("\n")},e.frequencyTable=function(e){for(var n,t=new Map,i=r(e);!(n=i()).done;){var a=n.value,o=t.get(a);t.set(a,o?o+1:1)}return t},e.identical=function(e,n){if(e===n)return!0;if(Array.isArray(e))return e.length===n.length&&e.every((function(e,t){return e===n[t]}));if(e.size!==n.size)return!1;if(e instanceof Set){for(var t,i=r(e);!(t=i()).done;)if(!n.has(t.value))return!1}else if(e instanceof Map)for(var a,o=r(e.entries());!(a=o()).done;){var u=a.value,s=u[0],c=u[1];if(n.get(s)!==c||!n.has(s))return!1}return!0},e.intersection=function(e,n){for(var t,i=new Set,a=u(e,n),o=a[1],s=r(a[0]);!(t=s()).done;){var c=t.value;o.has(c)&&i.add(c)}return i},e.invert=function(e){return function(){return-e.apply(void 0,arguments)}},e.isDisjoint=function(e,n){for(var t,i=new Set(e),a=r(n);!(t=a()).done;)if(i.has(t.value))return!1;return!0},e.isSubset=function(e,n){for(var t,i=r(e);!(t=i()).done;)if(!n.has(t.value))return!1;return!0},e.isSuperset=function(e,n){for(var t,i=r(n);!(t=i()).done;)if(!e.has(t.value))return!1;return!0},e.largeToSmall=u,e.max=function(e,n){return Math.max(e,n)},e.maxColumnLength=f,e.mean=S,e.median=function(e){var n=e.length/2;return e.length%2==0?(e[n-1]+e[n])/("bigint"==typeof e[0]?2n:2):e[Math.floor(n)]},e.min=function(e,n){return Math.min(e,n)},e.mode=function(e){for(var n,t=new Map,i=0,a=[],o=r(e);!(n=o()).done;){var u=n.value,s=t.get(u),c=void 0===s?1:s+1;t.set(u,c),c>i?(i=c,a=[u]):c===i&&a.push(u)}return a},e.multiReplace=function(e,n){for(var t=Object.entries(n),i="",a=0;a<e.length;)e:do{for(var o,u=r(t);!(o=u()).done;){var s=o.value,c=s[0],l=s[1];if(e.slice(a).startsWith(c)){i+=l,a+=c.length;break e}}i+=e[a++]}while(0);return i},e.newDeck=function(){return[].concat(l)},e.normaldist=p,e.not=function(e){return function(){return!e.apply(void 0,arguments)}},e.nullish=function(e){return null==e},e.partition=function(e,n){for(var t,i=[],a=[],o=0,u=r(e);!(t=u()).done;){var s=t.value;(n(s,o++)?i:a).push(s)}return[i,a]},e.random=k,e.randomInt=function(e,n){return Math.floor(k(Math.ceil(e),Math.floor(n)))},e.regExpUnion=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return new RegExp(n.map((function(e){return"("+e.source+")"})).join("|"))},e.rename=function(e,t,r){var a;return t===r?n({},e):function(e,n){if(null==e)return{};var t,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n.indexOf(t=a[r])>=0||(i[t]=e[t]);return i}(n({},e,((a={})[r]=e[t],a)),[t].map(i))},e.reverse=function(e){if(Array.isArray(e))return Array.from({length:e.length},(function(n,t){return e[e.length-(t+1)]}));for(var n,t=[],i=r(e);!(n=i()).done;)t.unshift(n.value);return t},e.same=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];for(var i=n.map((function(e){return e[Symbol.iterator]()})),a=function(){for(var e,n=i.map((function(e){return e.next()})),t=n[0],a=t.done,o=t.value,u=r(n);!(e=u()).done;){var s=e.value;if(s.done)return{v:n.every((function(e){return e.done===a}))};if(s.value!==o)return{v:!1}}};;){var o=a();if("object"==typeof o)return o.v}},e.sample=function(e){return e[Math.floor(Math.random()*e.length)]},e.shuffle=function(e,n){void 0===n&&(n=!0);for(var t=n?e:[].concat(e),r=t.length-1;r>0;r--){var i=Math.floor(Math.random()*(r+1)),a=[t[i],t[r]];t[r]=a[0],t[i]=a[1]}if(!n)return t},e.sortObject=function(e,n){return Object.entries(e).sort((function(e,t){return n(e[1],t[1])}))},e.standardNormaldist=function(e){return p(e,1,0)},e.stddev=function(e){return Math.sqrt(h(e))},e.sum=v,e.symmetricDifference=function(e,n){for(var t,i=new Set(e),a=r(n);!(t=a()).done;){var o=t.value;i.has(o)?i.delete(o):i.add(o)}return i},e.toDigits=function(e,n){var t=Math.pow(10,n);return Math.round(e*t*(1+Number.EPSILON))/t},e.truncate=function(e,n,t){return void 0===t&&(t=""),e.length>n?""+e.slice(0,n)+t:e},e.uncapitalize=function(e){var n=e.charAt(0).toLowerCase();return""+n+e.slice(n.length)},e.union=function(e,n){for(var t,i=new Set(e),a=r(n);!(t=a()).done;)i.add(t.value);return i},e.variance=h,Object.defineProperty(e,"__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,i,o,a){try{var u=t[o](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,i)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=t.apply(n,r);function u(t){e(a,i,o,u,c,"next",t)}function c(t){e(a,i,o,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 i(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 o(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 i(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)?i(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 a(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 u,c;function s(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]}(u=t.Rank||(t.Rank={}))[u.Ace=1]="Ace",u[u.Two=2]="Two",u[u.Three=3]="Three",u[u.Four=4]="Four",u[u.Five=5]="Five",u[u.Six=6]="Six",u[u.Seven=7]="Seven",u[u.Eight=8]="Eight",u[u.Nine=9]="Nine",u[u.Ten=10]="Ten",u[u.Jack=11]="Jack",u[u.Queen=12]="Queen",u[u.King=13]="King",(c=t.Suit||(t.Suit={}))[c.Clubs=0]="Clubs",c[c.Diamonds=1]="Diamonds",c[c.Hearts=2]="Hearts",c[c.Spades=3]="Spades";var f,l,d=[{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}];function h(t){for(var e,n=t[0].map((function(t){return t.length})),r=o(t);!(e=r()).done;)for(var i=e.value,a=0;a<i.length;a++){var u=i[a].length;n[a]<u&&(n[a]=u)}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"}(f||(f={})),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"}(l||(l={}));var v={__proto__:null,get Status(){return f},get Method(){return l}},p=function(t,e){return function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=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 i=Object.create((e&&e.prototype instanceof l?e:l).prototype),o=new R(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){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,o),i}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 d(){}function h(){}var v={};v[i]=function(){return this};var p=Object.getPrototypeOf,y=p&&p(p(x([])));y&&y!==e&&n.call(y,i)&&(v=y);var m=h.prototype=l.prototype=Object.create(v);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(i,o){function a(){return new e((function(r,a){!function r(i,o,a,u){var c=s(t[i],t,o);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)}(i,o,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 i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(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[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=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 o.next=o}}return{next:T}}function T(){return{value:void 0,done:!0}}return d.prototype=m.constructor=h,h.constructor=d,d.displayName=u(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,u(t,a,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(k.prototype),k.prototype[o]=function(){return this},t.AsyncIterator=k,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new k(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),u(m,a,"Generator"),m[i]=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 i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.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 i=r.arg;w(n)}return i}}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}(),y=p.mark(m);function m(){var t,e,n,r,i,o=arguments;return p.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:for(t=o.length,e=new Array(t),n=0;n<t;n++)e[n]=o[n];r=0,i=e;case 2:if(!(r<i.length)){a.next=8;break}return a.delegateYield(i[r],"t0",5);case 5:r++,a.next=2;break;case 8:case"end":return a.stop()}}),y)}function g(t,e){return t+e}function k(t){var e=b(t);return t.map((function(t){return Math.pow(t-e,2)})).reduce(g)/(t.length-1)}function S(t,e,n){return 1/(e*Math.sqrt(2*Math.PI))*Math.pow(Math.E,-.5*Math.pow(t-n/e,2))}function b(t){var e=t.reduce(g);return e/("bigint"==typeof e?BigInt(t.length):t.length)}function w(t,e){return Math.random()*(e-t)+t}function R(){return(R=n(p.mark((function t(e){return p.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 x(t,e){return t<e?-1:t>e?1:0}function T(t,e){return t<e?1:t>e?-1:0}var E={__proto__:null,ascending:function(t,e){return void 0===e&&"function"==typeof t?function(e,n){return x(t(e),t(n))}:x(t,e)},descending:function(t,e){return void 0===e&&"function"==typeof t?function(e,n){return T(t(e),t(n))}:T(t,e)}},N=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.Http=v,t.Sort=E,t.Stopwatch=N,t.allDuplicates=function(t){for(var e,n=new Set,r=[],i=o(t);!(e=i()).done;){var a=e.value;n.has(a)&&r.push(a),n.add(a)}return r},t.binarySearch=function(t,e){for(var n=0,r=t.length-1;n<=r;){var i=Math.trunc((n+r)/2),o=e(t[i]);if(o<0)n=i+1;else{if(!(o>0))return t[i];r=i-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]})):Array.from({length:Math.ceil(t.length/e)},(function(n,r){return t.slice(r*e,r*e+e)}))},t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.combineIterables=m,t.difference=function(t,e){for(var n,r=new Set(t),i=o(e);!(n=i()).done;)r.delete(n.value);return r},t.duplicates=function(t){for(var e,n=new Set,r=new Set,i=o(t);!(e=i()).done;){var a=e.value;n.has(a)&&r.add(a),n.add(a)}return r},t.every=function(t,e){for(var n,r=o(t);!(n=r()).done;)if(!e(n.value))return!1;return!0},t.find=function(t,e){for(var n,r=o(t);!(n=r()).done;){var i=n.value;if(e(i))return i}},t.first=function(t,e){var n=t[Symbol.iterator]();if(void 0===e)return n.next().value;for(var r=[],i=0;i<e;i++){var o=n.next();if(o.done)break;r.push(o.value)}return r},t.formatTable=function(t,e){void 0===e&&(e=" ");var n=h(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=o(t);!(e=r()).done;){var i=e.value,a=n.get(i);n.set(i,a?a+1: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(t===e)return!0;if(Array.isArray(t))return t.length===e.length&&t.every((function(t,n){return t===e[n]}));if(t.size!==e.size)return!1;if(t instanceof Set){for(var n,r=o(t);!(n=r()).done;)if(!e.has(n.value))return!1}else if(t instanceof Map)for(var i,a=o(t.entries());!(i=a()).done;){var u=i.value,c=u[0],s=u[1];if(e.get(c)!==s||!e.has(c))return!1}return!0},t.includes=function(t,e){for(var n,r=o(t);!(n=r()).done;)if(n.value===e)return!0;return!1},t.intersection=function(t,e){for(var n,r=new Set,i=s(t,e),a=i[1],u=o(i[0]);!(n=u()).done;){var c=n.value;a.has(c)&&r.add(c)}return r},t.invert=function(t){return function(){return-t.apply(void 0,arguments)}},t.isDisjoint=function(t,e){for(var n,r=new Set(t),i=o(e);!(n=i()).done;)if(r.has(n.value))return!1;return!0},t.isSubset=function(t,e){for(var n,r=o(t);!(n=r()).done;)if(!e.has(n.value))return!1;return!0},t.isSuperset=function(t,e){for(var n,r=o(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](),i=r.next();;){var o=i;if(i=r.next(),n+=o.value,i.done)return n;n+=e}},t.largeToSmall=s,t.max=function(t,e){return Math.max(t,e)},t.maxColumnLength=h,t.mean=b,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 Math.min(t,e)},t.mode=function(t){for(var e,n=new Map,r=0,i=[],a=o(t);!(e=a()).done;){var u=e.value,c=n.get(u),s=void 0===c?1:c+1;n.set(u,s),s>r?(r=s,i=[u]):s===r&&i.push(u)}return i},t.multiReplace=function(t,e){for(var n=Object.entries(e),r="",i=0;i<t.length;)t:do{for(var a,u=o(n);!(a=u()).done;){var c=a.value,s=c[0],f=c[1];if(t.slice(i).startsWith(s)){r+=f,i+=s.length;break t}}r+=t[i++]}while(0);return r},t.newDeck=function(){return[].concat(d)},t.normaldist=S,t.not=function(t){return function(){return!t.apply(void 0,arguments)}},t.nullish=function(t){return null==t},t.partition=function(t,e){for(var n,r=[],i=[],a=0,u=o(t);!(n=u()).done;){var c=n.value;(e(c,a++)?r:i).push(c)}return[r,i]},t.random=w,t.randomInt=function(t,e){return Math.floor(w(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 i;return e===n?r({},t):function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)e.indexOf(n=o[r])>=0||(i[n]=t[n]);return i}(r({},t,((i={})[n]=t[e],i)),[e].map(a))},t.reverse=function(t){if(Array.isArray(t))return Array.from({length:t.length},(function(e,n){return t[t.length-(n+1)]}));for(var e,n=[],r=o(t);!(e=r()).done;)n.unshift(e.value);return n},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]()})),i=function(){for(var t,e=r.map((function(t){return t.next()})),n=e[0],i=n.done,a=n.value,u=o(e);!(t=u()).done;){var c=t.value;if(c.done)return{v:e.every((function(t){return t.done===i}))};if(c.value!==a)return{v:!1}}};;){var a=i();if("object"==typeof a)return a.v}},t.sample=function(t){return t[Math.floor(Math.random()*t.length)]},t.settled=function(t){return R.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 i=Math.floor(Math.random()*(r+1)),o=[n[i],n[r]];n[r]=o[0],n[i]=o[1]}if(!e)return n},t.some=function(t,e){for(var n,r=o(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 S(t,1,0)},t.stddev=function(t){return Math.sqrt(k(t))},t.sum=g,t.symmetricDifference=function(t,e){for(var n,r=new Set(t),i=o(e);!(n=i()).done;){var a=n.value;r.has(a)?r.delete(a):r.add(a)}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){for(var n,r=new Set(t),i=o(e);!(n=i()).done;)r.add(n.value);return r},t.variance=k,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=util.umd.production.min.js.map |
@@ -9,15 +9,15 @@ { | ||
"devDependencies": { | ||
"@size-limit/preset-small-lib": "4.12.0", | ||
"@typescript-eslint/eslint-plugin": "4.28.0", | ||
"@typescript-eslint/parser": "4.28.0", | ||
"@size-limit/preset-small-lib": "5.0.1", | ||
"@typescript-eslint/eslint-plugin": "4.28.4", | ||
"@typescript-eslint/parser": "4.28.4", | ||
"eslint-plugin-prettier": "3.4.0", | ||
"eslint-plugin-tsdoc": "0.2.14", | ||
"prettier": "2.3.1", | ||
"prettier-config-xo": "1.0.4", | ||
"prettier": "2.3.2", | ||
"prettier-config-xo": "2.0.0", | ||
"semantic-release": "17.4.4", | ||
"size-limit": "4.12.0", | ||
"size-limit": "5.0.1", | ||
"tsd": "0.17.0", | ||
"tsdx": "0.14.1", | ||
"tslib": "2.3.0", | ||
"typedoc": "0.21.0", | ||
"typedoc": "0.21.4", | ||
"typescript": "4.2.4" | ||
@@ -62,3 +62,3 @@ }, | ||
{ | ||
"limit": "5 kB", | ||
"limit": "9 kB", | ||
"path": "dist/util.cjs.production.min.js", | ||
@@ -68,3 +68,3 @@ "webpack": false | ||
{ | ||
"limit": "12 kB", | ||
"limit": "25 kB", | ||
"path": "dist/util.esm.mjs", | ||
@@ -75,3 +75,3 @@ "webpack": false | ||
"typings": "dist/index.d.ts", | ||
"version": "4.1.0" | ||
"version": "4.2.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
967544
37
10005