{"version":3,"file":"common-stuff.cjs","sources":["../src/array.ts","../src/files.ts","../src/guards.ts","../src/string.ts","../src/object.ts","../src/encoding.ts","../src/http/codes.ts","../src/http/errors.ts","../src/http/html.ts","../src/fp.ts","../src/random.ts","../src/cache.ts","../src/logging.ts","../src/async.ts","../src/http/helpers.ts"],"sourcesContent":["import { hashCode, ensureArray } from '.'\n\n/**\n * Creates sort callback which can be used for `array.sort` input.\n * A custom key function can be supplied to customize the sort order.\n * Key can return any nested data structure, supports number, booleans, arrays.\n *\n * @example\n * ```\n * // Sort by object key\n * arr.sort(sortByCb(v => v.myKey))\n * // Sort by number in reversed order\n * arr.sort(sortByCb(v => v.numberKey * -1))\n * // Sort by object key, then by boolean value in revered order\n * arr.sort(sortByCb(v => [v.myKey, !v.boolValue])\n * ```\n * @group Array\n * @param key a function to execute to decide the order\n * @returns `array.sort` compatible callback\n */\nexport function sortByCb<T>(\n    key: (item: T) => unknown = (v) => v,\n): (a: T, b: T) => number {\n    return (a, b) => {\n        const doCompare = (keyA: unknown, keyB: unknown): number => {\n            if (typeof keyA === 'number' && typeof keyB === 'number') {\n                return keyA < keyB ? -1 : keyA > keyB ? 1 : 0\n            }\n\n            if (typeof keyA === 'boolean' && typeof keyB === 'boolean') {\n                return keyA < keyB ? -1 : keyA > keyB ? 1 : 0\n            }\n\n            if (keyA instanceof Date && keyB instanceof Date) {\n                return doCompare(keyA.getTime(), keyB.getTime())\n            }\n\n            if (keyA instanceof Array && keyB instanceof Array) {\n                const res = keyA\n                    .map((v, i) => doCompare(v, keyB[i]))\n                    .filter((v) => v !== 0)\n                return res[0] ?? 1\n            }\n\n            const stringA = String(keyA)\n            const stringB = String(keyB)\n\n            return stringA < stringB ? -1 : stringA > stringB ? 1 : 0\n        }\n\n        return doCompare(key(a), key(b))\n    }\n}\n\n/**\n * Stable sort using provided callback without modifications.\n * A custom key function can be supplied to customize the sort order.\n * Key can return any nested data structure, supports number, booleans, arrays, objects.\n *\n * @example\n * ```\n * // Sort by object key\n * sortBy(arr, v => v.myKey))\n * // Sort by number in reversed order\n * sortBy(arr, v => v.numberKey * -1))\n * // Sort by object key, then by boolean value in revered order\n * sortBy(arr, v => [v.myKey, !v.boolValue])\n * ```\n * @group Array\n * @param arr any array\n * @param key a function to execute to decide the order\n * @returns sorted array copy\n */\nexport function sortBy<T>(arr: T[], key?: (item: T) => unknown): T[]\nexport function sortBy<T>(\n    arr: readonly T[],\n    key?: (item: T) => unknown,\n): readonly T[]\nexport function sortBy<T, A extends ReadonlyArray<T>>(\n    arr: A,\n    key: (item: T) => unknown = (v) => v,\n): A {\n    return arr\n        .map((v, i) => [v, i] as const)\n        .sort(sortByCb(([v, i]) => [key(v), i]))\n        .map((v) => v[0]) as unknown as A\n}\n\n/**\n * Return an object that produces a array of numbers from start (inclusive) to stop (exclusive) by step.\n *\n * @example\n * ```\n * >>> generateRange(4)\n * [0, 1, 2, 3]\n * >>> generateRange(3,6)\n * [3, 4, 5]\n * >>> generateRange(0,10,2)\n * [0, 2, 4, 6, 8]\n * >>> generateRange(10,0,-1)\n * [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]\n * >>> generateRange(8,2,-2)\n * [8, 6, 4]\n * ```\n * @group Array\n * @param stop an integer number specifying at which position to stop (not included)\n * @returns generated array by range\n */\nexport function generateRange(stop: number): number[]\n/**\n * Return an object that produces a array of numbers from start (inclusive) to stop (exclusive) by step.\n *\n * @example\n * ```\n * >>> generateRange(4)\n * [0, 1, 2, 3]\n * >>> generateRange(3,6)\n * [3, 4, 5]\n * >>> generateRange(0,10,2)\n * [0, 2, 4, 6, 8]\n * >>> generateRange(10,0,-1)\n * [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]\n * >>> generateRange(8,2,-2)\n * [8, 6, 4]\n * ```\n * @group Array\n * @param start an integer number specifying at which position to start\n * @param stop an integer number specifying at which position to stop (not included)\n * @param step an integer number specifying the incrementation\n * @returns generated array by range\n */\nexport function generateRange(\n    start: number,\n    stop: number,\n    step?: number,\n): number[]\nexport function generateRange(\n    start: number,\n    stop?: number,\n    step?: number,\n): number[] {\n    if (stop === undefined) {\n        stop = start\n        start = 0\n    }\n\n    if (step === undefined) {\n        step = 1\n    }\n\n    if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) {\n        return []\n    }\n\n    const result = []\n    for (let i = start; step > 0 ? i < stop : i > stop; i += step) {\n        result.push(i)\n    }\n\n    return result\n}\n\n/**\n * Calls a defined callback function on each element of an array. Then, flattens the result into\n * a new array.\n * This is identical to a map followed by flat with depth 1.\n *\n * Use [Array.flatMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap) if possible or polyfill globally:\n *\n * ```\n * Array.prototype.flatMap = function(callback) {\n *     return flatMap(this, callback)\n * }\n * ```\n *\n * @example\n * ```\n * const arr1 = [1, 2, 3, 4]\n *\n * arr1.map(x => [x * 2])\n * // [[2], [4], [6], [8]]\n *\n * flatMap(arr1, x => [x * 2])\n * // [2, 4, 6, 8]\n *\n * // only one level is flattened\n * flatMap(arr1, x => [[x * 2]])\n * // [[2], [4], [6], [8]]\n * ```\n * @group Array\n * @tutorial https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap\n * @param array any array\n * @param callback A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array.\n */\nexport function flatMap<T, U>(\n    array: T[],\n    callback: (item: T, index: number, array: T[]) => U | readonly U[],\n): U[]\nexport function flatMap<T, U>(\n    array: readonly T[],\n    callback: (item: T, index: number, array: readonly T[]) => U | readonly U[],\n): readonly U[]\nexport function flatMap<T, U>(\n    array: readonly T[],\n    callback: (item: T, index: number, array: T[]) => U | readonly U[],\n): readonly U[] {\n    return array.reduce(\n        (acc, v, index) => acc.concat(callback(v, index, array as T[])),\n        [] as U[],\n    )\n}\n\ntype FlatArray<Arr, Depth extends number> = {\n    done: Arr\n    recur: Arr extends ReadonlyArray<infer InnerArr>\n        ? FlatArray<\n              InnerArr,\n              [\n                  -1,\n                  0,\n                  1,\n                  2,\n                  3,\n                  4,\n                  5,\n                  6,\n                  7,\n                  8,\n                  9,\n                  10,\n                  11,\n                  12,\n                  13,\n                  14,\n                  15,\n                  16,\n                  17,\n                  18,\n                  19,\n                  20,\n              ][Depth]\n          >\n        : Arr\n}[Depth extends -1 ? 'done' : 'recur']\n\n/**\n * Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.\n *\n * Use [Array.flat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) if possible or polyfill globally:\n *\n * ```\n * Array.prototype.flat = function(depth) {\n *     return flatten(this, depth)\n * }\n * ```\n *\n * @example\n * ```\n * flatten([1, 2, [3, 4]])\n * // [1, 2, 3, 4]\n *\n * flatten([1, 2, [3, 4, [5, 6]]])\n * // [1, 2, 3, 4, [5, 6]]\n *\n * flatten([1, 2, [3, 4, [5, 6]]], 2)\n * // [1, 2, 3, 4, 5, 6]\n * ```\n * @group Array\n * @tutorial https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\n * @param depth The maximum recursion depth\n */\nexport function flatten<A extends unknown[], D extends number = 1>(\n    array: A,\n    depth?: D,\n): FlatArray<A, D>[]\nexport function flatten<A extends readonly unknown[], D extends number = 1>(\n    array: A,\n    depth?: D,\n): readonly FlatArray<A, D>[]\nexport function flatten<A extends readonly unknown[], D extends number = 1>(\n    array: A,\n    depth?: D,\n): FlatArray<A, D>[] {\n    const d = depth ?? 1\n\n    if (d > 0) {\n        return array.reduce<unknown[]>(\n            (acc, val) =>\n                acc.concat(val instanceof Array ? flatten(val, d - 1) : val),\n            [],\n        ) as FlatArray<A, D>[]\n    }\n\n    return array.slice() as FlatArray<A, D>[]\n}\n\n/**\n * Splits an array into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.\n *\n * @example\n * ```\n * chunk([1, 2, 3, 4, 5], 2)\n * // [[1, 2], [3, 4], [5]]\n * ```\n * @param size Chunk maximum size\n * @group Array\n */\nexport function chunk<T>(array: T[], size: number): T[][]\nexport function chunk<T>(\n    array: ReadonlyArray<T>,\n    size: number,\n): ReadonlyArray<ReadonlyArray<T>>\nexport function chunk<T>(array: ReadonlyArray<T>, size: number): T[][] {\n    return array.reduce((acc, _, i) => {\n        if (i % size === 0) {\n            acc.push(array.slice(i, i + size))\n        }\n        return acc\n    }, [] as T[][])\n}\n\n/**\n * Groups an array based on callback return value\n *\n * @example\n * ```\n * groupBy([6.1, 4.2, 6.3], Math.floor)\n * // [ [4, [4.2]], [6, [6.1, 6.3]] ]\n *\n * groupBy(['one', 'two', 'three'], v => [v.length, v.includes('a')])\n * // [ [[5, false], ['three']], [[3, false], ['one', 'two']] ]\n * ```\n * @group Array\n */\nexport function groupBy<T, G>(\n    array: T[],\n    keyCallback: (value: T) => G,\n): [G, T[]][]\nexport function groupBy<T, G>(\n    array: ReadonlyArray<T>,\n    keyCallback: (value: T) => G,\n): ReadonlyArray<[G, T[]]>\nexport function groupBy<T, G>(\n    array: ReadonlyArray<T>,\n    keyCallback: (value: T) => G,\n): [G, T[]][] {\n    return Object.values(\n        array.reduce(\n            (prev, cur) => {\n                const key = keyCallback(cur)\n                const keyHash = hashCode(keyCallback(cur))\n\n                if (keyHash in prev) {\n                    prev[keyHash]?.[1].push(cur)\n                } else {\n                    prev[keyHash] = [key, [cur]]\n                }\n\n                return prev\n            },\n            {} as Record<number, [G, T[]]>,\n        ),\n    )\n}\n\n/**\n * Creates indexed object by provided callback.\n *\n * If array is returned, creates a separate index for each array element.\n *\n * @example\n * ```\n * indexBy(['one', 'two', 'three'], v => v.length)\n * // { '5': ['three'], '3': ['one', 'two'] }\n *\n * indexBy(['one', 'two', 'three'], v => [v.length, v.length + 1])\n * // { '5': ['three'], '6': ['three'], '3': ['one', 'two'], '4': ['one', 'two'] }\n * ```\n * @group Array\n */\nexport function indexBy<T>(\n    array: T[],\n    keyCallback: (value: T) => string | number | ReadonlyArray<string | number>,\n): Record<string, T[]>\nexport function indexBy<T>(\n    array: ReadonlyArray<T>,\n    keyCallback: (value: T) => string | number | ReadonlyArray<string | number>,\n): Record<string, ReadonlyArray<T>>\nexport function indexBy<T>(\n    array: ReadonlyArray<T>,\n    keyCallback: (value: T) => string | number | ReadonlyArray<string | number>,\n): Record<string, T[]> {\n    return array.reduce(\n        (prev, cur) => {\n            return ensureArray(keyCallback(cur)).reduce((prev2, key) => {\n                if (key in prev) {\n                    prev2[key]?.push(cur)\n                } else {\n                    prev2[key] = [cur]\n                }\n\n                return prev\n            }, prev)\n        },\n        {} as Record<string, T[]>,\n    )\n}\n\n/**\n * Removes duplicate values from the array.\n *\n * @example\n * ```\n * deduplicate([1, 1, 2, 3, 3])\n * // [1, 2, 3]\n * ```\n * @group Array\n */\nexport function deduplicate<T>(array: T[]): T[]\nexport function deduplicate<T>(array: ReadonlyArray<T>): ReadonlyArray<T>\nexport function deduplicate<T>(array: ReadonlyArray<T>): ReadonlyArray<T> {\n    return deduplicateBy(array, (v) => v)\n}\n\n/**\n * Removes duplicate values from the array by given callback.\n *\n * @example\n * ```\n * deduplicateBy([ { a: 1 }, { a: 1 } ], v => v.a)\n * // [ { a: 1 } ]\n * ```\n * @group Array\n */\nexport function deduplicateBy<T>(array: T[], key: (value: T) => unknown): T[]\nexport function deduplicateBy<T>(\n    array: ReadonlyArray<T>,\n    key: (value: T) => unknown,\n): ReadonlyArray<T>\nexport function deduplicateBy<T>(\n    array: ReadonlyArray<T>,\n    key: (value: T) => unknown,\n): ReadonlyArray<T>\nexport function deduplicateBy<T>(\n    array: ReadonlyArray<T>,\n    key: (value: T) => unknown,\n): ReadonlyArray<T> {\n    const prims = {\n        boolean: {} as Record<string | number | symbol, boolean>,\n        number: {} as Record<string | number | symbol, boolean>,\n        string: {} as Record<string | number | symbol, boolean>,\n    }\n    type Prim = keyof typeof prims\n\n    const objs: unknown[] = []\n\n    return array.filter((rawItem) => {\n        const item = key(rawItem) as string | number | symbol\n        const type = typeof item\n        if (type in prims) {\n            if (item in prims[type as Prim]) {\n                return false\n            } else {\n                return (prims[type as Prim][item] = true)\n            }\n        } else {\n            return objs.indexOf(item) !== -1 ? false : objs.push(item)\n        }\n    })\n}\n\n/**\n * Creates an array of array values not included in the other given arrays.\n *\n * @example\n * ```\n * difference([2, 1], [2, 3])\n * // [1]\n *\n * difference([2, 1], ['2', '3'], (a, b) => a === parseInt(b))\n * // [1]\n * ```\n * @group Array\n */\nexport function difference<T, T2>(\n    array: ReadonlyArray<T>,\n    values: ReadonlyArray<T2>,\n    key?: (value: T | T2) => unknown,\n): ReadonlyArray<T>\nexport function difference<T, T2>(\n    array: T[],\n    values: T2[],\n    key?: (value: T) => unknown,\n): T[]\nexport function difference<T, T2>(\n    array: ReadonlyArray<T>,\n    values: ReadonlyArray<T2>,\n    key: (value: T | T2) => unknown = (v) => v,\n): T[] {\n    return array.filter((v) => !values.some((v2) => key(v) === key(v2)))\n}\n\n/**\n * Creates an array of unique values that are included in all given arrays.\n *\n * @example\n * ```\n * intersection([[2, 1], [2, 3]])\n * // [2]\n * ```\n * @group Array\n */\nexport function intersection<T>(\n    values: ReadonlyArray<ReadonlyArray<T>>,\n    key?: (value: T) => unknown,\n): ReadonlyArray<T>\nexport function intersection<T>(values: T[][], key?: (value: T) => unknown): T[]\nexport function intersection<T>(\n    values: ReadonlyArray<ReadonlyArray<T>>,\n    key: (value: T) => unknown = (v) => v,\n): T[] {\n    const [first, ...rest] = values\n    return first\n        ? first.filter((v) =>\n              rest.every((v2) => v2.some((v3) => key(v) === key(v3))),\n          )\n        : []\n}\n\n/**\n * Creates an array of unique values that are included in all given arrays.\n *\n * @example\n * ```\n * intersection([[2, 1], [2, 3]])\n * // [2]\n * ```\n * @group Array\n */\nexport function union<T>(\n    values: ReadonlyArray<ReadonlyArray<T>>,\n    key?: (value: T) => unknown,\n): ReadonlyArray<T>\nexport function union<T>(values: T[][], key?: (value: T) => unknown): T[]\nexport function union<T>(\n    values: ReadonlyArray<ReadonlyArray<T>>,\n    key: (value: T) => unknown = (v) => v,\n): T[] {\n    return deduplicateBy(\n        values.reduce<T[]>((prev, cur) => {\n            prev.push(...cur)\n            return prev\n        }, []),\n        key,\n    )\n}\n\n/**\n * Checks if any value from provided values array is included in the provided array using provided `comparator` function (or by default comparing using `===`).\n *\n * @example\n * ```\n * includesAny([1, 2, 3], [3, 4, 5])\n * // true\n * ```\n * @group Array\n */\nexport function includesAny<T, T2>(\n    array: ReadonlyArray<T>,\n    values: ReadonlyArray<T2>,\n    key: (value: T | T2) => unknown = (v) => v,\n): boolean {\n    return values.some((v) => array.some((v2) => key(v2) === key(v)))\n}\n\n/**\n * Checks if all values from provided values array are included in the provided array using provided `comparator` function (or by default comparing using `===`).\n *\n * @example\n * ```\n * includesAll([1, 2, 3], [1, 2])\n * // true\n * ```\n * @group Array\n */\nexport function includesAll<T, T2>(\n    array: ReadonlyArray<T>,\n    values: ReadonlyArray<T2>,\n    key: (value: T | T2) => unknown = (v) => v,\n): boolean {\n    return values.every((v) => array.some((v2) => key(v2) === key(v)))\n}\n\n/**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n *\n * @example\n * ```\n * const obj = [{name: 'abc'}]\n * const index = findIndex(obj, v => v.name = 'abc')\n * // 0\n * ```\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @group Array\n */\nexport function findIndex<T>(\n    array: ReadonlyArray<T>,\n    compare: (value: T) => boolean,\n): number {\n    for (let index = 0; index < array.length; index++) {\n        if (compare(array[index] as T)) {\n            return index\n        }\n    }\n\n    return -1\n}\n","import { findIndex } from '.'\n\n/**\n * Converts bytes number to string representation (e.g. `15.25 GB`).\n *\n * @example\n * ```\n * formatBytes(1648 * 9884)\n * // '15.53 MB'\n * ```\n */\nexport function formatBytes(bytes: number, decimals: number = 2): string {\n    if (bytes <= 0) return '0 Bytes'\n\n    const k = 1024\n    const dm = decimals < 0 ? 0 : decimals\n    const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n\n    const i = Math.floor(Math.log(bytes) / Math.log(k))\n\n    return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]\n}\n\n/**\n * Parses size string to bytes.\n *\n * @example\n * ```\n * parseSize('15.53 MB')\n * // 16288832\n * ```\n * @returns parsed bytes or `-1` on fail\n */\nexport function parseSize(value: string): number {\n    const [_, rawSize, rawUnit] =\n        value.match(/^(\\d+(?:[.]\\d+|))\\s*([a-z]+)$/i) ?? []\n\n    const k = 1024\n    const units = [\n        ['bytes', 'byte', 'b'],\n        ['kb'],\n        ['mb'],\n        ['gb'],\n        ['tb'],\n        ['pb'],\n        ['eb'],\n        ['zb'],\n        ['yb'],\n    ]\n\n    if (rawSize && rawUnit) {\n        const size = parseFloat(rawSize)\n        const unit = rawUnit.toLowerCase()\n\n        let index = findIndex(units, (v) => v.indexOf(unit) !== -1)\n\n        let bytes = size\n        while (index > 0) {\n            bytes = bytes * k\n            index--\n        }\n\n        return bytes\n    }\n\n    return 0\n}\n\n/**\n * Split the pathname path into a pair (root, ext) such that root + ext == path,\n * and ext is empty or begins with a period and contains at most one period.\n * Leading periods on the basename are ignored.\n *\n * @example\n * ```\n * getFileParts('file.txt')\n * // ['file', '.txt']\n *\n * getFileParts('.cshrc')\n * // ['.cshrc', '']\n * ```\n */\nexport function getFileParts(pathname: string): [string, string] {\n    const lastDirectory = pathname.split('/').pop() ?? ''\n    const parts = lastDirectory.split('.')\n    const hasLeadingDot = lastDirectory[0] === '.'\n    const minDotCount = hasLeadingDot ? 2 : 1\n    const extension = parts.length > minDotCount ? parts.pop() : undefined\n\n    return [\n        extension ? pathname.slice(0, -1 * (extension.length + 1)) : pathname,\n        extension ? `.${extension}` : '',\n    ]\n}\n\nconst mimeTypes: Record<string, { extensions: string[] }> = {\n    'application/atom+xml': {\n        extensions: ['atom'],\n    },\n    'application/java-archive': {\n        extensions: ['jar', 'war', 'ear'],\n    },\n    'application/javascript': {\n        extensions: ['js'],\n    },\n    'application/json': {\n        extensions: ['json'],\n    },\n    'application/mac-binhex40': {\n        extensions: ['hqx'],\n    },\n    'application/msword': {\n        extensions: ['doc'],\n    },\n    'application/octet-stream': {\n        extensions: [\n            'bin',\n            'exe',\n            'dll',\n            'deb',\n            'dmg',\n            'iso',\n            'img',\n            'msi',\n            'msp',\n            'msm',\n        ],\n    },\n    'application/pdf': {\n        extensions: ['pdf'],\n    },\n    'application/postscript': {\n        extensions: ['ps', 'eps', 'ai'],\n    },\n    'application/rss+xml': {\n        extensions: ['rss'],\n    },\n    'application/rtf': {\n        extensions: ['rtf'],\n    },\n    'application/vnd.apple.mpegurl': {\n        extensions: ['m3u8'],\n    },\n    'application/vnd.google-earth.kml+xml': {\n        extensions: ['kml'],\n    },\n    'application/vnd.google-earth.kmz': {\n        extensions: ['kmz'],\n    },\n    'application/vnd.ms-excel': {\n        extensions: ['xls'],\n    },\n    'application/vnd.ms-fontobject': {\n        extensions: ['eot'],\n    },\n    'application/vnd.ms-powerpoint': {\n        extensions: ['ppt'],\n    },\n    'application/vnd.oasis.opendocument.graphics': {\n        extensions: ['odg'],\n    },\n    'application/vnd.oasis.opendocument.presentation': {\n        extensions: ['odp'],\n    },\n    'application/vnd.oasis.opendocument.spreadsheet': {\n        extensions: ['ods'],\n    },\n    'application/vnd.oasis.opendocument.text': {\n        extensions: ['odt'],\n    },\n    'application/vnd.openxmlformats-officedocument.presentationml.presentation':\n        {\n            extensions: ['pptx'],\n        },\n    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': {\n        extensions: ['xlsx'],\n    },\n    'application/vnd.openxmlformats-officedocument.wordprocessingml.document': {\n        extensions: ['docx'],\n    },\n    'application/vnd.wap.wmlc': {\n        extensions: ['wmlc'],\n    },\n    'application/wasm': {\n        extensions: ['wasm'],\n    },\n    'application/x-7z-compressed': {\n        extensions: ['7z'],\n    },\n    'application/x-cocoa': {\n        extensions: ['cco'],\n    },\n    'application/x-java-archive-diff': {\n        extensions: ['jardiff'],\n    },\n    'application/x-java-jnlp-file': {\n        extensions: ['jnlp'],\n    },\n    'application/x-makeself': {\n        extensions: ['run'],\n    },\n    'application/x-perl': {\n        extensions: ['pl', 'pm'],\n    },\n    'application/x-pilot': {\n        extensions: ['prc', 'pdb'],\n    },\n    'application/x-rar-compressed': {\n        extensions: ['rar'],\n    },\n    'application/x-redhat-package-manager': {\n        extensions: ['rpm'],\n    },\n    'application/x-sea': {\n        extensions: ['sea'],\n    },\n    'application/x-shockwave-flash': {\n        extensions: ['swf'],\n    },\n    'application/x-stuffit': {\n        extensions: ['sit'],\n    },\n    'application/x-tcl': {\n        extensions: ['tcl', 'tk'],\n    },\n    'application/x-x509-ca-cert': {\n        extensions: ['der', 'pem', 'crt'],\n    },\n    'application/x-xpinstall': {\n        extensions: ['xpi'],\n    },\n    'application/xhtml+xml': {\n        extensions: ['xhtml'],\n    },\n    'application/xspf+xml': {\n        extensions: ['xspf'],\n    },\n    'application/zip': {\n        extensions: ['zip'],\n    },\n    'audio/midi': {\n        extensions: ['mid', 'midi', 'kar'],\n    },\n    'audio/mpeg': {\n        extensions: ['mp3'],\n    },\n    'audio/ogg': {\n        extensions: ['ogg'],\n    },\n    'audio/x-m4a': {\n        extensions: ['m4a'],\n    },\n    'audio/x-realaudio': {\n        extensions: ['ra'],\n    },\n    'font/woff': {\n        extensions: ['woff'],\n    },\n    'font/woff2': {\n        extensions: ['woff2'],\n    },\n    'image/avif': {\n        extensions: ['avif'],\n    },\n    'image/gif': {\n        extensions: ['gif'],\n    },\n    'image/jpeg': {\n        extensions: ['jpeg', 'jpg'],\n    },\n    'image/png': {\n        extensions: ['png'],\n    },\n    'image/svg+xml': {\n        extensions: ['svg', 'svgz'],\n    },\n    'image/tiff': {\n        extensions: ['tif', 'tiff'],\n    },\n    'image/vnd.wap.wbmp': {\n        extensions: ['wbmp'],\n    },\n    'image/webp': {\n        extensions: ['webp'],\n    },\n    'image/x-icon': {\n        extensions: ['ico'],\n    },\n    'image/x-jng': {\n        extensions: ['jng'],\n    },\n    'image/x-ms-bmp': {\n        extensions: ['bmp'],\n    },\n    'text/css': {\n        extensions: ['css'],\n    },\n    'text/html': {\n        extensions: ['html', 'htm', 'shtml'],\n    },\n    'text/mathml': {\n        extensions: ['mml'],\n    },\n    'text/plain': {\n        extensions: ['txt'],\n    },\n    'text/vnd.sun.j2me.app-descriptor': {\n        extensions: ['jad'],\n    },\n    'text/vnd.wap.wml': {\n        extensions: ['wml'],\n    },\n    'text/x-component': {\n        extensions: ['htc'],\n    },\n    'text/xml': {\n        extensions: ['xml'],\n    },\n    'video/3gpp': {\n        extensions: ['3gpp', '3gp'],\n    },\n    'video/mp2t': {\n        extensions: ['ts'],\n    },\n    'video/mp4': {\n        extensions: ['mp4'],\n    },\n    'video/mpeg': {\n        extensions: ['mpeg', 'mpg'],\n    },\n    'video/quicktime': {\n        extensions: ['mov'],\n    },\n    'video/webm': {\n        extensions: ['webm'],\n    },\n    'video/x-flv': {\n        extensions: ['flv'],\n    },\n    'video/x-m4v': {\n        extensions: ['m4v'],\n    },\n    'video/x-mng': {\n        extensions: ['mng'],\n    },\n    'video/x-ms-asf': {\n        extensions: ['asx', 'asf'],\n    },\n    'video/x-ms-wmv': {\n        extensions: ['wmv'],\n    },\n    'video/x-msvideo': {\n        extensions: ['avi'],\n    },\n}\n\n/**\n * Returns mime type from file name\n *\n * @example\n * ```\n * getMimeType('file.txt') // text/plain\n * getMimeType('file.unknown') // undefined\n * getMimeType('json') // application/json\n * ```\n */\nexport function getMimeType(name: string): string | undefined {\n    if (name.includes('.')) {\n        const [_, extension] = getFileParts(name)\n        const extensionWithoutDot = extension.slice(1)\n\n        return Object.entries(mimeTypes).find(([_, value]) =>\n            value.extensions.includes(extensionWithoutDot),\n        )?.[0]\n    }\n\n    return Object.entries(mimeTypes).find(([_, value]) =>\n        value.extensions.includes(name),\n    )?.[0]\n}\n\n/**\n * Returns file extension from mime type\n *\n * @example\n * ```\n * getExtension('text/plain') // txt\n * getExtension('application/json') // json\n * getExtension('application/unknown') // undefined\n * ```\n */\nexport function getExtension(mimeType: string): string | undefined {\n    return mimeTypes[mimeType]?.extensions[0]\n}\n","/**\n * Checks if value is `number`, acts as a typescript safeguard.\n *\n * @example\n * ```\n * [1, 'b', 2].filter(isNumber)\n * > [1, 2]\n * ```\n * @group Guard\n */\nexport function isNumber<T>(value: T | number): value is number {\n    return typeof value === 'number'\n}\n\n/**\n * Checks if value is `boolean`, acts as a typescript safeguard.\n *\n * @example\n * ```\n * [true, 'b', false].filter(isBoolean)\n * > [true, false]\n * ```\n * @group Guard\n */\nexport function isBoolean<T>(value: T | boolean): value is boolean {\n    return typeof value === 'boolean'\n}\n\n/**\n * Checks if value is `string`, acts as a typescript safeguard.\n *\n * @example\n * ```\n * [1, 'b', false].filter(isString)\n * > ['b']\n * ```\n * @group Guard\n */\nexport function isString<T>(value: T | string): value is string {\n    return typeof value === 'string'\n}\n\n/**\n * Checks if value is `array`, acts as a typescript safeguard.\n *\n * @example\n * ```\n * [[1], ['b'], false].filter(isArray)\n * > [[1], ['b']]\n * ```\n * @group Guard\n */\nexport function isArray<T>(\n    value: T | Array<T> | ReadonlyArray<T>,\n): value is Array<T> {\n    return value instanceof Array\n}\n\n/**\n * Checks if value is instance of `Error`, acts as a typescript safeguard.\n *\n * @example\n * ```\n * [new Error('error'), 1, 5].filter(isError)\n * > [new Error('error')]\n *\n * [new Error('error'), 1, 5].filter(isNot(isError))\n * > [1, 5]\n * ```\n * @group Guard\n */\nexport function isError<T>(data: T | Error): data is Error {\n    return data instanceof Error\n}\n\n/**\n * Checks if value is `undefined`, acts as a typescript safeguard.\n *\n * @example\n * ```\n * [null, undefined, 1, 5].filter(isUndefined)\n * > [undefined]\n *\n * [null, undefined, 1, 5].filter(isNot(isUndefined))\n * > [null, 1, 5]\n * ```\n * @group Guard\n */\nexport function isUndefined<T>(value: T | undefined): value is undefined {\n    return value === undefined\n}\n\n/**\n * Checks if value is `null`, acts as a typescript safeguard.\n *\n * @example\n * ```\n * [null, undefined, 1, 5].filter(isUndefined)\n * > [undefined]\n *\n * [null, undefined, 1, 5].filter(isNot(isUndefined))\n * > [null, 1, 5]\n * ```\n * @group Guard\n */\nexport function isNull<T>(value: T | null): value is null {\n    return value === null\n}\n\n/**\n * Checks if value is not `null` or `undefined`, acts as a typescript safeguard.\n *\n * @example\n * ```\n * [null, undefined, 1, 5].filter(isUndefined)\n * > [null, undefined]\n *\n * [null, undefined, 1, 5].filter(isNot(isUndefined))\n * > [1, 5]\n * ```\n * @group Guard\n */\nexport function isNullOrUndefined<T>(\n    value: T | null | undefined,\n): value is null | undefined {\n    return value == null\n}\n\n/**\n * Checks if the value is an empty.\n *\n * Supports following types:\n * * Object - `false` if object is empty\n * * Array - `false` if array is empty\n * * Boolean - `false` if boolean is `false`\n * * Number - `false` if string is `''`\n * * Number - `false` if number is `0`\n *\n * @group Guard\n */\nexport function isEmpty<T>(value: T): boolean {\n    if (value == null) {\n        return false\n    }\n\n    if (typeof value === 'boolean') {\n        return value === false\n    }\n\n    if (typeof value === 'string') {\n        return value === ''\n    }\n\n    if (typeof value === 'number') {\n        return value === 0\n    }\n\n    if (value instanceof Array) {\n        return value.length === 0\n    }\n\n    if (isPlainObject(value)) {\n        return Object.keys(value).length === 0\n    }\n\n    return false\n}\n\n/**\n * Inverse guard\n *\n * @example\n * ```\n * [new Error('Error'), 1, 2].filter(isNot(isError))\n * // [1, 2]\n * ```\n * @param guard - guard function\n * @group Guard\n */\nexport function isNot<T, S extends T>(\n    guard: (data: T) => data is S,\n): (data: T) => data is Exclude<T, S> {\n    return (data: T): data is Exclude<T, S> => !guard(data)\n}\n\n/**\n * Checks if value is plain object, acts as a typescript safeguard.\n *\n * @example\n * ```\n * isPlainObject({a: 1})\n * // true\n *\n * isPlainObject([1])\n * // false\n * ```\n * @group Guard\n */\nexport function isPlainObject<T = Record<string | number | symbol, unknown>>(\n    value: unknown,\n): value is T {\n    const isObject = (v: unknown): v is object =>\n        String(v) === '[object Object]'\n\n    if (!isObject(value)) return false\n\n    const constructor = value.constructor\n    if (constructor === undefined) return true\n\n    const prototype = constructor.prototype\n    if (!isObject(prototype)) return false\n\n    // Checks if it is not a class\n    if (!prototype.hasOwnProperty('isPrototypeOf')) {\n        return false\n    }\n\n    return true\n}\n\n/**\n * Checks if given value is `Error` if it's subclass and then throw it.\n *\n * @example\n * ```\n * const value = new Error()\n * const value2 = assertNotError(value)\n * // throws error\n * ```\n * @group Guard\n * @param value any value\n * @returns `value` if it is not an instance of `Error`\n * @throws `value` if it is an instance of `Error`\n */\nexport function assertNotError<T>(value: Error | T): T {\n    if (value instanceof Error) {\n        throw value\n    }\n    return value\n}\n\n/**\n * Returns original value if it is array or wraps it to array.\n *\n * @example\n * ```\n * ensureArray('hello')\n * // ['hello']\n * ensureArray(['hello'])\n * // ['hello']\n * ```\n * @group Guard\n */\nexport function ensureArray<T>(value: T | T[]): T[]\nexport function ensureArray<T>(value: T | ReadonlyArray<T>): ReadonlyArray<T>\nexport function ensureArray<T>(value: T | readonly T[]): ReadonlyArray<T> {\n    return value instanceof Array ? value : [value]\n}\n\n/**\n * Returns `value` if it is instance of error otherwise wraps `value` to new `Error` instance.\n *\n * @param value `Error` or other value\n * @returns `value` if it instance of error `Error` otherwise wraps `value` to new `Error` instance\n * @group Guard\n */\nexport function ensureError(value: unknown): Error {\n    if (value instanceof Error) {\n        return value\n    }\n    return new Error(String(value))\n}\n\n/**\n * Checks if unknown object have provided keys.\n *\n * @example\n * ```\n * if (hasKeys(value, ['a', 'b'])) {\n *     console.log(value.a, value.b)\n * }\n * ```\n * @group Guard\n */\nexport function hasKeys<\n    T extends unknown,\n    Key extends string | number | symbol,\n>(\n    obj: T,\n    keys: ReadonlyArray<Key>,\n): obj is T extends { [K in Key]: any }\n    ? Extract<{ [K in Key]: any }, T>\n    : Extract<{ [K in Key]: unknown }, T> {\n    if (isPlainObject(obj) && keys.every((v) => v in obj)) {\n        return true\n    }\n\n    return false\n}\n","/**\n * The lowercase letters `abcdefghijklmnopqrstuvwxyz`.\n *\n * @group String\n */\nexport const asciiLowercase = 'abcdefghijklmnopqrstuvwxyz'\n\n/**\n * The uppercase letters `ABCDEFGHIJKLMNOPQRSTUVWXYZ`.\n *\n * @group String\n */\nexport const asciiUppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n\n/**\n * The concatenation of the [[asciiLowercase]] and [[asciiUppercase]] constants.\n *\n * @group String\n */\nexport const asciiLetters = asciiLowercase + asciiUppercase\n\n/**\n * The string `0123456789`.\n *\n * @group String\n */\nexport const digits = '0123456789'\n\n/**\n * The string `0123456789abcdefABCDEF`.\n *\n * @group String\n */\nexport const hexdigits = '0123456789abcdefABCDEF'\n\n/**\n * The string `01234567`.\n *\n * @group String\n */\nexport const octdigits = '01234567'\n\n/**\n * String of ASCII characters which are considered punctuation characters in the C locale:\n * `!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~.`\n *\n * @group String\n */\nexport const punctuation = '!\"#$%&\\'()*+,-./:;<=>?@[]^_`{|}~'\n\n/**\n * Check if given value contains at least one letter.\n *\n * @example\n * ```\n * isLetter('a')\n * // true\n * isLetter('-')\n * // false\n * ```\n * @group String\n */\nexport function isLetter(value: string): boolean {\n    return value.toLowerCase() != value.toUpperCase()\n}\n\n/**\n * Truncates string\n *\n * @example\n * ```\n * truncate('Hello world', 8)\n * // Hello...\n * ```\n * @group String\n */\nexport function truncate(\n    value: string,\n    length: number,\n    ending = '...',\n): string {\n    if (value.length > length) {\n        return value.substring(0, length - ending.length) + ending\n    } else {\n        return value\n    }\n}\n\n/**\n * Extract words from text.\n *\n * @example\n * ```\n * extractWords('Hello-world!')\n * // ['Hello', 'world']\n * ```\n * @group String\n */\nexport function extractWords(value: string): string[] {\n    return value\n        .split(/[ -./\\\\()\"',;<>~!@#$%^&*|+=[\\]{}`~?:]+/)\n        .filter((v) => v !== '')\n}\n\n/**\n * Convert a dash/dot/underscore/space separated string to camelCase\n *\n * @example\n * ```\n * camelCase('foo-bar');\n * // 'fooBar'\n * ```\n * @group String\n */\nexport function camelCase(value: string): string {\n    return value\n        .replace(/^[_.\\- ]+/, '')\n        .toLowerCase()\n        .replace(/[_.\\- ]+(\\w|$)/g, (_, p1) => p1.toUpperCase())\n        .replace(/\\d+(\\w|$)/g, (m) => m.toUpperCase())\n}\n\n/**\n * Convert a dash/dot/underscore/space separated string to PascalCase\n *\n * @example\n * ```\n * pascalCase('foo-bar');\n * // 'FooBar'\n * ```\n * @group String\n */\nexport function pascalCase(value: string): string {\n    const parsed = camelCase(value)\n    return parsed.charAt(0).toUpperCase() + parsed.slice(1)\n}\n\n/**\n * Convert the first letter in each to word upper case\n *\n * @example\n * ```\n * titleCase('hello world');\n * // 'Hello World'\n * ```\n * @group String\n */\nexport function titleCase(value: string): string {\n    return value\n        .split('')\n        .map((char, index, chars) => {\n            const prevChar = chars[index - 1]\n            if (prevChar && isLetter(prevChar)) {\n                return char.toLowerCase()\n            }\n            return char.toUpperCase()\n        })\n        .join('')\n}\n","import { isPlainObject } from '.'\n\n/**\n * Compares two values.\n *\n * Supported types: all primitives, `null`, `undefined`, `array`, `object`, `Date`\n *\n * @group Object\n * @param a any value to compare\n * @param b any value to compare\n * @returns `true` if values are equal\n */\nexport function isEqual(a: unknown, b: unknown): boolean {\n    if (a === b) {\n        return true\n    }\n\n    if (a instanceof Date && b instanceof Date) {\n        return a.getTime() === b.getTime()\n    }\n\n    if (a instanceof Array && b instanceof Array) {\n        if (a.length !== b.length) {\n            return false\n        }\n\n        return a.every((v, i) => isEqual(v, b[i]))\n    }\n\n    if (isPlainObject(a) && isPlainObject(b)) {\n        const entriesA = Object.entries(a)\n\n        if (entriesA.length !== Object.keys(b).length) {\n            return false\n        }\n        return entriesA.every(([k, v]) => isEqual(v, b[k]))\n    }\n\n    return false\n}\n\n/**\n * Converts object to entries, map's it with provided callback and flattens entry list.\n *\n * @example\n * ```\n * flatMapRecord({'a': 2}, ([k, v]) => [[k, v]])\n * >> {'a': 2, 'b': 3}\n * flatMapRecord({'a': 2, 'b': 3}, ([k, v]) => v === 2 ? [[k, v]] : [])\n * >> {'a': 2}\n * ```\n * @group Object\n * @param obj `Record` like object\n * @param callback map callback, accepts entry pair (`[key, value]`) and should return list of entry pairs\n * @returns new mapped object\n */\nexport function flatMapRecord<\n    K extends string | number | symbol,\n    V,\n    RK extends string | number | symbol,\n    RV,\n>(\n    obj: Record<K, V>,\n    callback: (entry: [K, V]) => Array<[RK, RV]>,\n): Record<RK, RV> {\n    const entries = Object.entries(obj) as Array<[K, V]>\n\n    return entries.map(callback).reduce(\n        (prev, values) => {\n            values.forEach(([key, value]) => {\n                prev[key] = value\n            })\n            return prev\n        },\n        {} as Record<RK, RV>,\n    )\n}\n\n/**\n * Converts object to entries and map's it with provided callback.\n *\n * @example\n * ```\n * mapRecord({'a': 2}, ([k, v]) => [v, k * 2])\n * >> {'b': 4}\n * mapRecord({'a': 'b'}, ([k, v]) => [v, k])\n * >> {'b': 'a'}\n * ```\n * @group Object\n * @param obj `Record` like plain object\n * @param callback map callback, accepts entry pair (`[key, value]`) and should return entry pair\n * @returns new mapped object\n */\nexport function mapRecord<\n    K extends string | number | symbol,\n    V,\n    RK extends string | number | symbol,\n    RV,\n>(obj: Record<K, V>, callback: (entry: [K, V]) => [RK, RV]): Record<RK, RV> {\n    return flatMapRecord(obj, (v) => [callback(v)])\n}\n\n/**\n * Filter object by provided callback.\n *\n * @example\n * ```\n * filterRecord({'a': 2, 'b': 3}, ([k, v]) => v === 2)\n * >> {'a': 2}\n * ```\n * @group Object\n * @param obj `Record` like plain object\n * @param callback map callback, accepts entry pair (`[key, value]`) and should boolean value\n * @returns new filtered object\n */\nexport function filterRecord<K extends string | number | symbol, V>(\n    obj: Record<K, V>,\n    callback: (entry: [K, V]) => boolean,\n): Record<K, V> {\n    return flatMapRecord(obj, (v) => (callback(v) ? [v] : []))\n}\n\n/**\n * Merges `source` to `target` recursively\n *\n * @example\n * ```\n * merge({ a: 1 }, { b: 2 }))\n * // { a: 1, b: 2 }\n * ```\n * @group Object\n */\nexport function merge<T>(\n    target: unknown,\n    source: unknown,\n    options?: {\n        /**\n         * When `source` has `null` or `undefined` value, do not overwrite `target`\n         *\n         * @default false\n         */\n        skipNulls?: boolean\n        /**\n         * Array merge policy, default is `overwrite`\n         *\n         * Available policies:\n         * * `overwrite` - always replace `target` array with `source`\n         * * `merge` - merge `target` and `source` array values\n         * * `(target, source) => source` - custom array merge function\n         *\n         * @default 'overwrite'\n         */\n        arrayPolicy?:\n            | 'overwrite'\n            | 'merge'\n            | ((target: unknown[], source: unknown[]) => unknown)\n    },\n): T {\n    const { skipNulls = false, arrayPolicy = 'overwrite' } = options ?? {}\n\n    if (isPlainObject(target) && isPlainObject(source)) {\n        return Object.entries(source).reduce(\n            (prev, [key, value]) => {\n                prev[key] = merge(prev[key], value, options)\n                return prev\n            },\n            { ...target },\n        ) as unknown as T\n    }\n\n    if (target instanceof Array && source instanceof Array) {\n        if (arrayPolicy === 'merge') {\n            return target.concat(source) as unknown as T\n        } else if (typeof arrayPolicy === 'function') {\n            return arrayPolicy(target, source) as unknown as T\n        } else {\n            return source as unknown as T\n        }\n    }\n\n    if (skipNulls && source == null) {\n        return target as T\n    }\n\n    return source as T\n}\n\n/**\n * Return a clone of given value\n *\n * @group Object\n * @param value any value\n * @param recursive should recursive values (object and array) be cloned\n */\nexport function clone<T>(value: T, recursive = true): T {\n    if (isPlainObject(value)) {\n        return Object.entries(value).reduce(\n            (prev, [k, v]) => {\n                prev[k] = recursive ? clone(v) : v\n                return prev\n            },\n            {} as Record<string | number | symbol, unknown>,\n        ) as unknown as T\n    }\n\n    if (value instanceof Array) {\n        return value.map((v) => (recursive ? clone(v) : v)) as T\n    }\n\n    return value\n}\n\n/**\n * Parse one level object to nested structure based on key separator\n *\n * @example\n * ```\n * // ENV: config__host=0.0.0.0 config__port=3000\n * convertToNested(process.env, { separator: '__' })\n * // {config: { host: '0.0.0.0', port: 3000 } }\n *\n * // ENV: CONFIG__PRIVATE_KEY=\"my key\"\n * // ENV: CONFIG__PUBLIC_KEY=\"my key\"\n * // ENV: CONFIG__ALLOWED_IPS='[\"127.0.0.1\", \"localhost\"]'\n * convertToNested(process.env, {\n *    separator: '__',\n *    transformKey: camelCase\n * }).config\n * // { privateKey: 'my key', publicKey: 'my key', allowedIps: ['127.0.0.1', 'localhost'] }\n * ```\n * @group Object\n */\nexport function convertToNested<T = Record<string, unknown>>(\n    array: Record<string, unknown>,\n    options?: {\n        /**\n         * Key separator, default `.`\n         */\n        separator?: string\n        /**\n         * Key transform function, e.g. `camelCase` or `pascalCase`\n         */\n        transformKey?: (value: string) => string\n        /**\n         * Value transform function, by default `JSON.parse` is used.\n         */\n        transformValue?: (value: unknown) => unknown\n    },\n): T {\n    const sep = options?.separator ?? '.'\n    const keyTransformer = options?.transformKey ?? ((v) => v)\n    const valueTransformer =\n        options?.transformValue ??\n        ((v) => {\n            if (typeof v === 'string') {\n                try {\n                    return JSON.parse(v)\n                } catch {\n                    return v\n                }\n            }\n            return v\n        })\n\n    const createValue = (\n        [target, ...keys]: string[],\n        value: unknown,\n    ): unknown => {\n        if (!target) {\n            return value\n        }\n        return {\n            [target]: createValue(keys, value),\n        }\n    }\n\n    return Object.entries(array)\n        .map(\n            ([key, value]) =>\n                [\n                    key.split(sep).map(keyTransformer),\n                    valueTransformer(value),\n                ] as const,\n        )\n        .filter(([keys]) => keys.every((v) => !!v))\n        .sort((a, b) => a[0].length - b[0].length)\n        .reduce(\n            (prev, [key, value]) => merge(prev, createValue(key, value)),\n            {} as T,\n        )\n}\n\n/**\n * Get object value by nested keys\n *\n * @example\n * ```\n * getByKey({ key1: [1, 2, { key2: 'value' }]}, 'key1.2.key2')\n * // 'value'\n *\n * getByKey({ key1: [1, 2, { key2: 'value' }]}, ['key1', 2, 'key2'])\n * // 'value'\n * ```\n * @group Object\n */\nexport function getByKey<T>(\n    target: unknown,\n    keys: (string | number)[] | string,\n): T {\n    const keysList = keys instanceof Array ? keys : keys.split('.')\n    const key = keysList[0]\n    const restKeys = keysList.slice(1)\n\n    if (!key) {\n        return target as T\n    }\n\n    if (target instanceof Array) {\n        const numKey = parseInt(key.toString(), 10)\n\n        return isNaN(numKey)\n            ? (undefined as T)\n            : getByKey(target[numKey], restKeys)\n    }\n\n    if (isPlainObject(target)) {\n        return getByKey(target[key], restKeys)\n    }\n\n    return undefined as T\n}\n","/**\n * Generates hash of given value\n */\nexport function hashCode(value: unknown): number {\n    const jsonString = JSON.stringify(value || '')\n    let hash = 0\n    if (jsonString.length === 0) hash\n    for (let i = 0; i < jsonString.length; i++) {\n        const chr = jsonString.charCodeAt(i)\n        hash = (hash << 5) - hash + chr\n        hash |= 0\n    }\n    return hash\n}\n\n/**\n * Generates v4 like [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) (Universally unique identifier).\n *\n * > Be aware that UUID uniqueness relies heavily on the underlying random number generator (RNG).\n * > The solution above uses Math.random() for brevity, however Math.random() is not guaranteed to be a high-quality RNG.\n * > For a more robust solution, consider using the [uuid](https://github.com/uuidjs/uuid) module, which uses higher quality RNG APIs.\n *\n * @example\n * ```\n * generateUUID()\n * // '8e07ef4a-0d1f-45c2-b06b-9495e869b299'\n * ```\n **/\nexport function generateUUID(): string {\n    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(\n        /[xy]/g,\n        function (c) {\n            var r = (Math.random() * 16) | 0,\n                v = c == 'x' ? r : (r & 0x3) | 0x8\n            return v.toString(16)\n        },\n    )\n}\n\nconst keyStr =\n    'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n\n/**\n * Decodes [Base64](https://en.wikipedia.org/wiki/Base64) encoded value.\n */\nexport function base64Decode(input: string): string {\n    let output = ''\n    let i = 0\n\n    input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '')\n\n    while (i < input.length) {\n        const enc1 = keyStr.indexOf(input.charAt(i++))\n        const enc2 = keyStr.indexOf(input.charAt(i++))\n        const enc3 = keyStr.indexOf(input.charAt(i++))\n        const enc4 = keyStr.indexOf(input.charAt(i++))\n\n        const chr1 = (enc1 << 2) | (enc2 >> 4)\n        const chr2 = ((enc2 & 15) << 4) | (enc3 >> 2)\n        const chr3 = ((enc3 & 3) << 6) | enc4\n\n        output = output + String.fromCharCode(chr1)\n\n        if (enc3 !== 64) {\n            output = output + String.fromCharCode(chr2)\n        }\n        if (enc4 !== 64) {\n            output = output + String.fromCharCode(chr3)\n        }\n    }\n\n    output = decodeUTF8(output)\n\n    return output\n}\n\n/**\n * Encodes given value with [Base64](https://en.wikipedia.org/wiki/Base64) algorithm.\n */\nexport function base64Encode(input: string): string {\n    let output = ''\n    let i = 0\n    input = encodeUTF8(input)\n    while (i < input.length) {\n        const chr1 = input.charCodeAt(i++)\n        const chr2 = input.charCodeAt(i++)\n        const chr3 = input.charCodeAt(i++)\n        const enc1 = chr1 >> 2\n        const enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n        let enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n        let enc4 = chr3 & 63\n        if (isNaN(chr2)) {\n            enc3 = enc4 = 64\n        } else if (isNaN(chr3)) {\n            enc4 = 64\n        }\n        output =\n            output +\n            keyStr.charAt(enc1) +\n            keyStr.charAt(enc2) +\n            keyStr.charAt(enc3) +\n            keyStr.charAt(enc4)\n    }\n    return output\n}\n\nfunction encodeUTF8(input: string): string {\n    input = input.replace(/\\r\\n/g, '\\n')\n    let utf8Text = ''\n\n    for (let n = 0; n < input.length; n++) {\n        const c = input.charCodeAt(n)\n\n        if (c < 128) {\n            utf8Text += String.fromCharCode(c)\n        } else if (c > 127 && c < 2048) {\n            utf8Text += String.fromCharCode((c >> 6) | 192)\n            utf8Text += String.fromCharCode((c & 63) | 128)\n        } else {\n            utf8Text += String.fromCharCode((c >> 12) | 224)\n            utf8Text += String.fromCharCode(((c >> 6) & 63) | 128)\n            utf8Text += String.fromCharCode((c & 63) | 128)\n        }\n    }\n\n    return utf8Text\n}\n\nfunction decodeUTF8(utf8Text: string): string {\n    let str = ''\n    let i = 0\n    let c1 = 0\n    let c2 = 0\n    let c3 = 0\n    while (i < utf8Text.length) {\n        c1 = utf8Text.charCodeAt(i)\n\n        if (c1 < 128) {\n            str += String.fromCharCode(c1)\n            i++\n        } else if (c1 > 191 && c1 < 224) {\n            c2 = utf8Text.charCodeAt(i + 1)\n            str += String.fromCharCode(((c1 & 31) << 6) | (c2 & 63))\n            i += 2\n        } else {\n            c2 = utf8Text.charCodeAt(i + 1)\n            c3 = utf8Text.charCodeAt(i + 2)\n            str += String.fromCharCode(\n                ((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63),\n            )\n            i += 3\n        }\n    }\n    return str\n}\n","/**\n * HTTP status codes\n *\n * @example\n * ```\n * HttpStatusCodes.ACCEPTED\n * >> 202\n * ```\n *\n * @group Http\n */\nexport enum HttpStatusCodes {\n    /**\n     * The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.3\n     */\n    ACCEPTED = 202,\n    /**     *\n     * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.3\n     */\n    BAD_GATEWAY = 502,\n    /**\n     * This response means that server could not understand the request due to invalid syntax.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.1\n     */\n    BAD_REQUEST = 400,\n    /**\n     * This response is sent when a request conflicts with the current state of the server.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.8\n     */\n    CONFLICT = 409,\n    /**\n     * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.2.1\n     */\n    CONTINUE = 100,\n    /**\n     * The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.2\n     */\n    CREATED = 201,\n    /**\n     * This response code means the expectation indicated by the Expect request header field can't be met by the server.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.14\n     */\n    EXPECTATION_FAILED = 417,\n    /**\n     * The request failed due to failure of a previous request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.5\n     */\n    FAILED_DEPENDENCY = 424,\n    /**\n     * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.3\n     */\n    FORBIDDEN = 403,\n    /**\n     * This error response is given when the server is acting as a gateway and cannot get a response in time.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.5\n     */\n    GATEWAY_TIMEOUT = 504,\n    /**\n     * This response would be sent when the requested content has been permanently deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for \"limited-time, promotional services\". APIs should not feel compelled to indicate resources that have been deleted with this status code.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.9\n     */\n    GONE = 410,\n    /**\n     * The HTTP version used in the request is not supported by the server.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.6\n     */\n    HTTP_VERSION_NOT_SUPPORTED = 505,\n    /**\n     * Any attempt to brew coffee with a teapot should result in the error code \"418 I'm a teapot\". The resulting entity body MAY be short and stout.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2324#section-2.3.2\n     */\n    IM_A_TEAPOT = 418,\n    /**\n     * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.6\n     */\n    INSUFFICIENT_SPACE_ON_RESOURCE = 419,\n    /**\n     * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.6\n     */\n    INSUFFICIENT_STORAGE = 507,\n    /**\n     * The server encountered an unexpected condition that prevented it from fulfilling the request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.1\n     */\n    INTERNAL_SERVER_ERROR = 500,\n    /**\n     * The server rejected the request because the Content-Length header field is not defined and the server requires it.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.10\n     */\n    LENGTH_REQUIRED = 411,\n    /**\n     * The resource that is being accessed is locked.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.4\n     */\n    LOCKED = 423,\n    /**\n     * A deprecated response used by the Spring Framework when a method has failed.\n     *\n     * @deprecated\n     * @tutorial https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt\n     */\n    METHOD_FAILURE = 420,\n    /**\n     * The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.5\n     */\n    METHOD_NOT_ALLOWED = 405,\n    /**\n     * This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.2\n     */\n    MOVED_PERMANENTLY = 301,\n    /**\n     * This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.3\n     */\n    MOVED_TEMPORARILY = 302,\n    /**\n     * A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.2\n     */\n    MULTI_STATUS = 207,\n    /**\n     * The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.1\n     */\n    MULTIPLE_CHOICES = 300,\n    /**\n     * The 511 status code indicates that the client needs to authenticate to gain network access.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc6585#section-6\n     */\n    NETWORK_AUTHENTICATION_REQUIRED = 511,\n    /**\n     * There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.5\n     */\n    NO_CONTENT = 204,\n    /**\n     * This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.4\n     */\n    NON_AUTHORITATIVE_INFORMATION = 203,\n    /**\n     * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.6\n     */\n    NOT_ACCEPTABLE = 406,\n    /**\n     * The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.4\n     */\n    NOT_FOUND = 404,\n    /**\n     * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.2\n     */\n    NOT_IMPLEMENTED = 501,\n    /**\n     * This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7232#section-4.1\n     */\n    NOT_MODIFIED = 304,\n    /**\n     * The request has succeeded. The meaning of a success varies depending on the HTTP method:\n     * GET: The resource has been fetched and is transmitted in the message body.\n     * HEAD: The entity headers are in the message body.\n     * POST: The resource describing the result of the action is transmitted in the message body.\n     * TRACE: The message body contains the request message as received by the server\n     *\n     *  @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.1\n     */\n    OK = 200,\n    /**\n     * This response code is used because of range header sent by the client to separate download into multiple streams.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7233#section-4.1\n     */\n    PARTIAL_CONTENT = 206,\n    /**\n     * This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.2\n     */\n    PAYMENT_REQUIRED = 402,\n    /**\n     * This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7538#section-3\n     */\n    PERMANENT_REDIRECT = 308,\n    /**\n     * The client has indicated preconditions in its headers which the server does not meet.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7232#section-4.2\n     */\n    PRECONDITION_FAILED = 412,\n    /**\n     * The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc6585#section-3\n     */\n    PRECONDITION_REQUIRED = 428,\n    /**\n     * This code indicates that the server has received and is processing the request, but no response is available yet.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.1\n     */\n    PROCESSING = 102,\n    /**\n     * This is similar to 401 but authentication is needed to be done by a proxy.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7235#section-3.2\n     */\n    PROXY_AUTHENTICATION_REQUIRED = 407,\n    /**\n     * The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc6585#section-5\n     */\n    REQUEST_HEADER_FIELDS_TOO_LARGE = 431,\n    /**\n     * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.7\n     */\n    REQUEST_TIMEOUT = 408,\n    /**\n     * Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.11\n     */\n    REQUEST_TOO_LONG = 413,\n    /**\n     * The URI requested by the client is longer than the server is willing to interpret.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.12\n     */\n    REQUEST_URI_TOO_LONG = 414,\n    /**\n     * The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7233#section-4.4\n     */\n    REQUESTED_RANGE_NOT_SATISFIABLE = 416,\n    /**\n     * This response code is sent after accomplishing request to tell user agent reset document view which sent this request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.6\n     */\n    RESET_CONTENT = 205,\n    /**\n     * Server sent this response to directing client to get requested resource to another URI with an GET request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.4\n     */\n    SEE_OTHER = 303,\n    /**\n     * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.4\n     */\n    SERVICE_UNAVAILABLE = 503,\n    /**\n     * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.2.2\n     */\n    SWITCHING_PROTOCOLS = 101,\n    /**\n     * Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.7\n     */\n    TEMPORARY_REDIRECT = 307,\n    /**\n     * The user has sent too many requests in a given amount of time (\"rate limiting\").\n     *\n     * @tutorial https://tools.ietf.org/html/rfc6585#section-4\n     */\n    TOO_MANY_REQUESTS = 429,\n    /**\n     * Although the HTTP standard specifies \"unauthorized\", semantically this response means \"unauthenticated\". That is, the client must authenticate itself to get the requested response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7235#section-3.1\n     */\n    UNAUTHORIZED = 401,\n    /**\n     * The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7725\n     */\n    UNAVAILABLE_FOR_LEGAL_REASONS = 451,\n    /**\n     * The request was well-formed but was unable to be followed due to semantic errors.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.3\n     */\n    UNPROCESSABLE_ENTITY = 422,\n    /**\n     * The media format of the requested data is not supported by the server, so the server is rejecting the request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.13\n     */\n    UNSUPPORTED_MEDIA_TYPE = 415,\n    /**\n     * Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.\n     *\n     * @deprecated\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.6\n     */\n    USE_PROXY = 305,\n}\n\n/**\n * HTTP status reason text\n *\n * @example\n * ```\n * HttpStatusCodes.ACCEPTED\n * >> 'Accepted'\n * ```\n *\n * @group Http\n */\nexport enum HttpStatusReasons {\n    /**\n     * The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.3\n     */\n    ACCEPTED = 'Accepted',\n    /**\n     * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.3\n     */\n    BAD_GATEWAY = 'Bad Gateway',\n    /**\n     * This response means that server could not understand the request due to invalid syntax.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.1\n     */\n    BAD_REQUEST = 'Bad Request',\n    /**\n     * This response is sent when a request conflicts with the current state of the server.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.8\n     */\n    CONFLICT = 'Conflict',\n    /**\n     * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.2.1\n     */\n    CONTINUE = 'Continue',\n    /**\n     * The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.2\n     */\n    CREATED = 'Created',\n    /**\n     * This response code means the expectation indicated by the Expect request header field can't be met by the server.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.14\n     */\n    EXPECTATION_FAILED = 'Expectation Failed',\n    /**\n     * The request failed due to failure of a previous request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.5\n     */\n    FAILED_DEPENDENCY = 'Failed Dependency',\n    /**\n     * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.3\n     */\n    FORBIDDEN = 'Forbidden',\n    /**\n     * This error response is given when the server is acting as a gateway and cannot get a response in time.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.5\n     */\n    GATEWAY_TIMEOUT = 'Gateway Timeout',\n    /**\n     * This response would be sent when the requested content has been permanently deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for \"limited-time, promotional services\". APIs should not feel compelled to indicate resources that have been deleted with this status code.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.9\n     */\n    GONE = 'Gone',\n    /**\n     * The HTTP version used in the request is not supported by the server.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.6\n     */\n    HTTP_VERSION_NOT_SUPPORTED = 'HTTP Version Not Supported',\n    /**\n     * Any attempt to brew coffee with a teapot should result in the error code \"418 I'm a teapot\". The resulting entity body MAY be short and stout.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2324#section-2.3.2\n     */\n    IM_A_TEAPOT = \"I'm a teapot\",\n    /**\n     * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.6\n     */\n    INSUFFICIENT_SPACE_ON_RESOURCE = 'Insufficient Space on Resource',\n    /**\n     * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.6\n     */\n    INSUFFICIENT_STORAGE = 'Insufficient Storage',\n    /**\n     * The server encountered an unexpected condition that prevented it from fulfilling the request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.1\n     */\n    INTERNAL_SERVER_ERROR = 'Internal Server Error',\n    /**\n     * The server rejected the request because the Content-Length header field is not defined and the server requires it.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.10\n     */\n    LENGTH_REQUIRED = 'Length Required',\n    /**\n     * The resource that is being accessed is locked.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.4\n     */\n    LOCKED = 'Locked',\n    /**\n     * A deprecated response used by the Spring Framework when a method has failed.\n     *\n     * @deprecated\n     * @tutorial https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt\n     */\n    METHOD_FAILURE = 'Method Failure',\n    /**\n     * The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.5\n     */\n    METHOD_NOT_ALLOWED = 'Method Not Allowed',\n    /**\n     * This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.2\n     */\n    MOVED_PERMANENTLY = 'Moved Permanently',\n    /**\n     * This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.3\n     */\n    MOVED_TEMPORARILY = 'Moved Temporarily',\n    /**\n     * A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.2\n     */\n    MULTI_STATUS = 'Multi-Status',\n    /**\n     * The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.1\n     */\n    MULTIPLE_CHOICES = 'Multiple Choices',\n    /**\n     * The 511 status code indicates that the client needs to authenticate to gain network access.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc6585#section-6\n     */\n    NETWORK_AUTHENTICATION_REQUIRED = 'Network Authentication Required',\n    /**\n     * There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.5\n     */\n    NO_CONTENT = 'No Content',\n    /**\n     * This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.4\n     */\n    NON_AUTHORITATIVE_INFORMATION = 'Non Authoritative Information',\n    /**\n     * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.6\n     */\n    NOT_ACCEPTABLE = 'Not Acceptable',\n    /**\n     * The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.4\n     */\n    NOT_FOUND = 'Not Found',\n    /**\n     * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.2\n     */\n    NOT_IMPLEMENTED = 'Not Implemented',\n    /**\n     * This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7232#section-4.1\n     */\n    NOT_MODIFIED = 'Not Modified',\n    /**\n     * The request has succeeded. The meaning of a success varies depending on the HTTP method:\n     *\n     * GET: The resource has been fetched and is transmitted in the message body.\n     * HEAD: The entity headers are in the message body.\n     * POST: The resource describing the result of the action is transmitted in the message body.\n     * TRACE: The message body contains the request message as received by the server\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.1\n     */\n    OK = 'OK',\n    /**\n     * This response code is used because of range header sent by the client to separate download into multiple streams.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7233#section-4.1\n     */\n    PARTIAL_CONTENT = 'Partial Content',\n    /**\n     * This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.2\n     */\n    PAYMENT_REQUIRED = 'Payment Required',\n    /**\n     * This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7538#section-3\n     */\n    PERMANENT_REDIRECT = 'Permanent Redirect',\n    /**\n     * The client has indicated preconditions in its headers which the server does not meet.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7232#section-4.2\n     */\n    PRECONDITION_FAILED = 'Precondition Failed',\n    /**\n     * The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc6585#section-3\n     */\n    PRECONDITION_REQUIRED = 'Precondition Required',\n    /**\n     * This code indicates that the server has received and is processing the request, but no response is available yet.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.1\n     */\n    PROCESSING = 'Processing',\n    /**\n     * This is similar to 401 but authentication is needed to be done by a proxy.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7235#section-3.2\n     */\n    PROXY_AUTHENTICATION_REQUIRED = 'Proxy Authentication Required',\n    /**\n     * The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc6585#section-5\n     */\n    REQUEST_HEADER_FIELDS_TOO_LARGE = 'Request Header Fields Too Large',\n    /**\n     * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.7\n     */\n    REQUEST_TIMEOUT = 'Request Timeout',\n    /**\n     * Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.11\n     */\n    REQUEST_TOO_LONG = 'Request Entity Too Large',\n    /**\n     * The URI requested by the client is longer than the server is willing to interpret.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.12\n     */\n    REQUEST_URI_TOO_LONG = 'Request-URI Too Long',\n    /**\n     * The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7233#section-4.4\n     */\n    REQUESTED_RANGE_NOT_SATISFIABLE = 'Requested Range Not Satisfiable',\n    /**\n     * This response code is sent after accomplishing request to tell user agent reset document view which sent this request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.3.6\n     */\n    RESET_CONTENT = 'Reset Content',\n    /**\n     * Server sent this response to directing client to get requested resource to another URI with an GET request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.4\n     */\n    SEE_OTHER = 'See Other',\n    /**\n     * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.6.4\n     */\n    SERVICE_UNAVAILABLE = 'Service Unavailable',\n    /**\n     * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.2.2\n     */\n    SWITCHING_PROTOCOLS = 'Switching Protocols',\n    /**\n     * Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.7\n     */\n    TEMPORARY_REDIRECT = 'Temporary Redirect',\n    /**\n     * The user has sent too many requests in a given amount of time (\"rate limiting\").\n     *\n     * @tutorial https://tools.ietf.org/html/rfc6585#section-4\n     */\n    TOO_MANY_REQUESTS = 'Too Many Requests',\n    /**\n     * Although the HTTP standard specifies \"unauthorized\", semantically this response means \"unauthenticated\". That is, the client must authenticate itself to get the requested response.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7235#section-3.1\n     */\n    UNAUTHORIZED = 'Unauthorized',\n    /**\n     * The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7725\n     */\n    UNAVAILABLE_FOR_LEGAL_REASONS = 'Unavailable For Legal Reasons',\n    /**\n     * The request was well-formed but was unable to be followed due to semantic errors.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc2518#section-10.3\n     */\n    UNPROCESSABLE_ENTITY = 'Unprocessable Entity',\n    /**\n     * The media format of the requested data is not supported by the server, so the server is rejecting the request.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.5.13\n     */\n    UNSUPPORTED_MEDIA_TYPE = 'Unsupported Media Type',\n    /**\n     * Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.\n     *\n     * @tutorial https://tools.ietf.org/html/rfc7231#section-6.4.6\n     * @deprecated\n     */\n    USE_PROXY = 'Use Proxy',\n}\n","import { HttpStatusCodes, HttpStatusReasons } from './codes'\n\nconst codeToReason = Object.entries(HttpStatusCodes).reduce(\n    (prev, [key, value]) => {\n        prev[value as number] =\n            HttpStatusReasons[key as keyof typeof HttpStatusReasons]\n        return prev\n    },\n    {} as Record<number, string>,\n)\n\n/**\n * HTTP error class with status code\n *\n * @example\n * ```\n * // Throw 404 error with default message\n * throw new HttpError(404)\n * throw new HttpError(HttpStatusCodes.NOT_FOUND)\n *\n * // Throw 404 error with custom message\n * throw new HttpError(404, 'X not found')\n * throw new HttpError(HttpStatusCodes.NOT_FOUND, 'X not found')\n *\n * // Throw 500 error and expose custom message to user\n * throw new HttpError(HttpStatusCodes.INTERNAL_SERVER_ERROR, 'Missing configuration', {expose: true})\n *\n * // Handle HttpError\n * if (err instanceof HttpError) {\n *     console.log(err.message)\n *     return err.publicMessage\n * }\n * ```\n * @group Http\n */\nexport class HttpError extends Error {\n    /**\n     * Should error message be exposed to the user\n     */\n    public expose: boolean\n    /**\n     * HTTP status code\n     */\n    public status: number\n\n    /**\n     * `this.message` if `this.status` is `true` else message from [[HttpStatusReasons]] is used\n     */\n    public publicMessage: string\n\n    /**\n     * @throws `Error` if status is not supported\n     * @param status HTTP [status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)\n     * @param message error message, if not provided message from [[HttpStatusReasons]] is used\n     * @param properties additional configuration\n     */\n    constructor(\n        status: number,\n        message?: string,\n        properties?: {\n            /**\n             * Should error message be exposed to the user\n             */\n            expose: boolean\n        },\n    ) {\n        if (!(status in codeToReason)) {\n            throw new Error('Incorrect status code')\n        }\n        const defaultMessage = codeToReason[status] ?? ''\n        const privateMessage = message ?? defaultMessage\n\n        super(privateMessage)\n        this.status = status\n        this.expose = properties?.expose ?? status < 500\n        this.publicMessage = this.expose ? privateMessage : defaultMessage\n\n        // Fix instanceof bug: https://github.com/microsoft/TypeScript/issues/22585\n        Object.setPrototypeOf(this, HttpError.prototype)\n    }\n}\n","const tagsToEncode: Record<string, string[]> = {\n    '&': ['&amp;', '&#38;'],\n    '<': ['&lt;', '&#60;'],\n    '>': ['&gt;', '&#62;'],\n    '\"': ['&quot;', '&#34;'],\n    \"'\": ['&apos;', '&#39;'],\n}\n\n/**\n * Encodes text replacing HTML special characters (<>&\"')\n *\n * @group Http\n * @param html\n */\nexport function encodeHtml(html: string): string {\n    const re = new RegExp(`[${Object.keys(tagsToEncode).join('')}]`, 'g')\n    return html.replace(re, (value) => tagsToEncode[value]?.[0] || value)\n}\n\n/**\n * Decodes text restoring HTML encoded characters (<>&\"')\n *\n * @group Http\n * @param html\n */\nexport function decodeHtml(html: string): string {\n    return html.replace(\n        /&[a-z0-9#]+;/g,\n        (value) =>\n            Object.entries(tagsToEncode).find((v) =>\n                v[1].includes(value),\n            )?.[0] || value,\n    )\n}\n","import { ensureError } from '.'\n\nclass Placeholder {\n    __PLACEHOLDER__ = '__PLACEHOLDER__'\n\n    constructor() {\n        // Fix instanceof bug: https://github.com/microsoft/TypeScript/issues/22585\n        Object.setPrototypeOf(this, Placeholder.prototype)\n    }\n}\n\n/**\n * A special placeholder value used to specify \"gaps\" within curried functions,\n * allowing partial application of any combination of arguments, regardless of their positions.\n *\n * @group FP\n */\nexport const __ = new Placeholder()\ntype T__ = typeof __\n\n/**\n * Perform left-to-right function composition.\n *\n * @example\n * ```\n * pipe(\n *     [1, 2, 3, 4],\n *     arr => arr.map(v => v * 2),\n *     arr => arr.map(v => v + 2)\n * )\n * // [4, 6, 8, 10]\n *```\n * @group FP\n */\nexport function pipe<A, B>(value: A, op1: (input: A) => B): B\nexport function pipe<A, B, C>(\n    value: A,\n    op1: (input: A) => B,\n    op2: (input: B) => C,\n): C\nexport function pipe<A, B, C, D>(\n    value: A,\n    op1: (input: A) => B,\n    op2: (input: B) => C,\n    op3: (input: C) => D,\n): D\nexport function pipe<A, B, C, D, E>(\n    value: A,\n    op1: (input: A) => B,\n    op2: (input: B) => C,\n    op3: (input: C) => D,\n    op4: (input: D) => E,\n): E\nexport function pipe<A, B, C, D, E, F>(\n    value: A,\n    op1: (input: A) => B,\n    op2: (input: B) => C,\n    op3: (input: C) => D,\n    op4: (input: D) => E,\n    op5: (input: E) => F,\n): F\nexport function pipe<A, B, C, D, E, F, G>(\n    value: A,\n    op1: (input: A) => B,\n    op2: (input: B) => C,\n    op3: (input: C) => D,\n    op4: (input: D) => E,\n    op5: (input: E) => F,\n    op6: (input: F) => G,\n): G\nexport function pipe<A, B, C, D, E, F, G, H>(\n    value: A,\n    op1: (input: A) => B,\n    op2: (input: B) => C,\n    op3: (input: C) => D,\n    op4: (input: D) => E,\n    op5: (input: E) => F,\n    op6: (input: F) => G,\n    op7: (input: G) => H,\n): H\nexport function pipe(\n    value: unknown,\n    ...operations: Array<(value: unknown) => unknown>\n): unknown\nexport function pipe(\n    value: unknown,\n    ...operations: Array<(value: unknown) => unknown>\n): unknown {\n    return operations.reduce((prev, cur) => cur(prev), value)\n}\n\n/**\n * Perform right-to-left function composition.\n *\n * @example\n * ```\n * const func = compose(\n *     arr => arr.map(v => v + 2)\n *     (arr: number[]) => arr.map(v => v * 2),\n * )\n * // [4, 6, 8, 10]\n * //\n * ```\n * @group FP\n */\nexport function compose<T1, T2>(op1: (input: T1) => T2): (input: T1) => T2\nexport function compose<T1, T2, T3>(\n    op2: (input: T2) => T3,\n    op1: (input: T1) => T2,\n): (input: T1) => T3\nexport function compose<T1, T2, T3, T4>(\n    op3: (input: T3) => T4,\n    op2: (input: T2) => T3,\n    op1: (input: T1) => T2,\n): (input: T1) => T4\nexport function compose<T1, T2, T3, T4, T5>(\n    op4: (input: T4) => T5,\n    op3: (input: T3) => T4,\n    op2: (input: T2) => T3,\n    op1: (input: T1) => T2,\n): (input: T1) => T5\nexport function compose<T1, T2, T3, T4, T5, T6>(\n    op5: (input: T5) => T6,\n    op4: (input: T4) => T5,\n    op3: (input: T3) => T4,\n    op2: (input: T2) => T3,\n    op1: (input: T1) => T2,\n): (input: T1) => T6\nexport function compose<T1, T2, T3, T4, T5, T6, T7>(\n    op6: (input: T6) => T7,\n    op5: (input: T5) => T6,\n    op4: (input: T4) => T5,\n    op3: (input: T3) => T4,\n    op2: (input: T2) => T3,\n    op1: (input: T1) => T2,\n): (input: T1) => T7\nexport function compose<T1, T2, T3, T4, T5, T6, T7, T8>(\n    op7: (input: T7) => T8,\n    op6: (input: T6) => T7,\n    op5: (input: T5) => T6,\n    op4: (input: T4) => T5,\n    op3: (input: T3) => T4,\n    op2: (input: T2) => T3,\n    op1: (input: T1) => T2,\n): (input: T1) => T8\nexport function compose(\n    ...operations: Array<(value: unknown) => unknown>\n): (value: unknown) => unknown\nexport function compose(\n    ...operations: Array<(value: unknown) => unknown>\n): (value: unknown) => unknown {\n    return (value) => pipe(value, ...[...operations].reverse())\n}\n\ntype Curry1<T1, R> = {\n    (): Curry1<T1, R>\n    (t1: T1): R\n}\ntype Curry2<T1, T2, R> = {\n    (): Curry2<T1, T2, R>\n    (t1: T1): Curry1<T2, R>\n    (t1: T1, t2: T2): R\n    (t1: T__, t2: T2): Curry1<T1, R>\n    (t1: T1, t2: T__): Curry1<T2, R>\n}\ntype Curry3<T1, T2, T3, R> = {\n    (): Curry3<T1, T2, T3, R>\n    (t1: T1): Curry2<T2, T3, R>\n    (t1: T1, t2: T2): Curry1<T3, R>\n    (t1: T__, t2: T2): Curry2<T1, T3, R>\n    (t1: T1, t2: T__): Curry2<T2, T3, R>\n    (t1: T1, t2: T2, t3: T3): R\n    (t1: T__, t2: T2, t3: T3): Curry1<T1, R>\n    (t1: T1, t2: T__, t3: T3): Curry1<T2, R>\n    (t1: T1, t2: T2, t3: T__): Curry1<T3, R>\n    (t1: T__, t2: T__, t3: T3): Curry2<T1, T2, R>\n    (t1: T__, t2: T2, t3: T__): Curry2<T1, T3, R>\n    (t1: T1, t2: T__, t3: T__): Curry2<T2, T3, R>\n}\ntype Curry4<T1, T2, T3, T4, R> = {\n    (): Curry4<T1, T2, T3, T4, R>\n    (t1: T1): Curry3<T2, T3, T4, R>\n    (t1: T1, t2: T2): Curry2<T3, T4, R>\n    (t1: T__, t2: T2): Curry3<T1, T3, T4, R>\n    (t1: T1, t2: T__): Curry3<T2, T3, T4, R>\n    (t1: T1, t2: T2, t3: T3): Curry1<T4, R>\n    (t1: T__, t2: T2, t3: T3): Curry2<T1, T4, R>\n    (t1: T1, t2: T__, t3: T3): Curry2<T2, T4, R>\n    (t1: T1, t2: T2, t3: T__): Curry2<T3, T4, R>\n    (t1: T__, t2: T__, t3: T3): Curry3<T1, T2, T4, R>\n    (t1: T__, t2: T2, t3: T__): Curry3<T1, T3, T4, R>\n    (t1: T1, t2: T__, t3: T__): Curry3<T2, T3, T4, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4): R\n    (t1: T__, t2: T2, t3: T3, t4: T4): Curry1<T1, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4): Curry1<T2, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4): Curry1<T3, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__): Curry1<T4, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4): Curry2<T1, T2, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4): Curry2<T1, T3, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__): Curry2<T1, T4, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4): Curry2<T2, T3, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__): Curry2<T2, T4, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__): Curry2<T3, T4, R>\n    (t1: T__, t2: T__, t3: T__, t4: T4): Curry3<T1, T2, T3, R>\n    (t1: T__, t2: T__, t3: T3, t4: T__): Curry3<T1, T2, T4, R>\n    (t1: T__, t2: T2, t3: T__, t4: T__): Curry3<T1, T3, T4, R>\n    (t1: T1, t2: T__, t3: T__, t4: T__): Curry3<T2, T3, T4, R>\n}\ntype Curry5<T1, T2, T3, T4, T5, R> = {\n    (): Curry5<T1, T2, T3, T4, T5, R>\n    (t1: T1): Curry4<T2, T3, T4, T5, R>\n    (t1: T1, t2: T2): Curry3<T3, T4, T5, R>\n    (t1: T__, t2: T2): Curry4<T1, T3, T4, T5, R>\n    (t1: T1, t2: T__): Curry4<T2, T3, T4, T5, R>\n    (t1: T1, t2: T2, t3: T3): Curry2<T4, T5, R>\n    (t1: T__, t2: T2, t3: T3): Curry3<T1, T4, T5, R>\n    (t1: T1, t2: T__, t3: T3): Curry3<T2, T4, T5, R>\n    (t1: T1, t2: T2, t3: T__): Curry3<T3, T4, T5, R>\n    (t1: T__, t2: T__, t3: T3): Curry4<T1, T2, T4, T5, R>\n    (t1: T__, t2: T2, t3: T__): Curry4<T1, T3, T4, T5, R>\n    (t1: T1, t2: T__, t3: T__): Curry4<T2, T3, T4, T5, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4): Curry1<T5, R>\n    (t1: T__, t2: T2, t3: T3, t4: T4): Curry2<T1, T5, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4): Curry2<T2, T5, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4): Curry2<T3, T5, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__): Curry2<T4, T5, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4): Curry3<T1, T2, T5, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4): Curry3<T1, T3, T5, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__): Curry3<T1, T4, T5, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4): Curry3<T2, T3, T5, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__): Curry3<T2, T4, T5, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__): Curry3<T3, T4, T5, R>\n    (t1: T__, t2: T__, t3: T__, t4: T4): Curry4<T1, T2, T3, T5, R>\n    (t1: T__, t2: T__, t3: T3, t4: T__): Curry4<T1, T2, T4, T5, R>\n    (t1: T__, t2: T2, t3: T__, t4: T__): Curry4<T1, T3, T4, T5, R>\n    (t1: T1, t2: T__, t3: T__, t4: T__): Curry4<T2, T3, T4, T5, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R\n    (t1: T__, t2: T2, t3: T3, t4: T4, t5: T5): Curry1<T1, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4, t5: T5): Curry1<T2, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4, t5: T5): Curry1<T3, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__, t5: T5): Curry1<T4, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4, t5: T__): Curry1<T5, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4, t5: T5): Curry2<T1, T2, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4, t5: T5): Curry2<T1, T3, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__, t5: T5): Curry2<T1, T4, R>\n    (t1: T__, t2: T2, t3: T3, t4: T4, t5: T__): Curry2<T1, T5, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4, t5: T5): Curry2<T2, T3, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__, t5: T5): Curry2<T2, T4, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4, t5: T__): Curry2<T2, T5, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__, t5: T5): Curry2<T3, T4, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4, t5: T__): Curry2<T3, T5, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__, t5: T__): Curry2<T4, T5, R>\n    (t1: T__, t2: T__, t3: T__, t4: T4, t5: T5): Curry3<T1, T2, T3, R>\n    (t1: T__, t2: T__, t3: T3, t4: T__, t5: T5): Curry3<T1, T2, T4, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4, t5: T__): Curry3<T1, T2, T5, R>\n    (t1: T__, t2: T2, t3: T__, t4: T__, t5: T5): Curry3<T1, T3, T4, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4, t5: T__): Curry3<T1, T3, T5, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__, t5: T__): Curry3<T1, T4, T5, R>\n    (t1: T1, t2: T__, t3: T__, t4: T__, t5: T5): Curry3<T2, T3, T4, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4, t5: T__): Curry3<T2, T3, T5, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__, t5: T__): Curry3<T2, T4, T5, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__, t5: T__): Curry3<T3, T4, T5, R>\n    (t1: T__, t2: T__, t3: T__, t4: T__, t5: T5): Curry4<T1, T2, T3, T4, R>\n    (t1: T__, t2: T__, t3: T__, t4: T4, t5: T__): Curry4<T1, T2, T3, T5, R>\n    (t1: T__, t2: T__, t3: T3, t4: T__, t5: T__): Curry4<T1, T2, T4, T5, R>\n    (t1: T__, t2: T2, t3: T__, t4: T__, t5: T__): Curry4<T1, T3, T4, T5, R>\n    (t1: T1, t2: T__, t3: T__, t4: T__, t5: T__): Curry4<T2, T3, T4, T5, R>\n}\ntype Curry6<T1, T2, T3, T4, T5, T6, R> = {\n    (): Curry6<T1, T2, T3, T4, T5, T6, R>\n    (t1: T1): Curry5<T2, T3, T4, T5, T6, R>\n    (t1: T1, t2: T2): Curry4<T3, T4, T5, T6, R>\n    (t1: T__, t2: T2): Curry5<T1, T3, T4, T5, T6, R>\n    (t1: T1, t2: T__): Curry5<T2, T3, T4, T5, T6, R>\n    (t1: T1, t2: T2, t3: T3): Curry3<T4, T5, T6, R>\n    (t1: T__, t2: T2, t3: T3): Curry4<T1, T4, T5, T6, R>\n    (t1: T1, t2: T__, t3: T3): Curry4<T2, T4, T5, T6, R>\n    (t1: T1, t2: T2, t3: T__): Curry4<T3, T4, T5, T6, R>\n    (t1: T__, t2: T__, t3: T3): Curry5<T1, T2, T4, T5, T6, R>\n    (t1: T__, t2: T2, t3: T__): Curry5<T1, T3, T4, T5, T6, R>\n    (t1: T1, t2: T__, t3: T__): Curry5<T2, T3, T4, T5, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4): Curry2<T5, T6, R>\n    (t1: T__, t2: T2, t3: T3, t4: T4): Curry3<T1, T5, T6, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4): Curry3<T2, T5, T6, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4): Curry3<T3, T5, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__): Curry3<T4, T5, T6, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4): Curry4<T1, T2, T5, T6, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4): Curry4<T1, T3, T5, T6, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__): Curry4<T1, T4, T5, T6, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4): Curry4<T2, T3, T5, T6, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__): Curry4<T2, T4, T5, T6, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__): Curry4<T3, T4, T5, T6, R>\n    (t1: T__, t2: T__, t3: T__, t4: T4): Curry5<T1, T2, T3, T5, T6, R>\n    (t1: T__, t2: T__, t3: T3, t4: T__): Curry5<T1, T2, T4, T5, T6, R>\n    (t1: T__, t2: T2, t3: T__, t4: T__): Curry5<T1, T3, T4, T5, T6, R>\n    (t1: T1, t2: T__, t3: T__, t4: T__): Curry5<T2, T3, T4, T5, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): Curry1<T6, R>\n    (t1: T__, t2: T2, t3: T3, t4: T4, t5: T5): Curry2<T1, T6, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4, t5: T5): Curry2<T2, T6, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4, t5: T5): Curry2<T3, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__, t5: T5): Curry2<T4, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4, t5: T__): Curry2<T5, T6, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4, t5: T5): Curry3<T1, T2, T6, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4, t5: T5): Curry3<T1, T3, T6, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__, t5: T5): Curry3<T1, T4, T6, R>\n    (t1: T__, t2: T2, t3: T3, t4: T4, t5: T__): Curry3<T1, T5, T6, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4, t5: T5): Curry3<T2, T3, T6, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__, t5: T5): Curry3<T2, T4, T6, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4, t5: T__): Curry3<T2, T5, T6, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__, t5: T5): Curry3<T3, T4, T6, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4, t5: T__): Curry3<T3, T5, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__, t5: T__): Curry3<T4, T5, T6, R>\n    (t1: T__, t2: T__, t3: T__, t4: T4, t5: T5): Curry4<T1, T2, T3, T6, R>\n    (t1: T__, t2: T__, t3: T3, t4: T__, t5: T5): Curry4<T1, T2, T4, T6, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4, t5: T__): Curry4<T1, T2, T5, T6, R>\n    (t1: T__, t2: T2, t3: T__, t4: T__, t5: T5): Curry4<T1, T3, T4, T6, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4, t5: T__): Curry4<T1, T3, T5, T6, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__, t5: T__): Curry4<T1, T4, T5, T6, R>\n    (t1: T1, t2: T__, t3: T__, t4: T__, t5: T5): Curry4<T2, T3, T4, T6, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4, t5: T__): Curry4<T2, T3, T5, T6, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__, t5: T__): Curry4<T2, T4, T5, T6, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__, t5: T__): Curry4<T3, T4, T5, T6, R>\n    (t1: T__, t2: T__, t3: T__, t4: T__, t5: T5): Curry5<T1, T2, T3, T4, T6, R>\n    (t1: T__, t2: T__, t3: T__, t4: T4, t5: T__): Curry5<T1, T2, T3, T5, T6, R>\n    (t1: T__, t2: T__, t3: T3, t4: T__, t5: T__): Curry5<T1, T2, T4, T5, T6, R>\n    (t1: T__, t2: T2, t3: T__, t4: T__, t5: T__): Curry5<T1, T3, T4, T5, T6, R>\n    (t1: T1, t2: T__, t3: T__, t4: T__, t5: T__): Curry5<T2, T3, T4, T5, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6): R\n    (t1: T__, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6): Curry1<T1, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4, t5: T5, t6: T6): Curry1<T2, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4, t5: T5, t6: T6): Curry1<T3, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__, t5: T5, t6: T6): Curry1<T4, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4, t5: T__, t6: T6): Curry1<T5, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T__): Curry1<T6, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4, t5: T5, t6: T6): Curry2<T1, T2, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4, t5: T5, t6: T6): Curry2<T1, T3, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__, t5: T5, t6: T6): Curry2<T1, T4, R>\n    (t1: T__, t2: T2, t3: T3, t4: T4, t5: T__, t6: T6): Curry2<T1, T5, R>\n    (t1: T__, t2: T2, t3: T3, t4: T4, t5: T5, t6: T__): Curry2<T1, T6, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4, t5: T5, t6: T6): Curry2<T2, T3, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__, t5: T5, t6: T6): Curry2<T2, T4, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4, t5: T__, t6: T6): Curry2<T2, T5, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4, t5: T5, t6: T__): Curry2<T2, T6, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__, t5: T5, t6: T6): Curry2<T3, T4, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4, t5: T__, t6: T6): Curry2<T3, T5, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4, t5: T5, t6: T__): Curry2<T3, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__, t5: T__, t6: T6): Curry2<T4, T5, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__, t5: T5, t6: T__): Curry2<T4, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T4, t5: T__, t6: T__): Curry2<T5, T6, R>\n    (t1: T__, t2: T__, t3: T__, t4: T4, t5: T5, t6: T6): Curry3<T1, T2, T3, R>\n    (t1: T__, t2: T__, t3: T3, t4: T__, t5: T5, t6: T6): Curry3<T1, T2, T4, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4, t5: T__, t6: T6): Curry3<T1, T2, T5, R>\n    (t1: T__, t2: T__, t3: T3, t4: T4, t5: T5, t6: T__): Curry3<T1, T2, T6, R>\n    (t1: T__, t2: T2, t3: T__, t4: T__, t5: T5, t6: T6): Curry3<T1, T3, T4, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4, t5: T__, t6: T6): Curry3<T1, T3, T5, R>\n    (t1: T__, t2: T2, t3: T__, t4: T4, t5: T5, t6: T__): Curry3<T1, T3, T6, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__, t5: T__, t6: T6): Curry3<T1, T4, T5, R>\n    (t1: T__, t2: T2, t3: T3, t4: T__, t5: T5, t6: T__): Curry3<T1, T4, T6, R>\n    (t1: T__, t2: T2, t3: T3, t4: T4, t5: T__, t6: T__): Curry3<T1, T5, T6, R>\n    (t1: T1, t2: T__, t3: T__, t4: T__, t5: T5, t6: T6): Curry3<T2, T3, T4, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4, t5: T__, t6: T6): Curry3<T2, T3, T5, R>\n    (t1: T1, t2: T__, t3: T__, t4: T4, t5: T5, t6: T__): Curry3<T2, T3, T6, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__, t5: T__, t6: T6): Curry3<T2, T4, T5, R>\n    (t1: T1, t2: T__, t3: T3, t4: T__, t5: T5, t6: T__): Curry3<T2, T4, T6, R>\n    (t1: T1, t2: T__, t3: T3, t4: T4, t5: T__, t6: T__): Curry3<T2, T5, T6, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__, t5: T__, t6: T6): Curry3<T3, T4, T5, R>\n    (t1: T1, t2: T2, t3: T__, t4: T__, t5: T5, t6: T__): Curry3<T3, T4, T6, R>\n    (t1: T1, t2: T2, t3: T__, t4: T4, t5: T__, t6: T__): Curry3<T3, T5, T6, R>\n    (t1: T1, t2: T2, t3: T3, t4: T__, t5: T__, t6: T__): Curry3<T4, T5, T6, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T__,\n        t4: T__,\n        t5: T5,\n        t6: T6,\n    ): Curry4<T1, T2, T3, T4, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T__,\n        t4: T4,\n        t5: T__,\n        t6: T6,\n    ): Curry4<T1, T2, T3, T5, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T__,\n        t4: T4,\n        t5: T5,\n        t6: T__,\n    ): Curry4<T1, T2, T3, T6, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T3,\n        t4: T__,\n        t5: T__,\n        t6: T6,\n    ): Curry4<T1, T2, T4, T5, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T3,\n        t4: T__,\n        t5: T5,\n        t6: T__,\n    ): Curry4<T1, T2, T4, T6, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T3,\n        t4: T4,\n        t5: T__,\n        t6: T__,\n    ): Curry4<T1, T2, T5, T6, R>\n    (\n        t1: T__,\n        t2: T2,\n        t3: T__,\n        t4: T__,\n        t5: T__,\n        t6: T6,\n    ): Curry4<T1, T3, T4, T5, R>\n    (\n        t1: T__,\n        t2: T2,\n        t3: T__,\n        t4: T__,\n        t5: T5,\n        t6: T__,\n    ): Curry4<T1, T3, T4, T6, R>\n    (\n        t1: T__,\n        t2: T2,\n        t3: T__,\n        t4: T4,\n        t5: T__,\n        t6: T__,\n    ): Curry4<T1, T3, T5, T6, R>\n    (\n        t1: T__,\n        t2: T2,\n        t3: T3,\n        t4: T__,\n        t5: T__,\n        t6: T__,\n    ): Curry4<T1, T4, T5, T6, R>\n    (\n        t1: T1,\n        t2: T__,\n        t3: T__,\n        t4: T__,\n        t5: T__,\n        t6: T6,\n    ): Curry4<T2, T3, T4, T5, R>\n    (\n        t1: T1,\n        t2: T__,\n        t3: T__,\n        t4: T__,\n        t5: T5,\n        t6: T__,\n    ): Curry4<T2, T3, T4, T6, R>\n    (\n        t1: T1,\n        t2: T__,\n        t3: T__,\n        t4: T4,\n        t5: T__,\n        t6: T__,\n    ): Curry4<T2, T3, T5, T6, R>\n    (\n        t1: T1,\n        t2: T__,\n        t3: T3,\n        t4: T__,\n        t5: T__,\n        t6: T__,\n    ): Curry4<T2, T4, T5, T6, R>\n    (\n        t1: T1,\n        t2: T2,\n        t3: T__,\n        t4: T__,\n        t5: T__,\n        t6: T__,\n    ): Curry4<T3, T4, T5, T6, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T__,\n        t4: T__,\n        t5: T__,\n        t6: T6,\n    ): Curry5<T1, T2, T3, T4, T5, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T__,\n        t4: T__,\n        t5: T5,\n        t6: T__,\n    ): Curry5<T1, T2, T3, T4, T6, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T__,\n        t4: T4,\n        t5: T__,\n        t6: T__,\n    ): Curry5<T1, T2, T3, T5, T6, R>\n    (\n        t1: T__,\n        t2: T__,\n        t3: T3,\n        t4: T__,\n        t5: T__,\n        t6: T__,\n    ): Curry5<T1, T2, T4, T5, T6, R>\n    (\n        t1: T__,\n        t2: T2,\n        t3: T__,\n        t4: T__,\n        t5: T__,\n        t6: T__,\n    ): Curry5<T1, T3, T4, T5, T6, R>\n    (\n        t1: T1,\n        t2: T__,\n        t3: T__,\n        t4: T__,\n        t5: T__,\n        t6: T__,\n    ): Curry5<T2, T3, T4, T5, T6, R>\n}\n\n/**\n * Returns a curried equivalent of the provided function.\n *\n * Curried function can accept one or multiple parameter at the time:\n *\n * * `g(1)(2)(3)`\n * * `g(1)(2, 3)`\n * * `g(1, 2)(3)`\n * * `g(1, 2, 3)`\n *\n * The special placeholder value `__` may be used to specify \"gaps\", allowing partial application of any combination of arguments, regardless of their positions:\n *\n * * `g(1, 2, 3)`\n * * `g(_, 2, 3)(1)`\n * * `g(_, _, 3)(1)(2)`\n * * `g(_, _, 3)(1, 2)`\n * * `g(_, 2)(1)(3)`\n * * `g(_, 2)(1, 3)`\n * * `g(_, 2)(_, 3)(1)`\n * @example\n * ```\n * const addNumbers = (a, b, c, d) => a + b + c + d\n *\n * const addLastNumber = curry(addNumbers)(5, 5, 5)\n *\n * addLastNumber(5)\n *\n * const addFirst = curry(addNumbers)(__, 5, 5, 5)\n * addFirst(5)\n * ```\n * @group FP\n */\nexport function curry<T1, T2, R>(fn: (t1: T1, t2: T2) => R): Curry2<T1, T2, R>\nexport function curry<T1, T2, T3, R>(\n    fn: (t1: T1, t2: T2, t3: T3) => R,\n): Curry3<T1, T2, T3, R>\nexport function curry<T1, T2, T3, T4, R>(\n    fn: (t1: T1, t2: T2, t3: T3, t4: T4) => R,\n): Curry4<T1, T2, T3, T4, R>\nexport function curry<T1, T2, T3, T4, T5, R>(\n    fn: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R,\n): Curry5<T1, T2, T3, T4, T5, R>\nexport function curry<T1, T2, T3, T4, T5, T6, R>(\n    fn: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6) => R,\n): Curry6<T1, T2, T3, T4, T5, T6, R>\nexport function curry<T1, R>(fn: (t1: T1) => R): Curry1<T1, R>\nexport function curry(func: (...args: unknown[]) => unknown): unknown {\n    return function curried(this: unknown, ...args: unknown[]) {\n        if (args.some((v) => v instanceof Placeholder)) {\n            return function (this: unknown, ...args2: unknown[]) {\n                const args2Copy = [...args2]\n                const argsCopy = args.map((v) =>\n                    v instanceof Placeholder && args2Copy.length\n                        ? args2Copy.shift()\n                        : v,\n                )\n                return curried.apply(this, argsCopy.concat(args2Copy))\n            }\n        }\n\n        if (args.length >= func.length) {\n            return func.apply(this, args)\n        } else {\n            return function (this: unknown, ...args2: unknown[]) {\n                return curried.apply(this, args.concat(args2))\n            }\n        }\n    }\n}\n\n/**\n * Wraps callback to try/catch block\n *\n * @param callback\n * @returns\n * @example\n * ```\n * const result = tryCatch(() => fetch('http://example.com'))\n * if (value instanceof Error) {\n *     console.log(value.message)\n * }\n *\n * const parsedOrUndefined = tryCatch(() => JSON.parse(jsonString), undefined)\n * ```\n */\nexport function tryCatch<T>(callback: () => Promise<T>): Promise<T | Error>\nexport function tryCatch<T>(callback: () => T): T | Error\nexport function tryCatch<T, T2>(\n    callback: () => Promise<T>,\n    defaultValue: T2,\n): Promise<T | T2>\nexport function tryCatch<T, T2>(callback: () => T, defaultValue: T2): T | T2\nexport function tryCatch<T, T2>(\n    callback: () => T,\n    defaultValue?: T2,\n): T | T2 | Error | Promise<T | T2 | Error> {\n    const defaultValueProvided = arguments.length === 2\n\n    const handleError = (err: unknown) => {\n        const error = ensureError(err)\n        if (defaultValueProvided) {\n            return defaultValue as T2\n        }\n        return error\n    }\n\n    try {\n        const result = callback()\n        if (typeof Promise !== 'undefined' && result instanceof Promise) {\n            return result.catch(handleError)\n        }\n\n        return result\n    } catch (err) {\n        return handleError(err)\n    }\n}\n","import { generateRange, asciiLetters, digits, punctuation } from '.'\n\n/**\n * Returns a random integer between min (inclusive) and max (inclusive).\n *\n * @example\n * ```\n * randomInt(1, 10)\n * // 9\n * ```\n * @group Random\n */\nexport function randomInt(min: number, max: number): number {\n    const roundedMin = Math.ceil(min)\n    const roundedMax = Math.floor(max)\n    return Math.floor(Math.random() * (max - roundedMax + 1)) + roundedMin\n}\n\n/**\n * Returns a random element from the array or `undefined` if the array is empty.\n *\n * @example\n * ```\n * randomChoice([1, 2, 3, 4, 5])\n * // 2\n * ```\n * @group Random\n */\nexport function randomChoice<T>(array: ReadonlyArray<T>): T | undefined {\n    return array[Math.floor(Math.random() * array.length)]\n}\n\n/**\n * Generate new array by randomly picking items from provided array\n *\n * @example\n * ```\n * randomChoices([1, 2], 3)\n * // [2, 2, 1]\n * ```\n * @group Random\n */\nexport function randomChoices<T>(array: ReadonlyArray<T>, length: number): T[] {\n    if (!array.length) {\n        return []\n    }\n\n    return generateRange(length).map(() => randomChoice(array) as T)\n}\n\n/**\n * Generates random string between min (inclusive) and max (inclusive) length.\n *\n * By default it uses [[asciiLetters]] + [[digits]] + [[punctuation]]\n *\n * @param length\n * @param options\n * @returns\n */\nexport function randomString(\n    length: number,\n    options?: { chars?: string },\n): string {\n    const { chars = asciiLetters + digits + punctuation } = options ?? {}\n\n    return generateRange(length)\n        .map(() => chars.charAt(Math.floor(Math.random() * chars.length)))\n        .join('')\n}\n\n/**\n * Shuffles the the array.\n *\n * @example\n * ```\n * shuffle([1, 2, 3])\n * // [2, 1, 3]\n * ```\n * @group Random\n */\nexport function shuffle<T>(array: ReadonlyArray<T>): ReadonlyArray<T>\nexport function shuffle<T>(array: T[]): T[]\nexport function shuffle<T>(array: ReadonlyArray<T>): T[] {\n    const arrayCopy = array.slice()\n    let currentIndex = arrayCopy.length\n    let randomIndex = 0\n\n    // While there remain elements to shuffle...\n    while (0 !== currentIndex) {\n        // Pick a remaining element...\n        randomIndex = Math.floor(Math.random() * currentIndex)\n        currentIndex--\n\n        // And swap it with the current element.\n        ;[arrayCopy[currentIndex], arrayCopy[randomIndex]] = [\n            arrayCopy[randomIndex]!,\n            arrayCopy[currentIndex]!,\n        ]\n    }\n\n    return arrayCopy\n}\n","import { hashCode } from '.'\n\n/**\n * Caches the result of a function call by its arguments.\n *\n * @example\n * ```\n * const cached = cache(() => Math.random())\n * cached() // will be called immediately\n * cached() // will return the same value\n * ```\n */\nexport function cache<T extends Function>(func: T): T {\n    const cachedCalls: Record<number, unknown> = {}\n\n    return function (this: unknown) {\n        const argsHash = hashCode(arguments)\n\n        if (!(argsHash in cachedCalls)) {\n            const result = func.apply(this, arguments)\n\n            if (typeof Promise !== 'undefined' && result instanceof Promise) {\n                return result.then((resolvedResult) => {\n                    cachedCalls[argsHash] = resolvedResult\n\n                    return resolvedResult\n                })\n            }\n\n            cachedCalls[argsHash] = result\n        }\n\n        return cachedCalls[argsHash]\n    } as unknown as T\n}\n","/**\n * Base logger interface, compatible  with `console` or [winston](https://github.com/winstonjs/winston) logger\n *\n * @example\n * ```\n * const logger: Logger = console\n * logger.info('Hello world')\n * ```\n * @group Logging\n */\nexport interface Logger {\n    error(message: unknown, ...meta: unknown[]): void\n    warn(message: unknown, ...meta: unknown[]): void\n    info(message: unknown, ...meta: unknown[]): void\n    debug(message: unknown, ...meta: unknown[]): void\n}\n\n/**\n * Creates dummy logger object which ignores all logs\n *\n * @example\n * ```\n * const logger = createDummyLogger()\n * logger.info('Hello world')\n * // Nothing will be logged\n * ```\n * @group Logging\n */\nexport function createDummyLogger(): Logger {\n    return {\n        error() {},\n        warn() {},\n        info() {},\n        debug() {},\n    }\n}\n","/**\n * Returns a promise that resolves after the specified number of milliseconds.\n *\n * @group Async\n * @example\n * ```\n * await delay(1000) // wait for 1 second\n * ```\n */\nexport function delay(\n    /**\n     * The number of milliseconds to delay.\n     */\n    timeInMs: number,\n): Promise<void> {\n    return new Promise((resolve) => {\n        setTimeout(() => {\n            resolve()\n        }, timeInMs)\n    })\n}\n\n/**\n * Creates and returns a new debounced version of the passed function that will postpone its execution\n * until after wait milliseconds have elapsed since the last time it was invoked.\n *\n * @group Async\n * @example\n * ```\n * const debounced = debounce(() => console.log('debounced'), 100)\n * debounced() // will be called after 100ms\n * ```\n */\nexport function debounce<A extends unknown[]>(\n    /**\n     * The function to be debounced.\n     */\n    func: (...args: A) => void,\n    /**\n     * The number of milliseconds to delay.\n     */\n    timeInMs: number,\n): (this: unknown, ...args: A) => void {\n    let timer: ReturnType<typeof setTimeout>\n    return function () {\n        const args = arguments as unknown as A\n        clearTimeout(timer)\n        timer = setTimeout(() => {\n            func.apply(this, args)\n        }, timeInMs)\n    }\n}\n\n/**\n * Creates a throttled function that will execute `func` at most once per `timeInMs` interval.\n *\n * @group Async\n * @example\n * ```\n * const throttled = throttle(() => console.log('throttled'), 100)\n * throttled() // will be called immediately\n * throttled() // will be ignored\n * await delay(100)\n * throttled() // will be called after 100ms\n * ```\n */\nexport function throttle<A extends unknown[]>(\n    /**\n     * The function to be throttled.\n     */\n    func: (...args: A) => void,\n    /**\n     * The number of milliseconds to throttle invocations to.\n     */\n    timeInMs: number,\n    /**\n     * Options object.\n     */\n    options?: {\n        /**\n         * If `true` the `func` will be executed on the leading edge of the timeout.\n         * @defaultValue `true`\n         */\n        leading?: boolean\n        /**\n         * If `true` the `func` will be executed on the trailing edge of the timeout.\n         * @defaultValue `true`\n         */\n        trailing?: boolean\n    },\n): (this: unknown, ...args: A) => void {\n    let lastCallTime: number | undefined\n    let timer: ReturnType<typeof setTimeout> | undefined\n    let lastArgs: A\n    let lastThis: unknown\n\n    const { leading = true, trailing = true } = options ?? {}\n\n    return function () {\n        const now = Date.now()\n        const args = arguments as unknown as A\n        lastArgs = args\n        lastThis = this\n\n        if (leading && lastCallTime === undefined) {\n            lastCallTime = now\n            func.apply(lastThis, lastArgs)\n        } else if (\n            lastCallTime !== undefined &&\n            now - lastCallTime >= timeInMs\n        ) {\n            clearTimeout(timer)\n            lastCallTime = now\n            func.apply(lastThis, lastArgs)\n        } else if (trailing && !timer) {\n            timer = setTimeout(\n                () => {\n                    lastCallTime = now\n                    func.apply(lastThis, lastArgs)\n                    timer = undefined\n                },\n                lastCallTime === undefined\n                    ? timeInMs\n                    : timeInMs - (now - lastCallTime),\n            )\n        }\n    }\n}\n","import { flatMap, ensureArray, Primitive, isNullOrUndefined, isNot } from '../'\n\n/**\n * Generates cookie string\n *\n * @example\n * ```\n * // Create a cookie, valid across the entire site:\n * document.cookie = generateCookie('name', 'value')\n *\n * // Create a cookie that expires 7 days from now, valid across the entire site:\n * document.cookie = generateCookie('name', 'value', { expires: 7 })\n *\n * // Delete a cookie by setting the expires parameter to zero:\n * document.cookie = generateCookie('name', 'value', { expires: 0 })\n * ```\n * @param name cookie name\n * @param value cookie value\n */\nexport function generateCookie(\n    name: string,\n    value: string,\n    options?: {\n        /**\n         * Expire cookie after x days (negative to remove cookie)\n         *\n         * @default undefined Cookie is removed when the user closes the browser\n         */\n        expires?: number\n        /**\n         * A String indicating the path where the cookie is visible.\n         *\n         * @default undefined\n         */\n        path?: string\n        /**\n         * A String indicating a valid domain where the cookie should be visible. The cookie will also be visible to all subdomains.\n         *\n         * @default undefined Cookie is visible only to the domain or subdomain of the page where the cookie was created\n         */\n        domain?: string\n        /**\n         * A Boolean indicating if the cookie transmission requires a secure protocol (https).\n         *\n         * @default undefined No secure protocol requirement\n         */\n        secure?: boolean\n        /**\n         * A String, allowing to control whether the browser is sending a cookie along with cross-site requests.\n         *\n         * @default undefined No SameSite attribute set\n         */\n        sameSite?: 'strict' | 'lax' | 'none'\n    },\n): string {\n    const { expires } = options ?? {}\n\n    return [\n        `${encodeURIComponent(name)}=${encodeURIComponent(value)}`,\n        expires ? `expires=${new Date(expires * 864e5).toUTCString()}` : '',\n        options?.path ? `path=${options.path}` : '',\n        options?.domain ? `domain=${options.domain}` : '',\n        options?.secure ? 'secure' : '',\n        options?.sameSite ? `samesite=${options.sameSite}` : '',\n    ]\n        .filter((v) => !!v)\n        .join(';')\n}\n\n/**\n * Parses cookies string\n *\n * @example\n * ```\n * parseCookies(document.cookie)\n * // {session: '26e761be168533cbf0742f8c295176c7'}\n * ```\n * @group Http\n * @param cookieString `document.cookie` value\n */\nexport function parseCookies(cookieString: string): Record<string, string> {\n    return cookieString.split(/; /).reduce(\n        (prev, cur) => {\n            const [name, value] = cur.split('=', 2)\n            if (name != null && value != null) {\n                prev[decodeURIComponent(name)] = decodeURIComponent(\n                    value[0] === '\"' ? value.slice(1, -1) : value,\n                )\n            }\n            return prev\n        },\n        {} as Record<string, string>,\n    )\n}\n\n/**\n * Parse a query string given as a string argument.\n *\n * @example\n * ```\n * location.search\n * // ?page=1&limit=20\n *\n * parseQueryString(location.search)\n * // { page: ['1'], limit: ['20']}\n * ```\n * @group Http\n */\nexport function parseQueryString(\n    query: string,\n    options?: {\n        /**\n         * @default `&`\n         */\n        separator?: string\n    },\n): Record<string, string[]> {\n    const { separator = '&' } = options ?? {}\n\n    return flatMap(\n        (query[0] === '?' ? query.slice(1) : query)\n            .split(separator)\n            .filter((part) => part.indexOf('=') !== -1),\n        (part) => {\n            const [key = '', value = ''] = part.split('=', 2)\n\n            if (key) {\n                return [\n                    [\n                        decodeURIComponent(key),\n                        [decodeURIComponent(value.replace(/\\+/g, ' '))],\n                    ],\n                ] as const\n            }\n\n            return []\n        },\n    ).reduce<Record<string, string[]>>(\n        (prev, [key, value]) => ({\n            ...prev,\n            [key]: [...(prev[key] || []), ...value],\n        }),\n        {},\n    )\n}\n\n/**\n * Generates query string form provided object.\n *\n * @example\n * ```\n * generateQueryString({ page: 1, limit: 20})\n * // 'page=1&limit=20'\n * ```\n * @group Http\n * @param query\n * @param options\n * @returns\n */\nexport function generateQueryString(\n    query: Record<string, Primitive[] | Primitive>,\n    options?: {\n        /**\n         * @default `&`\n         */\n        separator?: string\n    },\n): string {\n    const { separator = '&' } = options ?? {}\n    return flatMap(Object.entries(query), ([key, values]) =>\n        ensureArray(values)\n            .filter(isNot(isNullOrUndefined))\n            .map(\n                (v) =>\n                    `${encodeURIComponent(key.toString())}=${encodeURIComponent(\n                        v.toString(),\n                    ).replace(/%20/g, '+')}`,\n            ),\n    ).join(separator)\n}\n\n/**\n * Converts absolute URL to relative\n *\n * @example\n * ```\n * urlToRelative('https://domain.com/index.html')\n * // /index.html\n * ```\n */\nexport function urlToRelative(url: string): string {\n    return `/${url.replace(/^(?:\\/\\/|[^/]+)*\\//, '')}`\n}\n\n// /**\n//  * Construct a full (`absolute`) URL by combining a `base URL` with another URL.\n//  *\n//  * @example\n//  * ```\n//  * urlToAbsolute('https://domain.com', 'index.html')\n//  * // https://domain.com/index.html\n//  * ```\n//  */\n// export function urlJoin(base: string, relative: string): string {\n//     const stack = base.split('/')\n//     const parts = relative.split('/')\n\n//     const minimalBase = base[0] && (!base[1] && !base[2]) ? base.slice(0, 3) : []\n//     parts.forEach((value, index) => {\n//         if (index === 0) {\n//             stack.pop()\n//         } else if (value === '.') {\n//             return\n//         } else if (value === '..') {\n//             stack.pop()\n//         } else {\n//             stack.push(value)\n//         }\n//     })\n\n//     return stack.join('/');\n// }\n\n// /**\n//  * Parses url string to separate parts.\n//  */\n// export function urlParse(url: string): {\n//     hash: string\n//     host: string\n//     hostname: string\n//     href: string\n//     origin: string\n//     pathname: string\n//     port: string\n//     protocol: string\n//     search: string\n//     username: string\n//     password: string\n// } {\n//     const match = url.match(/^(([^:\\/?#]+:)?(?:\\/\\/((?:([^\\/?#:]*):([^\\/?#:]*)@)?([^\\/?#:]*)(?::([^\\/?#:]*))?)))?([^?#]*)(\\?[^#]*)?(#.*)?$/)\n//     const value = {\n//             hash: match?.[10] || \"\",\n//             host: match?.[3] || \"\",\n//             hostname: match?.[6] || \"\",\n//             href: match?.[0] || \"\",\n//             origin: match?.[1] || \"\",\n//             pathname: match?.[8] || (match?.[1] ? \"/\" : \"\"),\n//             port: match?.[7] || \"\",\n//             protocol: match?.[2] || \"\",\n//             search: match?.[9] || \"\",\n//             username: match?.[4] || \"\",\n//             password: match?.[5] || \"\"\n//         };\n//     if (value.protocol.length == 2) {\n//         value.protocol = \"file:///\" + value.protocol.toUpperCase();\n//         value.origin = value.protocol + \"//\" + value.host;\n//     }\n//     value.href = value.origin + value.pathname + value.search + value.hash;\n//     return value;\n// }\n"],"names":["sortByCb","key","v","a","b","doCompare","keyA","keyB","Date","getTime","_res$","Array","map","i","filter","stringA","String","stringB","generateRange","start","stop","step","undefined","result","push","flatMap","array","callback","reduce","acc","index","concat","deduplicateBy","prims","boolean","number","string","objs","rawItem","item","type","indexOf","findIndex","compare","length","getFileParts","pathname","_pathname$split$pop","lastDirectory","split","pop","parts","extension","slice","mimeTypes","extensions","isNullOrUndefined","value","isNot","guard","data","isPlainObject","isObject","constructor","prototype","hasOwnProperty","ensureArray","ensureError","Error","asciiLowercase","asciiUppercase","asciiLetters","digits","punctuation","isLetter","toLowerCase","toUpperCase","camelCase","replace","_","p1","m","flatMapRecord","obj","Object","entries","prev","values","forEach","_ref2","merge","target","source","options","_ref3","_ref3$skipNulls","skipNulls","_ref3$arrayPolicy","arrayPolicy","_ref4","_extends","hashCode","jsonString","JSON","stringify","hash","charCodeAt","HttpStatusCodes","HttpStatusReasons","keyStr","codeToReason","_ref","HttpError","_Error","status","message","properties","_codeToReason$status","_properties$expose","_this","defaultMessage","privateMessage","call","this","expose","publicMessage","setPrototypeOf","_assertThisInitialized","_wrapNativeSuper","tagsToEncode","Placeholder","__PLACEHOLDER__","__","pipe","arguments","cur","randomChoice","Math","floor","random","input","output","enc1","charAt","enc2","enc3","enc4","chr2","chr3","fromCharCode","utf8Text","str","c1","c2","c3","decodeUTF8","n","c","encodeUTF8","chr1","isNaN","func","cachedCalls","argsHash","apply","Promise","then","resolvedResult","size","clone","recursive","_ref5","_arguments","reverse","_options$separator","_options$transformKey","_options$transformVal","sep","separator","keyTransformer","transformKey","valueTransformer","transformValue","parse","_unused","createValue","_ref6","_ref7","keys","_ref8","_ref9","every","sort","_ref10","error","warn","info","debug","curried","args","some","args2Copy","argsCopy","shift","timeInMs","timer","clearTimeout","setTimeout","html","_Object$entries$find","find","includes","resolve","v2","re","RegExp","join","_tagsToEncode$value","flatten","depth","d","val","bytes","decimals","dm","log","parseFloat","pow","toFixed","name","expires","encodeURIComponent","toUTCString","path","domain","secure","sameSite","query","_ref4$separator","toString","r","getByKey","keysList","restKeys","numKey","parseInt","mimeType","_mimeTypes$mimeType","_Object$entries$find2","extensionWithoutDot","keyCallback","_prev$keyHash","keyHash","prev2","_prev2$key","first","rest","v3","isEqual","entriesA","cookieString","_cur$split","decodeURIComponent","_ref2$separator","part","_part$split","_part$split$","_part$split$2","_extends2","_value$match","match","rawSize","rawUnit","unit","parsed","min","max","roundedMin","ceil","roundedMax","_ref$chars","chars","arrayCopy","currentIndex","randomIndex","arr","lastCallTime","lastArgs","lastThis","_ref$leading","leading","_ref$trailing","trailing","now","char","prevChar","ending","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