moderndash 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,9 +9,6 @@
9
9
  ✅ ESM
10
10
  ✅ Tree-shakable
11
11
  ✅ Typescript Strict Mode (no any)
12
- </div>
13
-
14
- <div align=center>
15
12
  ✅ Zero dependencies
16
13
  ✅ Hoverable Docs
17
14
  </div>
@@ -35,4 +32,4 @@ npm install moderndash
35
32
 
36
33
  ## Why is X lodash function not included?
37
34
  Please check [You-Dont-Need-Lodash](https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore) for native replacements.
38
- If you still think a function is missing please open an issue.
35
+ If you still think a function is missing please open an issue.
package/dist/index.cjs CHANGED
@@ -62,9 +62,7 @@ __export(src_exports, {
62
62
  throttle: () => throttle,
63
63
  times: () => times,
64
64
  unescapeHtml: () => unescapeHtml,
65
- uniq: () => uniq,
66
- uniqBy: () => uniqBy,
67
- uniqWith: () => uniqWith,
65
+ unique: () => unique,
68
66
  unzip: () => unzip,
69
67
  unzipWith: () => unzipWith,
70
68
  zip: () => zip,
@@ -309,24 +307,14 @@ function takeWhile(array, predicate) {
309
307
  return result;
310
308
  }
311
309
 
312
- // src/array/uniqWith.ts
313
- function uniqWith(array, comparator) {
310
+ // src/array/unique.ts
311
+ function unique(array, iteratee) {
312
+ const compareFn = (a, b) => isEqual(iteratee ? iteratee(a) : a, iteratee ? iteratee(b) : b);
314
313
  return array.filter((value, index, self) => {
315
- return self.findIndex((otherValue) => comparator(value, otherValue)) === index;
314
+ return self.findIndex((otherValue) => compareFn(value, otherValue)) === index;
316
315
  });
317
316
  }
318
317
 
319
- // src/array/uniq.ts
320
- function uniq(array) {
321
- return uniqWith(array, isEqual);
322
- }
323
-
324
- // src/array/uniqBy.ts
325
- function uniqBy(array, iteratee) {
326
- const iterateeFunction = getIterateFunction(iteratee);
327
- return uniqWith(array, (a, b) => iterateeFunction(a) === iterateeFunction(b));
328
- }
329
-
330
318
  // src/array/unzipWith.ts
331
319
  function unzipWith(array, iteratee) {
332
320
  const result = [];
@@ -714,9 +702,7 @@ function isUrl(str) {
714
702
  throttle,
715
703
  times,
716
704
  unescapeHtml,
717
- uniq,
718
- uniqBy,
719
- uniqWith,
705
+ unique,
720
706
  unzip,
721
707
  unzipWith,
722
708
  zip,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/array/chunk.ts","../src/array/count.ts","../src/array/differenceWith.ts","../src/validate/isEqual.ts","../src/array/difference.ts","../src/helpers/typeofChecks.ts","../src/helpers/shortHands.ts","../src/array/differenceBy.ts","../src/array/dropRightWhile.ts","../src/array/dropWhile.ts","../src/array/group.ts","../src/array/intersectionWith.ts","../src/array/intersection.ts","../src/array/intersectionBy.ts","../src/array/sample.ts","../src/array/sampleSize.ts","../src/array/shuffle.ts","../src/array/sort.ts","../src/array/takeRightWhile.ts","../src/array/takeWhile.ts","../src/array/uniqWith.ts","../src/array/uniq.ts","../src/array/uniqBy.ts","../src/array/unzipWith.ts","../src/array/unzip.ts","../src/array/zipWith.ts","../src/array/zip.ts","../src/function/after.ts","../src/function/before.ts","../src/function/debounce.ts","../src/function/memoize.ts","../src/function/once.ts","../src/function/throttle.ts","../src/function/times.ts","../src/object/pick.ts","../src/object/omit.ts","../src/promise/sleep.ts","../src/string/deburr.ts","../src/helpers/stringModifiers.ts","../src/string/camelCase.ts","../src/string/capitalize.ts","../src/string/escapeHtml.ts","../src/string/escapeRegExp.ts","../src/string/kebabCase.ts","../src/string/pascalCase.ts","../src/string/snakeCase.ts","../src/string/startCase.ts","../src/string/stripSpecial.ts","../src/string/unescapeHtml.ts","../src/validate/isEmpty.ts","../src/validate/isPlainObject.ts","../src/validate/isUrl.ts"],"sourcesContent":["export * from './array';\nexport * from './function';\nexport * from './object';\nexport * from './promise';\nexport * from './string';\nexport * from './types';\nexport * from './validate';\n","/**\n * Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.\n *\n * @category Array\n * @returns Returns the new array of chunks.\n * @param chunkSize - The array to process.\n * @param array - The length of each chunk\n * @example\n * chunk(2, ['a', 'b', 'c', 'd'])\n * // => [['a', 'b'], ['c', 'd']]\n *\n * chunk(3, ['a', 'b', 'c', 'd'])\n * // => [['a', 'b', 'c'], ['d']]\n */\n\nexport function chunk<TInput>(chunkSize: number, array: TInput[]): TInput[][] {\n const sizeInteger = Math.trunc(chunkSize);\n if (array.length === 0 || sizeInteger < 1) {\n return [];\n }\n\n const chunkedArray = [];\n let i = 0;\n\n while (i < array.length) {\n chunkedArray.push(array.slice(i, i + sizeInteger));\n i += sizeInteger;\n }\n\n return chunkedArray;\n}\n","import type { RecordKey } from '../types';\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`.\n *\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'betty', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ]\n *\n * count(users, value => value.active);\n * // => { 'true': 2, 'false': 1 }\n * @category Array\n * @param iteratee - The iteratee to transform keys.\n * @param collection - The array or record to iterate over.\n * @returns Returns the composed aggregate object.\n */\n\nexport function count<TInput, TKey extends RecordKey>(array: TInput[], iteratee: (value: TInput) => TKey): Record<TKey, number> {\n const result = {} as Record<TKey, number>;\n for (const value of array) {\n const key = iteratee(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (result[key] === undefined) {\n result[key] = 1;\n } else {\n result[key] += 1;\n }\n }\n return result;\n}\n","import type { MinimumTwoArrays } from '../types';\n\n/**\n * This method is like `difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`.\n * The order and references of result values are determined by the first array.\n * The comparator is invoked with two arguments: (arrVal, othVal).\n *\n * @example\n * differenceWith(isEqual, [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }], [{ 'x': 1, 'y': 2 }])\n * // => [{ 'x': 2, 'y': 1 }]\n * @category Array\n * @param comparator - The comparator invoked per element.\n * @param arrays - First array to inspect. Others are excluded.\n * @returns Returns the new array of filtered values.\n */\n\nexport function differenceWith<T>(comparator: (a: T, b: T) => boolean, ...arrays: MinimumTwoArrays<T>): T[] {\n const difference: T[] = [];\n const [firstArray, ...restArrays] = arrays;\n\n firstArray.forEach(element => {\n if (!restArrays.some(array => array.some(item => comparator(item, element)))) {\n difference.push(element);\n }\n });\n\n return difference;\n}\n","import type { RecordKey } from '../types';\n\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @example\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n * @category Validate\n * @param value1 - The value to compare.\n * @param value2 - The other value to compare.\n * @returns Returns `true` if the values are equivalent, else `false`.\n */\n\nexport function isEqual(value1: unknown, value2: unknown): boolean {\n if (value1 === value2) return true;\n\n if (Array.isArray(value1) && Array.isArray(value2)) {\n return isSameArray(value1, value2);\n }\n\n if (value1 instanceof RegExp && value2 instanceof RegExp) {\n return value1.toString() === value2.toString();\n }\n\n if (isObject(value1) && isObject(value2)) {\n return isSameObject(value1, value2);\n }\n\n return false;\n}\n\ntype KeyValueObject = Record<RecordKey, unknown>;\nfunction isObject(value: unknown): value is KeyValueObject {\n return typeof value === 'object'\n && value !== null\n && !Array.isArray(value)\n && Object.prototype.toString.call(value) === '[object Object]';\n}\n\nfunction isSameObject(value1: KeyValueObject, value2: KeyValueObject) {\n // check if the objects have the same keys\n const keys1 = Object.keys(value1);\n const keys2 = Object.keys(value2);\n if (!isEqual(keys1, keys2)) return false;\n\n // check if the values of each key in the objects are equal\n for (const key of keys1) {\n if (!isEqual(value1[key], value2[key])) return false;\n }\n\n // the objects are deeply equal\n return true;\n}\n\nfunction isSameArray(value1: unknown[], value2: unknown[]) {\n if (value1.length !== value2.length) return false;\n\n // check if the values of each element in the arrays are equal\n for (const [i, element] of value1.entries()) {\n if (!isEqual(element, value2[i])) return false;\n }\n\n return true;\n}\n","import type { MinimumTwoArrays } from '../types';\n\nimport { differenceWith } from '@array/differenceWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates an array of `array` values not included in the other given arrays. The order and references of result values are determined by the first array.\n *\n * **Note:** Unlike `pullAll`, this method returns a new array.\n *\n * @category Array\n * @param arrays - First array is inspected, others are excluded.\n * @returns Returns the new array of filtered values.\n * @example\n * difference([2, 1], [2, 3])\n * // => [1]\n */\n\nexport function difference<TInput>(...arrays: MinimumTwoArrays<TInput>): TInput[] {\n return differenceWith(isEqual, ...arrays);\n}\n","export function isObjectKey(key: unknown): key is keyof object {\n return typeof key === 'string' || typeof key === 'number' || typeof key === 'symbol';\n}\n","import type { IterateeFunction, PropertyShorthand } from '../types';\n\nimport { isObjectKey } from '@helpers/typeofChecks';\n\nexport function getPropertyShorthand<T, K extends keyof T>(key: K): (object: T) => T[K] {\n return object => object[key];\n}\n\nexport function getIterateFunction<T>(iteratee: IterateeFunction<T> | PropertyShorthand<T>) {\n if (typeof iteratee === 'function') {\n return iteratee;\n } else if (isObjectKey(iteratee)) {\n return getPropertyShorthand(iteratee);\n } else {\n throw new TypeError('Expected iteratee to be a function or a property name');\n }\n}\n","import type { IterateeFunction, MinimumTwoArrays, PropertyShorthand } from '../types';\n\nimport { differenceWith } from '@array/differenceWith';\nimport { getIterateFunction } from '@helpers/shortHands';\nimport { isEqual } from '@validate/isEqual.js';\n\n/**\n * This method is like `difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `pullAllBy`, this method returns a new array.\n *\n * @category Array\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @param arrays - First array to inspect. Others are excluded.\n\n * @returns Returns the new array of filtered values.\n * @example\n * differenceBy(Math.floor, [2.1, 1.2], [2.3, 3.4])\n * // => [1.2]\n * differenceBy('x', [{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }])\n * // => [{ 'x': 2 }]\n */\n\nexport function differenceBy<T>(iteratee: IterateeFunction<T> | PropertyShorthand<T>, ...arrays: MinimumTwoArrays<T>): T[] {\n const iterateeFn = getIterateFunction(iteratee);\n return differenceWith((a, b) => isEqual(iterateeFn(a), iterateeFn(b)), ...arrays);\n}\n","/**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * const users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': true }\n * ]\n *\n * dropRightWhile(users, { active }) => active)\n * // => objects for ['barney']\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n * @example\n */\n\n\nexport function dropRightWhile<T>(array: T[], predicate: (value: T) => boolean) {\n let i = array.length;\n while (i > 0 && predicate(array[i - 1])) {\n i--;\n }\n return array.slice(0, i);\n}\n","/**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': false }\n * ]\n *\n * dropWhile(users, ({ active }) => active)\n * // => objects for ['pebbles']\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n */\n\nexport function dropWhile<T>(array: T[], predicate: (value: T) => boolean): T[] {\n const index = array.findIndex(x => !predicate(x));\n return array.slice(index === -1 ? array.length : index);\n}\n","import type { RecordKey } from '../types';\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key.\n *\n * @example\n * group([6.1, 4.2, 6.3], Math.floor)\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * group([6.1, 4.2, 6.3], value => value > 5)\n * // => { 'false': [4.2], 'true': [6.1, 6.3] }\n * @category Array\n * @param collection - The array or object to iterate over.\n * @param iteratee - The iteratee to transform keys.\n * @returns Returns the composed aggregate object.\n */\n\nexport function group<T, U extends RecordKey>(array: T[], iteratee: (value: T) => U): Record<U, T[]> {\n const result = {} as Record<U, T[]>;\n for (const value of array) {\n const key = iteratee(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n result[key] = result[key] ?? [];\n result[key].push(value);\n }\n return result;\n}\n","import type { MinimumTwoArrays } from '../types';\n\n/**\n * This method is like `intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @example\n * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]\n *\n * intersectionWith(isEqual, objects, others)\n * // => [{ 'x': 1, 'y': 2 }]\n * @category Array\n * @param comparator - The comparator invoked per element.\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n */\n\nexport function intersectionWith<T>(comparator: (a: T, b: T) => boolean, ...arrays: MinimumTwoArrays<T>): T[] {\n const intersection: T[] = [];\n\n const [firstArray, ...restArrays] = arrays;\n\n firstArray.forEach(element => {\n if (restArrays.every(array => array.some(item => comparator(item, element)))) {\n intersection.push(element);\n }\n });\n\n return intersection;\n}\n","import type { MinimumTwoArrays } from '../types';\n\nimport { intersectionWith } from '@array/intersectionWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates an array of unique values that are included in all given arrays.\n * The order and references of result values are determined by the first array.\n *\n * @category Array\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n * @example\n * intersection([2, 1], [2, 3])\n * // => [2]\n */\n\nexport function intersection<TInput>(...arrays: MinimumTwoArrays<TInput>): TInput[] {\n return intersectionWith(isEqual, ...arrays);\n}\n","import type { IterateeFunction, MinimumTwoArrays, PropertyShorthand } from '../types';\n\nimport { intersectionWith } from '@array/intersectionWith';\nimport { getIterateFunction } from '@helpers/shortHands';\nimport { isEqual } from '@validate/isEqual.js';\n\n/**\n * This method is like `intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @example\n * intersectionBy(Math.floor, [2.1, 1.2], [2.3, 3.4])\n * // => [2.1]\n * @category Array\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n */\n\nexport function intersectionBy<TInput>(iteratee: IterateeFunction<TInput> | PropertyShorthand<TInput>, ...arrays: MinimumTwoArrays<TInput>): TInput[] {\n const iterateeFn = getIterateFunction(iteratee);\n return intersectionWith((a, b) => isEqual(iterateeFn(a), iterateeFn(b)), ...arrays);\n}\n","/**\n * Gets a random element from `array`.\n *\n * @example\n * sample([1, 2, 3, 4])\n * // => 2\n * @category Array\n * @param array - The array to sample.\n * @returns Returns the random element.\n */\n\nexport function sample<TInput>(array: TInput[]): TInput | undefined {\n if (array.length === 0) {\n return undefined;\n }\n const randomIndex = Math.floor(Math.random() * array.length);\n return array[randomIndex];\n}\n","import { sample } from '@array/sample';\n\n/**\n * Gets `n` random elements at unique keys from `array` up to the\n * size of `array`.\n *\n * @category Array\n * @param size The number of elements to sample.\n * @param array The array to sample.\n * @returns Returns the random elements.\n * @example\n * sampleSize([1, 2, 3], 2)\n * // => [3, 1]\n *\n * sampleSize([1, 2, 3], 4)\n * // => [2, 3, 1]\n */\n\nexport function sampleSize<TInput>(array: TInput[], size: number): TInput[] {\n const sampleArray: TInput[] = [];\n\n if (array.length === 0 || size <= 0) {\n return sampleArray;\n }\n\n for (let i = 0; i < size; i++) {\n sampleArray.push(sample(array) as TInput);\n }\n\n return sampleArray;\n}\n","/**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @example\n * shuffle([1, 2, 3, 4])\n * // => [4, 1, 3, 2]\n * @category Array\n * @param array - The array or object to shuffle.\n * @returns Returns the new shuffled array.\n */\n\nexport function shuffle<TInput>(array: TInput[]): TInput[] {\n const shuffledArray = [...array];\n let currentIndex = shuffledArray.length;\n let temporaryValue: TInput;\n let randomIndex: number;\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 -= 1;\n\n // And swap it with the current element.\n temporaryValue = shuffledArray[currentIndex];\n shuffledArray[currentIndex] = shuffledArray[randomIndex];\n shuffledArray[randomIndex] = temporaryValue;\n }\n\n return shuffledArray;\n}\n","\n/**\n * Sorts the array in ascending or descending order.\n * An iteratee function is optional to sort the array based on a specific property.\n *\n * @example\n * sort([1, 2, 3, 4], 'desc')\n * // => [4, 3, 2, 1]\n *\n * sort([{ a: 1 }, { a: 2 }, { a: 3 }], 'asc', item => item.a)\n * // => [{ a: 1 }, { a: 2 }, { a: 3 }]\n * @category Array\n * @param array - The array to sort.\n * @param order - The order in which to sort the array.\n * @param iteratee - The iteratee function to sort the array based on a specific property.\n * @returns Returns the sorted array.\n */\n\nexport function sort<TInput>(array: TInput[], order?: 'asc' | 'desc', iteratee?: (item: TInput) => number | bigint | Date | string): TInput[] {\n return [...array].sort((a, b) => {\n const aValue = iteratee ? iteratee(a) : a;\n const bValue = iteratee ? iteratee(b) : b;\n if (aValue < bValue) {\n return order === 'desc' ? 1 : -1;\n }\n if (aValue > bValue) {\n return order === 'desc' ? -1 : 1;\n }\n return 0;\n });\n}\n","/**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n * @example\n * const users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': true }\n * ]\n *\n * takeRightWhile(({ active }) => active, users)\n * // => objects for ['fred', 'pebbles']\n */\n\nexport function takeRightWhile<T>(predicate: (elem: T) => boolean, array: T[]): T[] {\n const result: T[] = [];\n\n for (let i = array.length - 1; i >= 0; i--) {\n if (predicate(array[i])) {\n result.unshift(array[i]);\n } else {\n break;\n }\n }\n\n return result;\n}\n","/**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @category Array\n * @param predicate The function invoked per iteration.\n * @param array The array to query.\n * @returns Returns the slice of `array`.\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': false }\n * ]\n *\n * takeWhile(({ active }) => active, users)\n * // => objects for ['barney', 'fred']\n */\n\nexport function takeWhile<T>(array: T[], predicate: (elem: T) => boolean): T[] {\n const result: T[] = [];\n\n for (const element of array) {\n if (predicate(element)) {\n result.push(element);\n } else {\n break;\n }\n }\n\n return result;\n}\n","/**\n * This method is like `uniq` except that it accepts `comparator` which is invoked to compare elements of `array`.\n * The order of result values is determined by the order they occur in the array.\n *\n * @category Array\n * @param array - The array to inspect.\n * @param comparator - The comparator invoked per element.\n * @returns Returns the new duplicate free array.\n * @example\n * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]\n *\n * uniqWith(isEqual, objects)\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n\nexport function uniqWith<TInput>(array: TInput[], comparator: (a: TInput, b: TInput) => boolean): TInput[] {\n return array.filter((value, index, self) => {\n return self.findIndex(otherValue => comparator(value, otherValue)) === index;\n });\n}\n","import { uniqWith } from '@array/uniqWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates a duplicate-free version of an array, in which only the first occurrence of each element is kept.\n * The order of result values is determined by the order they occur in the array.\n *\n * @category Array\n * @param array - The array to inspect.\n * @returns Returns the new duplicate free array.\n * @example\n * uniq([2, 1, 2])\n * // => [2, 1]\n */\n\nexport function uniq<TInput>(array: TInput[]): TInput[] {\n return uniqWith(array, isEqual);\n}\n","import type { IterateeFunction, PropertyShorthand } from '../types';\n\nimport { uniqWith } from '@array/uniqWith';\nimport { getIterateFunction } from '@helpers/shortHands';\n\n/**\n * This method is like `uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array.\n *\n * @category Array\n * @param array - The array to inspect.\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @returns Returns the new duplicate free array.\n * @example\n * uniqBy(Math.floor, [2.1, 1.2, 2.3])\n * // => [2.1, 1.2]\n */\n\nexport function uniqBy<T>( array: T[], iteratee: IterateeFunction<T> | PropertyShorthand<T>): T[] {\n const iterateeFunction = getIterateFunction(iteratee);\n\n return uniqWith(array, (a, b) => iterateeFunction(a) === iterateeFunction(b));\n}\n","/**\n * This method is like `unzip` except that it accepts `iteratee` to specify how regrouped values should be combined.\n *\n * @example\n * const zipped = zip([1, 2], [10, 20], [100, 200])\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * unzipWith(add, zipped)\n * // => [3, 30, 300]\n * @category Array\n * @param iteratee - The function to combine regrouped values.\n * @param array - The array of grouped elements to process.\n * @returns Returns the new array of regrouped elements.\n */\n\nexport function unzipWith<TInput extends unknown[], TOutput>(array: TInput[], iteratee: (...t: TInput) => TOutput): TOutput[] {\n const result: TOutput[] = [];\n\n for (const elements of array) {\n result.push(iteratee(...elements));\n }\n\n return result;\n}\n","import { unzipWith } from '@array/unzipWith';\n\n/**\n * This method is like `zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip configuration.\n *\n * @example\n * const zipped = zip(['a', 'b'], [1, 2], [true, false])\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * unzip(zipped)\n * // => [['a', 'b'], [1, 2], [true, false]]\n * @category Array\n * @param array - The array of grouped elements to process.\n * @returns Returns the new array of regrouped elements.\n */\n\nexport function unzip<TInput extends unknown[]>(array: TInput[]): TInput[] {\n return unzipWith(array, (...t) => t);\n}\n","// Types from https://gist.github.com/briancavalier/c4af1538ae9b2e4ab97caf14306625ab\ntype UnZip<A extends readonly unknown[]> = {\n [K in keyof A]: readonly A[K][]\n};\n\n/**\n * This method is like `zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @category Array\n * @param combineFunc - The function to combine grouped values.\n * @param arrays - The arrays to process.\n * @returns Returns the new array of grouped elements.\n * @example\n * zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c)\n * // => [111, 222]\n */\n\nexport function zipWith<Args extends unknown[], TOutput>(combineFunc: (...args: Args) => TOutput, ...arrays: UnZip<Args>): TOutput[] {\n const len = Math.min(...arrays.map(a => a.length));\n const zipped: TOutput[] = [];\n for (let i = 0; i < len; i++) {\n // Typescript needs the Args hint, or it infers any[]\n // TODO find a way to avoid the cast\n zipped[i] = combineFunc(...arrays.map(a => a[i]) as Args);\n }\n return zipped;\n}\n","import { zipWith } from '@array/zipWith';\n\n/**\n * Creates an array of grouped elements, the first of which contains the first elements of the given arrays,\n * the second of which contains the second elements of the given arrays, and so on.\n *\n * @category Array\n * @param arrays - The arrays to process.\n * @returns Returns the new array of grouped elements.\n * @example\n * zip(['a', 'b'], [1, 2], [true, false])\n * // => [['a', 1, true], ['b', 2, false]]\n */\n\nexport function zip<TInput>(...arrays: TInput[][]): TInput[][] {\n return zipWith((...t) => t, ...arrays);\n}\n","import type { GenericFunction } from '../types.js';\n\n/**\n * The opposite of `before`. This method creates a function that invokes `func` once it's called `n` or more times.\n *\n * @example\n * const caution = () => console.log(\"Caution!\");\n * const afterFN = after(2, caution);\n *\n * afterFN()\n * afterFN()\n * afterFN()\n * // => `caution` is invoked after called twice\n * @category Function\n * @param n The number of calls before `func` is invoked.\n * @param func The function to restrict.\n * @returns Returns the new restricted function.\n */\n\nexport function after<TFunc extends GenericFunction<TFunc>>(n: number, func: TFunc) {\n let count = 1;\n return (...args: Parameters<TFunc>): ReturnType<TFunc> | undefined => {\n if (count >= n) {\n return func(...args);\n }\n count += 1;\n };\n}\n","import type { GenericFunction } from 'src/types.js';\n\n/**\n * Creates a function that invokes `func`, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @category Function\n * @param n - The number of calls at which `func` is no longer invoked.\n * @param func - The function to restrict.\n * @returns Returns the new restricted function.\n * @example\n * const caution = () => console.log(\"Caution!\");\n *\n * // Only call caution two times\n * const reducedCaution = before(2, caution)\n *\n * reducedCaution()\n * reducedCaution()\n * reducedCaution()\n * // => `caution` is invoked twice\n */\n\nexport function before<TFunc extends GenericFunction<TFunc>>(n: number, func: TFunc): TFunc {\n let count = 0;\n let result: ReturnType<TFunc>;\n return ((...args: Parameters<TFunc>): ReturnType<TFunc> => {\n if (count < n) {\n count += 1;\n result = func(...args);\n }\n return result;\n }) as TFunc;\n}\n","import type { GenericFunction } from 'src/types.js';\n\n// TODO this is a port from lodash, it probably can be improved and shortened, also fix TS errors\nexport function debounce<TFunc extends GenericFunction<TFunc>>(\n fn: TFunc, wait = 0, options: { leading?: boolean, maxWait?: number, trailing?: boolean } = {}\n): (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>) => ReturnType<TFunc> {\n let lastArgs: Parameters<TFunc> | undefined;\n let lastThis: ThisParameterType<TFunc> | undefined;\n let result: ReturnType<TFunc>;\n let timerId: ReturnType<typeof setTimeout> | undefined;\n let lastCallTime: number | undefined;\n let lastInvokeTime = 0;\n const maxing = options.maxWait ?? false;\n const leading = options.leading ?? false;\n const trailing = options.trailing ?? true;\n const maxWait = options.maxWait ?? 0;\n\n function invokeFunc(time: number) {\n const args: Parameters<TFunc> | undefined = lastArgs;\n const thisArg: ThisParameterType<TFunc> | undefined = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n // @ts-expect-error\n result = fn.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time: number) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time: number) {\n // @ts-expect-error\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n const timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time: number) {\n if (lastCallTime === undefined)\n return true;\n\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return timeSinceLastCall >= wait || timeSinceLastCall < 0 || (maxing && timeSinceLastInvoke >= maxWait);\n }\n\n function timerExpired() {\n const time = Date.now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time: number) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `fn` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(Date.now());\n }\n\n function debounced(this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>): ReturnType<TFunc> {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs = args;\n // TODO Fix this assignment\n // eslint-disable-next-line @typescript-eslint/no-this-alias,unicorn/no-this-assignment\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n","import type{ GenericFunction } from 'src/types.js';\n\nconst defaultResolver = (...args: unknown[]) => JSON.stringify(args);\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, all arguments\n * provided to the memoized function are used as the map cache key.\n *\n * The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @example\n * const object = \\{ 'a': 1, 'b': 2 \\}\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(object)\n * // => [1, 2]\n *\n * object.a = 2\n * values(object)\n * // => [2, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n *\n * // Replace `memoize.Cache`.\n * memoize.Cache = WeakMap\n * @category Function\n * @param func - The function to have its output memoized.\n * @param resolver - The function to resolve the cache key.\n * @returns Returns the new memoized function.\n */\n\nexport function memoize<TFunc extends GenericFunction<TFunc>, Cache extends Map<string | symbol, ReturnType<TFunc>>>(\n func: TFunc, resolver: ((...args: Parameters<TFunc>) => string | symbol) = defaultResolver\n): TFunc & { cache: Cache } {\n\n const cache = new Map() as Cache;\n const memoizedFunc = (...args: Parameters<TFunc>): ReturnType<TFunc> => {\n const key = resolver(...args);\n if (cache.has(key)) {\n // eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style\n return cache.get(key) as ReturnType<TFunc>;\n }\n const result = func(...args);\n cache.set(key, result);\n return result;\n };\n memoizedFunc.cache = cache;\n return memoizedFunc as TFunc & { cache: Cache };\n}\n","import type { GenericFunction } from 'src/types.js';\n\nimport { before } from '@function/before';\n\n/**\n * Creates a function that is restricted to invoking `func` once.\n * Repeat calls to the function return the value of the first invocation.\n *\n * @example\n * const initialize = once(() => console.log('initialize'))\n * initialize()\n * initialize()\n * // => `createApplication` is invoked once\n *\n * @category Function\n * @param func - The function to restrict.\n * @returns Returns the new restricted function.\n */\n\nexport function once<TFunc extends GenericFunction<TFunc>>(func: TFunc): TFunc {\n return before(1, func);\n}\n","import type { GenericFunction } from 'src/types.js';\n\nimport { debounce } from '@function/debounce';\n\nexport function throttle<TFunc extends GenericFunction<TFunc>>(\n func: TFunc, wait = 0, options: { leading?: boolean, trailing?: boolean } = {}\n): (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>) => ReturnType<TFunc> {\n return debounce(func, wait, {\n leading: options.leading ?? true,\n maxWait: wait,\n trailing: options.trailing ?? true\n });\n}\n","/**\n * Invokes a function `n` times, returning an array of the results of\n * each invocation.\n *\n * The function is invoked with one argument: `index`\n *\n * @example\n * times(3, index => console.log(\"Run\", index)))\n * // => \"Run 0\" | \"Run 1\" | \"Run 2\"\n * times(3, Math.random)\n * // => [0.123, 0.456, 0.789]\n * times(4, () => 0)\n * // => [0, 0, 0, 0]\n * @category Function\n * @param n - The number of times to invoke `func`.\n * @param func - The function invoked per iteration.\n * @returns Returns an array of results.\n */\n\nexport function times<TInput>(n: number, func: (index: number) => TInput): TInput[] {\n const result: TInput[] = [];\n for (let i = 0; i < n; i++) {\n result.push(func(i));\n }\n return result;\n}","/**\n * Creates an object composed of the picked `object` properties.\n *\n * @example\n * const object = { 'a': 1, 'b': '2', 'c': 3 }\n *\n * pick(object, ['a', 'c'])\n * // => { 'a': 1, 'c': 3 }\n * @category Object\n * @param object - The source object.\n * @param keysToPick - The property paths to pick.\n * @returns Returns the new object.\n */\n\nexport function pick<TInput, Key extends keyof TInput>(object: TInput, keysToPick: Key[]): Pick<TInput, Key> {\n const result = {} as Pick<TInput, Key>;\n for (const key of keysToPick) {\n result[key] = object[key];\n }\n return result;\n}\n","import { pick } from './pick.js';\n\n/**\n * Omit specified keys from an object\n *\n * @example\n * const obj = {a: 1, b: 2, c: 3};\n * omit(obj, ['a', 'b']);\n * // => {c: 3}\n *\n * @param object - The object to filter\n * @param keysToOmit - The keys to exclude from the returned object\n * @returns - An object without the specified keys\n *\n */\n\nexport function omit<TObj extends object, Key extends keyof TObj>(object: TObj, keysToOmit: Key[]): Omit<TObj, Key> {\n const keys = Object.keys(object);\n const filteredKeys = keys.filter(key => !keysToOmit.includes(key as Key)) as Exclude<keyof TObj, Key>[];\n\n return pick(object, filteredKeys);\n}","/**\n * Sleeps for the given amount of time.\n *\n * @example\n * await sleep(1000);\n * // => Waits for 1 second.\n * @param ms - Amount of time to sleep in milliseconds.\n * @returns A promise that resolves after the given amount of time.\n */\nexport function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}","/**\n * Deburrs a string by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @example\n * deburr('déjà vu')\n * // => 'deja vu'\n * @category String\n * @param str - The string to deburr.\n * @returns Returns the deburred string.\n */\n\nexport function deburr(str: string): string {\n // eslint-disable-next-line no-control-regex\n return str.replace(/[^\\u0000-\\u007E]/g, (chr: string) =>\n chr.normalize('NFD').replace(/[\\u0300-\\u036F]/g, ''));\n}\n","import { deburr } from '@string/deburr';\n\nexport function splitWords(str: string): string[] {\n str = deburr(str);\n\n // Split non-alphanumeric characters with spaces and deal with camel/PascalCase\n const regex = new RegExp(\n '[^\\\\dA-Za-z]' + // match any character that is not a letter or a digit\n '|' + // or\n '(?<=[a-z])' + // lookbehind for a lowercase letter\n '(?=[A-Z])' + // lookahead for an uppercase letter\n '|' + // or\n '(?<=[A-Z])' + // lookbehind for an uppercase letter\n '(?=[A-Z][a-z])' // lookahead for an uppercase letter followed by a lowercase letter\n );\n\n return str.split(regex).filter(Boolean);\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts `string` to camelCase.\n *\n * @example\n * camelCase('Foo Bar')\n * // => 'fooBar'\n * camelCase('--foo-bar--')\n * // => 'fooBar'\n * camelCase('__FOO_BAR__')\n * // => 'fooBar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the camel cased string.\n */\n\nexport function camelCase(str: string): string {\n const words = splitWords(str);\n\n // Capitalize the first letter of each word\n const camelCase = words.map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n });\n\n return camelCase.join('');\n}\n","/**\n * Converts the first character of a string to upper case and the remaining to lower case.\n *\n * @example\n * capitalize('FRED')\n * // => 'Fred'\n * @category String\n * @param str - The string to capitalize.\n * @returns Returns the capitalized string.\n */\n\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","/**\n * Converts the characters `&`, `<`, `>`, `\"` and `'` in a string to their corresponding HTML entities.\n *\n * @example\n * escape('fred, barney, & pebbles')\n * // => 'fred, barney, &amp; pebbles'\n * @category String\n * @param str - The string to escape.\n * @returns Returns the escaped string.\n */\n\nexport function escapeHtml(str: string): string {\n const escapeChars: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\\'': '&#39;',\n '\"': '&quot;'\n };\n return str.replace(/[\"&'<>]/g, char => escapeChars[char] || char);\n}\n","/**\n * Escapes the `RegExp` special characters `^`, `$`, `\\`, `.`, `*`, `+`,\n * `?`, `(`, `)`, `[`, `]`, `{`, `}`, and `|` in a string.\n *\n * @example\n * escapeRegExp('[moderndash](https://moderndash.io/)')\n * // => '\\[moderndash\\]\\(https://moderndash\\.io/\\)'\n * @category String\n * @param str - The string to escape.\n * @returns Returns the escaped string.\n */\n\nexport function escapeRegExp(str: string): string {\n return str.replace(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&');\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to kebab-case.\n *\n * @example\n * kebabCase('Foo Bar')\n * // => 'foo-bar'\n * kebabCase('fooBar')\n * // => 'foo-bar'\n * kebabCase('__FOO_BAR__')\n * // => 'foo-bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the kebab cased string.\n */\n\nexport function kebabCase(str: string): string {\n const words = splitWords(str);\n let kebabCase = '';\n for (const word of words) {\n kebabCase += word.toLowerCase() + '-';\n }\n return kebabCase.slice(0, -1);\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n\n/**\n * Converts a string to PascalCase.\n *\n * @example\n * pascalCase('Foo Bar')\n * // => 'FooBar'\n * pascalCase('fooBar')\n * // => 'FooBar'\n * pascalCase('__FOO_BAR__')\n * // => 'FooBar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the pascal cased string.\n */\n\nexport function pascalCase(str: string): string {\n const words = splitWords(str);\n let pascalCase = '';\n for (const word of words) {\n pascalCase += word.charAt(0).toUpperCase() + word.slice(1);\n }\n return pascalCase;\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to snake_case.\n *\n * @example\n * snakeCase('Foo Bar')\n * // => 'foo_bar'\n * snakeCase('fooBar')\n * // => 'foo_bar'\n * snakeCase('--FOO-BAR--')\n * // => 'foo_bar'\n * snakeCase('foo2bar')\n * // => 'foo_2_bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the snake cased string.\n */\n\nexport function snakeCase(str: string): string {\n const words = splitWords(str);\n let snakeCase = '';\n for (const word of words) {\n if (snakeCase.length > 0) {\n snakeCase += '_';\n }\n snakeCase += word.toLowerCase();\n }\n return snakeCase;\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to Start Case.\n *\n * @example\n * startCase('--foo-bar--')\n * // => 'Foo Bar'\n * startCase('fooBar')\n * // => 'Foo Bar'\n * startCase('__FOO_BAR__')\n * // => 'Foo Bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the start cased string.\n */\n\nexport function startCase(str: string): string {\n const words = splitWords(str);\n let startCase = '';\n for (const word of words) {\n startCase += word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + ' ';\n }\n return startCase.trimEnd();\n}\n","import { deburr } from '@string/deburr';\n\n/**\n * Removes all special characters from a string.\n *\n * @example\n * stripSpecialChars('Héllo! World #$%&*!')\n * // => 'Hello World'\n * @category String\n * @param str - The string to remove special characters from.\n * @returns Returns the string with special characters removed.\n*/\n\nexport function stripSpecial(str: string): string {\n str = deburr(str);\n return str.replace(/[^\\s\\w]/gi, '');\n}\n","/**\n * Converts the HTML entities `&amp;`, `&lt;`, `&gt;`, `&quot;` and `&#39;`\n * in a string to their corresponding characters.\n *\n * @example\n * unescape('fred, barney, &amp; pebbles')\n * // => 'fred, barney, & pebbles'\n * @category String\n * @param str - The string to unescape.\n * @returns Returns the unescaped string.\n */\n\nexport function unescapeHtml(str: string): string {\n const entityMap: Record<string, string> = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': '\\''\n };\n return str.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g, (entity: string) => entityMap[entity] || entity);\n}\n","/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @example\n * isEmpty(null)\n * // => true\n *\n * isEmpty({})\n * // => true\n *\n * isEmpty(\"\")\n * // => true\n *\n * isEmpty([1, 2, 3])\n * // => false\n *\n * isEmpty('abc')\n * // => false\n *\n * isEmpty({ 'a': 1 })\n * // => false\n * @category Validate\n * @param value - The value to check.\n * @returns Returns `true` if given vlaue is empty, else `false`.\n */\n\nexport function isEmpty(value: string | object | null | undefined): boolean {\n if (value === null || value === undefined) {\n return true;\n }\n\n if (typeof value === 'string' || Array.isArray(value)) {\n return value.length === 0;\n }\n\n if (value instanceof Map || value instanceof Set) {\n return value.size === 0;\n }\n\n if (typeof value === 'object') {\n return Object.keys(value).length === 0;\n }\n\n return false;\n}\n","export function isPlainObject(value: unknown): value is object {\n return value !== null && typeof value === 'object' && value.constructor === Object;\n}\n","/**\n * Checks if given string is a valid URL\n *\n * @example\n * isUrl('https://google.com')\n * // => true\n * isUrl('google.com')\n * // => false\n * @param str - The string to check.\n * @returns Returns `true` if given string is a valid URL, else `false`.\n */\n\nexport function isUrl(str: string): boolean {\n try {\n new URL(str);\n return true;\n } catch {\n return false;\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,SAAS,MAAc,WAAmB,OAA6B;AAC1E,QAAM,cAAc,KAAK,MAAM,SAAS;AACx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EAClC;AACA,SAAOA;AACX;;;ACZO,SAAS,UAAU,KAAqB;AAC3C,QAAM,QAAQ,WAAW,GAAG;AAC5B,MAAIC,aAAY;AAChB,aAAW,QAAQ,OAAO;AACtB,IAAAA,cAAa,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,EAAE,YAAY,IAAI;AAAA,EAC9E;AACA,SAAOA,WAAU,QAAQ;AAC7B;;;ACXO,SAAS,aAAa,KAAqB;AAC9C,QAAM,OAAO,GAAG;AAChB,SAAO,IAAI,QAAQ,aAAa,EAAE;AACtC;;;ACJO,SAAS,aAAa,KAAqB;AAC9C,QAAM,YAAoC;AAAA,IACtC,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,EACb;AACA,SAAO,IAAI,QAAQ,kCAAkC,CAAC,WAAmB,UAAU,WAAW,MAAM;AACxG;;;ACWO,SAAS,QAAQ,OAAoD;AACxE,MAAI,UAAU,QAAQ,UAAU,QAAW;AACvC,WAAO;AAAA,EACX;AAEA,MAAI,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG;AACnD,WAAO,MAAM,WAAW;AAAA,EAC5B;AAEA,MAAI,iBAAiB,OAAO,iBAAiB,KAAK;AAC9C,WAAO,MAAM,SAAS;AAAA,EAC1B;AAEA,MAAI,OAAO,UAAU,UAAU;AAC3B,WAAO,OAAO,KAAK,KAAK,EAAE,WAAW;AAAA,EACzC;AAEA,SAAO;AACX;;;AClDO,SAAS,cAAc,OAAiC;AAC3D,SAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,MAAM,gBAAgB;AAChF;;;ACUO,SAAS,MAAM,KAAsB;AACxC,MAAI;AACA,QAAI,IAAI,GAAG;AACX,WAAO;AAAA,EACX,QAAE;AACE,WAAO;AAAA,EACX;AACJ;","names":["difference","intersection","count","count","camelCase","kebabCase","pascalCase","snakeCase","startCase"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/array/chunk.ts","../src/array/count.ts","../src/array/differenceWith.ts","../src/validate/isEqual.ts","../src/array/difference.ts","../src/helpers/typeofChecks.ts","../src/helpers/shortHands.ts","../src/array/differenceBy.ts","../src/array/dropRightWhile.ts","../src/array/dropWhile.ts","../src/array/group.ts","../src/array/intersectionWith.ts","../src/array/intersection.ts","../src/array/intersectionBy.ts","../src/array/sample.ts","../src/array/sampleSize.ts","../src/array/shuffle.ts","../src/array/sort.ts","../src/array/takeRightWhile.ts","../src/array/takeWhile.ts","../src/array/unique.ts","../src/array/unzipWith.ts","../src/array/unzip.ts","../src/array/zipWith.ts","../src/array/zip.ts","../src/function/after.ts","../src/function/before.ts","../src/function/debounce.ts","../src/function/memoize.ts","../src/function/once.ts","../src/function/throttle.ts","../src/function/times.ts","../src/object/pick.ts","../src/object/omit.ts","../src/promise/sleep.ts","../src/string/deburr.ts","../src/helpers/stringModifiers.ts","../src/string/camelCase.ts","../src/string/capitalize.ts","../src/string/escapeHtml.ts","../src/string/escapeRegExp.ts","../src/string/kebabCase.ts","../src/string/pascalCase.ts","../src/string/snakeCase.ts","../src/string/startCase.ts","../src/string/stripSpecial.ts","../src/string/unescapeHtml.ts","../src/validate/isEmpty.ts","../src/validate/isPlainObject.ts","../src/validate/isUrl.ts"],"sourcesContent":["export * from './array';\nexport * from './function';\nexport * from './object';\nexport * from './promise';\nexport * from './string';\nexport * from './types';\nexport * from './validate';\n","/**\n * Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.\n *\n * @category Array\n * @returns Returns the new array of chunks.\n * @param chunkSize - The array to process.\n * @param array - The length of each chunk\n * @example\n * chunk(2, ['a', 'b', 'c', 'd'])\n * // => [['a', 'b'], ['c', 'd']]\n *\n * chunk(3, ['a', 'b', 'c', 'd'])\n * // => [['a', 'b', 'c'], ['d']]\n */\n\nexport function chunk<TInput>(chunkSize: number, array: TInput[]): TInput[][] {\n const sizeInteger = Math.trunc(chunkSize);\n if (array.length === 0 || sizeInteger < 1) {\n return [];\n }\n\n const chunkedArray = [];\n let i = 0;\n\n while (i < array.length) {\n chunkedArray.push(array.slice(i, i + sizeInteger));\n i += sizeInteger;\n }\n\n return chunkedArray;\n}\n","import type { RecordKey } from '../types';\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`.\n *\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'betty', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ]\n *\n * count(users, value => value.active);\n * // => { 'true': 2, 'false': 1 }\n * @category Array\n * @param iteratee - The iteratee to transform keys.\n * @param collection - The array or record to iterate over.\n * @returns Returns the composed aggregate object.\n */\n\nexport function count<TInput, TKey extends RecordKey>(array: TInput[], iteratee: (value: TInput) => TKey): Record<TKey, number> {\n const result = {} as Record<TKey, number>;\n for (const value of array) {\n const key = iteratee(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (result[key] === undefined) {\n result[key] = 1;\n } else {\n result[key] += 1;\n }\n }\n return result;\n}\n","import type { MinimumTwoArrays } from '../types';\n\n/**\n * This method is like `difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`.\n * The order and references of result values are determined by the first array.\n * The comparator is invoked with two arguments: (arrVal, othVal).\n *\n * @example\n * differenceWith(isEqual, [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }], [{ 'x': 1, 'y': 2 }])\n * // => [{ 'x': 2, 'y': 1 }]\n * @category Array\n * @param comparator - The comparator invoked per element.\n * @param arrays - First array to inspect. Others are excluded.\n * @returns Returns the new array of filtered values.\n */\n\nexport function differenceWith<T>(comparator: (a: T, b: T) => boolean, ...arrays: MinimumTwoArrays<T>): T[] {\n const difference: T[] = [];\n const [firstArray, ...restArrays] = arrays;\n\n firstArray.forEach(element => {\n if (!restArrays.some(array => array.some(item => comparator(item, element)))) {\n difference.push(element);\n }\n });\n\n return difference;\n}\n","import type { RecordKey } from '../types';\n\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @example\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n * @category Validate\n * @param value1 - The value to compare.\n * @param value2 - The other value to compare.\n * @returns Returns `true` if the values are equivalent, else `false`.\n */\n\nexport function isEqual(value1: unknown, value2: unknown): boolean {\n if (value1 === value2) return true;\n\n if (Array.isArray(value1) && Array.isArray(value2)) {\n return isSameArray(value1, value2);\n }\n\n if (value1 instanceof RegExp && value2 instanceof RegExp) {\n return value1.toString() === value2.toString();\n }\n\n if (isObject(value1) && isObject(value2)) {\n return isSameObject(value1, value2);\n }\n\n return false;\n}\n\ntype KeyValueObject = Record<RecordKey, unknown>;\nfunction isObject(value: unknown): value is KeyValueObject {\n return typeof value === 'object'\n && value !== null\n && !Array.isArray(value)\n && Object.prototype.toString.call(value) === '[object Object]';\n}\n\nfunction isSameObject(value1: KeyValueObject, value2: KeyValueObject) {\n // check if the objects have the same keys\n const keys1 = Object.keys(value1);\n const keys2 = Object.keys(value2);\n if (!isEqual(keys1, keys2)) return false;\n\n // check if the values of each key in the objects are equal\n for (const key of keys1) {\n if (!isEqual(value1[key], value2[key])) return false;\n }\n\n // the objects are deeply equal\n return true;\n}\n\nfunction isSameArray(value1: unknown[], value2: unknown[]) {\n if (value1.length !== value2.length) return false;\n\n // check if the values of each element in the arrays are equal\n for (const [i, element] of value1.entries()) {\n if (!isEqual(element, value2[i])) return false;\n }\n\n return true;\n}\n","import type { MinimumTwoArrays } from '../types';\n\nimport { differenceWith } from '@array/differenceWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates an array of `array` values not included in the other given arrays. The order and references of result values are determined by the first array.\n *\n * **Note:** Unlike `pullAll`, this method returns a new array.\n *\n * @category Array\n * @param arrays - First array is inspected, others are excluded.\n * @returns Returns the new array of filtered values.\n * @example\n * difference([2, 1], [2, 3])\n * // => [1]\n */\n\nexport function difference<TInput>(...arrays: MinimumTwoArrays<TInput>): TInput[] {\n return differenceWith(isEqual, ...arrays);\n}\n","export function isObjectKey(key: unknown): key is keyof object {\n return typeof key === 'string' || typeof key === 'number' || typeof key === 'symbol';\n}\n","import type { IterateeFunction, PropertyShorthand } from '../types';\n\nimport { isObjectKey } from '@helpers/typeofChecks';\n\nexport function getPropertyShorthand<T, K extends keyof T>(key: K): (object: T) => T[K] {\n return object => object[key];\n}\n\nexport function getIterateFunction<T>(iteratee: IterateeFunction<T> | PropertyShorthand<T>) {\n if (typeof iteratee === 'function') {\n return iteratee;\n } else if (isObjectKey(iteratee)) {\n return getPropertyShorthand(iteratee);\n } else {\n throw new TypeError('Expected iteratee to be a function or a property name');\n }\n}\n","import type { IterateeFunction, MinimumTwoArrays, PropertyShorthand } from '../types';\n\nimport { differenceWith } from '@array/differenceWith';\nimport { getIterateFunction } from '@helpers/shortHands';\nimport { isEqual } from '@validate/isEqual.js';\n\n/**\n * This method is like `difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `pullAllBy`, this method returns a new array.\n *\n * @category Array\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @param arrays - First array to inspect. Others are excluded.\n\n * @returns Returns the new array of filtered values.\n * @example\n * differenceBy(Math.floor, [2.1, 1.2], [2.3, 3.4])\n * // => [1.2]\n * differenceBy('x', [{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }])\n * // => [{ 'x': 2 }]\n */\n\nexport function differenceBy<T>(iteratee: IterateeFunction<T> | PropertyShorthand<T>, ...arrays: MinimumTwoArrays<T>): T[] {\n const iterateeFn = getIterateFunction(iteratee);\n return differenceWith((a, b) => isEqual(iterateeFn(a), iterateeFn(b)), ...arrays);\n}\n","/**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * const users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': true }\n * ]\n *\n * dropRightWhile(users, { active }) => active)\n * // => objects for ['barney']\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n * @example\n */\n\n\nexport function dropRightWhile<T>(array: T[], predicate: (value: T) => boolean) {\n let i = array.length;\n while (i > 0 && predicate(array[i - 1])) {\n i--;\n }\n return array.slice(0, i);\n}\n","/**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': false }\n * ]\n *\n * dropWhile(users, ({ active }) => active)\n * // => objects for ['pebbles']\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n */\n\nexport function dropWhile<T>(array: T[], predicate: (value: T) => boolean): T[] {\n const index = array.findIndex(x => !predicate(x));\n return array.slice(index === -1 ? array.length : index);\n}\n","import type { RecordKey } from '../types';\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key.\n *\n * @example\n * group([6.1, 4.2, 6.3], Math.floor)\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * group([6.1, 4.2, 6.3], value => value > 5)\n * // => { 'false': [4.2], 'true': [6.1, 6.3] }\n * @category Array\n * @param collection - The array or object to iterate over.\n * @param iteratee - The iteratee to transform keys.\n * @returns Returns the composed aggregate object.\n */\n\nexport function group<T, U extends RecordKey>(array: T[], iteratee: (value: T) => U): Record<U, T[]> {\n const result = {} as Record<U, T[]>;\n for (const value of array) {\n const key = iteratee(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n result[key] = result[key] ?? [];\n result[key].push(value);\n }\n return result;\n}\n","import type { MinimumTwoArrays } from '../types';\n\n/**\n * This method is like `intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @example\n * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]\n *\n * intersectionWith(isEqual, objects, others)\n * // => [{ 'x': 1, 'y': 2 }]\n * @category Array\n * @param comparator - The comparator invoked per element.\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n */\n\nexport function intersectionWith<T>(comparator: (a: T, b: T) => boolean, ...arrays: MinimumTwoArrays<T>): T[] {\n const intersection: T[] = [];\n\n const [firstArray, ...restArrays] = arrays;\n\n firstArray.forEach(element => {\n if (restArrays.every(array => array.some(item => comparator(item, element)))) {\n intersection.push(element);\n }\n });\n\n return intersection;\n}\n","import type { MinimumTwoArrays } from '../types';\n\nimport { intersectionWith } from '@array/intersectionWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates an array of unique values that are included in all given arrays.\n * The order and references of result values are determined by the first array.\n *\n * @category Array\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n * @example\n * intersection([2, 1], [2, 3])\n * // => [2]\n */\n\nexport function intersection<TInput>(...arrays: MinimumTwoArrays<TInput>): TInput[] {\n return intersectionWith(isEqual, ...arrays);\n}\n","import type { IterateeFunction, MinimumTwoArrays, PropertyShorthand } from '../types';\n\nimport { intersectionWith } from '@array/intersectionWith';\nimport { getIterateFunction } from '@helpers/shortHands';\nimport { isEqual } from '@validate/isEqual.js';\n\n/**\n * This method is like `intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @example\n * intersectionBy(Math.floor, [2.1, 1.2], [2.3, 3.4])\n * // => [2.1]\n * @category Array\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n */\n\nexport function intersectionBy<TInput>(iteratee: IterateeFunction<TInput> | PropertyShorthand<TInput>, ...arrays: MinimumTwoArrays<TInput>): TInput[] {\n const iterateeFn = getIterateFunction(iteratee);\n return intersectionWith((a, b) => isEqual(iterateeFn(a), iterateeFn(b)), ...arrays);\n}\n","/**\n * Gets a random element from `array`.\n *\n * @example\n * sample([1, 2, 3, 4])\n * // => 2\n * @category Array\n * @param array - The array to sample.\n * @returns Returns the random element.\n */\n\nexport function sample<TInput>(array: TInput[]): TInput | undefined {\n if (array.length === 0) {\n return undefined;\n }\n const randomIndex = Math.floor(Math.random() * array.length);\n return array[randomIndex];\n}\n","import { sample } from '@array/sample';\n\n/**\n * Gets `n` random elements at unique keys from `array` up to the\n * size of `array`.\n *\n * @category Array\n * @param size The number of elements to sample.\n * @param array The array to sample.\n * @returns Returns the random elements.\n * @example\n * sampleSize([1, 2, 3], 2)\n * // => [3, 1]\n *\n * sampleSize([1, 2, 3], 4)\n * // => [2, 3, 1]\n */\n\nexport function sampleSize<TInput>(array: TInput[], size: number): TInput[] {\n const sampleArray: TInput[] = [];\n\n if (array.length === 0 || size <= 0) {\n return sampleArray;\n }\n\n for (let i = 0; i < size; i++) {\n sampleArray.push(sample(array) as TInput);\n }\n\n return sampleArray;\n}\n","/**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @example\n * shuffle([1, 2, 3, 4])\n * // => [4, 1, 3, 2]\n * @category Array\n * @param array - The array or object to shuffle.\n * @returns Returns the new shuffled array.\n */\n\nexport function shuffle<TInput>(array: TInput[]): TInput[] {\n const shuffledArray = [...array];\n let currentIndex = shuffledArray.length;\n let temporaryValue: TInput;\n let randomIndex: number;\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 -= 1;\n\n // And swap it with the current element.\n temporaryValue = shuffledArray[currentIndex];\n shuffledArray[currentIndex] = shuffledArray[randomIndex];\n shuffledArray[randomIndex] = temporaryValue;\n }\n\n return shuffledArray;\n}\n","\n/**\n * Sorts the array in ascending or descending order.\n * An iteratee function is optional to sort the array based on a specific property.\n *\n * @example\n * sort([1, 2, 3, 4], 'desc')\n * // => [4, 3, 2, 1]\n *\n * sort([{ a: 1 }, { a: 2 }, { a: 3 }], 'asc', item => item.a)\n * // => [{ a: 1 }, { a: 2 }, { a: 3 }]\n * @category Array\n * @param array - The array to sort.\n * @param order - The order in which to sort the array.\n * @param iteratee - The iteratee function to sort the array based on a specific property.\n * @returns Returns the sorted array.\n */\n\nexport function sort<TInput>(array: TInput[], order?: 'asc' | 'desc', iteratee?: (item: TInput) => number | bigint | Date | string): TInput[] {\n return [...array].sort((a, b) => {\n const aValue = iteratee ? iteratee(a) : a;\n const bValue = iteratee ? iteratee(b) : b;\n if (aValue < bValue) {\n return order === 'desc' ? 1 : -1;\n }\n if (aValue > bValue) {\n return order === 'desc' ? -1 : 1;\n }\n return 0;\n });\n}\n","/**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n * @example\n * const users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': true }\n * ]\n *\n * takeRightWhile(({ active }) => active, users)\n * // => objects for ['fred', 'pebbles']\n */\n\nexport function takeRightWhile<T>(predicate: (elem: T) => boolean, array: T[]): T[] {\n const result: T[] = [];\n\n for (let i = array.length - 1; i >= 0; i--) {\n if (predicate(array[i])) {\n result.unshift(array[i]);\n } else {\n break;\n }\n }\n\n return result;\n}\n","/**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @category Array\n * @param predicate The function invoked per iteration.\n * @param array The array to query.\n * @returns Returns the slice of `array`.\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': false }\n * ]\n *\n * takeWhile(({ active }) => active, users)\n * // => objects for ['barney', 'fred']\n */\n\nexport function takeWhile<T>(array: T[], predicate: (elem: T) => boolean): T[] {\n const result: T[] = [];\n\n for (const element of array) {\n if (predicate(element)) {\n result.push(element);\n } else {\n break;\n }\n }\n\n return result;\n}\n","import type { IterateeFunction } from 'src/types.js';\n\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates a duplicate-free version of an array, in which only the first occurrence of each element is kept.\n * The order of result values is determined by the order they occur in the array.\n *\n * An iteratee function is optional, to specify the value to be compared.\n *\n * @example\n * unique([2, 1, 2])\n * // => [2, 1]\n *\n * const users = [\n * { id: 1, name: 'a' },\n * { id: 1, name: 'c' }\n * ]\n *\n * unique(users, value => value.id)\n * // => [{ id: 1, name: 'a' }]\n *\n *\n * @category Array\n * @param array - The array to inspect.\n * @param iteratee - The iteratee invoked per element.\n * @returns Returns the new duplicate free array.\n */\n\nexport function unique<TInput>(array: TInput[], iteratee?: IterateeFunction<TInput>): TInput[] {\n const compareFn = (a: TInput, b: TInput) =>\n isEqual(iteratee ? iteratee(a) : a, iteratee ? iteratee(b) : b);\n\n return array.filter((value, index, self) => {\n return self.findIndex(otherValue => compareFn(value, otherValue)) === index;\n });\n}\n","/**\n * This method is like `unzip` except that it accepts `iteratee` to specify how regrouped values should be combined.\n *\n * @example\n * const zipped = zip([1, 2], [10, 20], [100, 200])\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * unzipWith(add, zipped)\n * // => [3, 30, 300]\n * @category Array\n * @param iteratee - The function to combine regrouped values.\n * @param array - The array of grouped elements to process.\n * @returns Returns the new array of regrouped elements.\n */\n\nexport function unzipWith<TInput extends unknown[], TOutput>(array: TInput[], iteratee: (...t: TInput) => TOutput): TOutput[] {\n const result: TOutput[] = [];\n\n for (const elements of array) {\n result.push(iteratee(...elements));\n }\n\n return result;\n}\n","import { unzipWith } from '@array/unzipWith';\n\n/**\n * This method is like `zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip configuration.\n *\n * @example\n * const zipped = zip(['a', 'b'], [1, 2], [true, false])\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * unzip(zipped)\n * // => [['a', 'b'], [1, 2], [true, false]]\n * @category Array\n * @param array - The array of grouped elements to process.\n * @returns Returns the new array of regrouped elements.\n */\n\nexport function unzip<TInput extends unknown[]>(array: TInput[]): TInput[] {\n return unzipWith(array, (...t) => t);\n}\n","// Types from https://gist.github.com/briancavalier/c4af1538ae9b2e4ab97caf14306625ab\ntype UnZip<A extends readonly unknown[]> = {\n [K in keyof A]: readonly A[K][]\n};\n\n/**\n * This method is like `zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @category Array\n * @param combineFunc - The function to combine grouped values.\n * @param arrays - The arrays to process.\n * @returns Returns the new array of grouped elements.\n * @example\n * zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c)\n * // => [111, 222]\n */\n\nexport function zipWith<Args extends unknown[], TOutput>(combineFunc: (...args: Args) => TOutput, ...arrays: UnZip<Args>): TOutput[] {\n const len = Math.min(...arrays.map(a => a.length));\n const zipped: TOutput[] = [];\n for (let i = 0; i < len; i++) {\n // Typescript needs the Args hint, or it infers any[]\n // TODO find a way to avoid the cast\n zipped[i] = combineFunc(...arrays.map(a => a[i]) as Args);\n }\n return zipped;\n}\n","import { zipWith } from '@array/zipWith';\n\n/**\n * Creates an array of grouped elements, the first of which contains the first elements of the given arrays,\n * the second of which contains the second elements of the given arrays, and so on.\n *\n * @category Array\n * @param arrays - The arrays to process.\n * @returns Returns the new array of grouped elements.\n * @example\n * zip(['a', 'b'], [1, 2], [true, false])\n * // => [['a', 1, true], ['b', 2, false]]\n */\n\nexport function zip<TInput>(...arrays: TInput[][]): TInput[][] {\n return zipWith((...t) => t, ...arrays);\n}\n","import type { GenericFunction } from '../types.js';\n\n/**\n * The opposite of `before`. This method creates a function that invokes `func` once it's called `n` or more times.\n *\n * @example\n * const caution = () => console.log(\"Caution!\");\n * const afterFN = after(2, caution);\n *\n * afterFN()\n * afterFN()\n * afterFN()\n * // => `caution` is invoked after called twice\n * @category Function\n * @param n The number of calls before `func` is invoked.\n * @param func The function to restrict.\n * @returns Returns the new restricted function.\n */\n\nexport function after<TFunc extends GenericFunction<TFunc>>(n: number, func: TFunc) {\n let count = 1;\n return (...args: Parameters<TFunc>): ReturnType<TFunc> | undefined => {\n if (count >= n) {\n return func(...args);\n }\n count += 1;\n };\n}\n","import type { GenericFunction } from 'src/types.js';\n\n/**\n * Creates a function that invokes `func`, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @category Function\n * @param n - The number of calls at which `func` is no longer invoked.\n * @param func - The function to restrict.\n * @returns Returns the new restricted function.\n * @example\n * const caution = () => console.log(\"Caution!\");\n *\n * // Only call caution two times\n * const reducedCaution = before(2, caution)\n *\n * reducedCaution()\n * reducedCaution()\n * reducedCaution()\n * // => `caution` is invoked twice\n */\n\nexport function before<TFunc extends GenericFunction<TFunc>>(n: number, func: TFunc): TFunc {\n let count = 0;\n let result: ReturnType<TFunc>;\n return ((...args: Parameters<TFunc>): ReturnType<TFunc> => {\n if (count < n) {\n count += 1;\n result = func(...args);\n }\n return result;\n }) as TFunc;\n}\n","import type { GenericFunction } from 'src/types.js';\n\n// TODO this is a port from lodash, it probably can be improved and shortened, also fix TS errors\nexport function debounce<TFunc extends GenericFunction<TFunc>>(\n fn: TFunc, wait = 0, options: { leading?: boolean, maxWait?: number, trailing?: boolean } = {}\n): (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>) => ReturnType<TFunc> {\n let lastArgs: Parameters<TFunc> | undefined;\n let lastThis: ThisParameterType<TFunc> | undefined;\n let result: ReturnType<TFunc>;\n let timerId: ReturnType<typeof setTimeout> | undefined;\n let lastCallTime: number | undefined;\n let lastInvokeTime = 0;\n const maxing = options.maxWait ?? false;\n const leading = options.leading ?? false;\n const trailing = options.trailing ?? true;\n const maxWait = options.maxWait ?? 0;\n\n function invokeFunc(time: number) {\n const args: Parameters<TFunc> | undefined = lastArgs;\n const thisArg: ThisParameterType<TFunc> | undefined = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n // @ts-expect-error\n result = fn.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time: number) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time: number) {\n // @ts-expect-error\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n const timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time: number) {\n if (lastCallTime === undefined)\n return true;\n\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return timeSinceLastCall >= wait || timeSinceLastCall < 0 || (maxing && timeSinceLastInvoke >= maxWait);\n }\n\n function timerExpired() {\n const time = Date.now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time: number) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `fn` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(Date.now());\n }\n\n function debounced(this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>): ReturnType<TFunc> {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs = args;\n // TODO Fix this assignment\n // eslint-disable-next-line @typescript-eslint/no-this-alias,unicorn/no-this-assignment\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n","import type{ GenericFunction } from 'src/types.js';\n\nconst defaultResolver = (...args: unknown[]) => JSON.stringify(args);\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, all arguments\n * provided to the memoized function are used as the map cache key.\n *\n * The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @example\n * const object = \\{ 'a': 1, 'b': 2 \\}\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(object)\n * // => [1, 2]\n *\n * object.a = 2\n * values(object)\n * // => [2, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n *\n * // Replace `memoize.Cache`.\n * memoize.Cache = WeakMap\n * @category Function\n * @param func - The function to have its output memoized.\n * @param resolver - The function to resolve the cache key.\n * @returns Returns the new memoized function.\n */\n\nexport function memoize<TFunc extends GenericFunction<TFunc>, Cache extends Map<string | symbol, ReturnType<TFunc>>>(\n func: TFunc, resolver: ((...args: Parameters<TFunc>) => string | symbol) = defaultResolver\n): TFunc & { cache: Cache } {\n\n const cache = new Map() as Cache;\n const memoizedFunc = (...args: Parameters<TFunc>): ReturnType<TFunc> => {\n const key = resolver(...args);\n if (cache.has(key)) {\n // eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style\n return cache.get(key) as ReturnType<TFunc>;\n }\n const result = func(...args);\n cache.set(key, result);\n return result;\n };\n memoizedFunc.cache = cache;\n return memoizedFunc as TFunc & { cache: Cache };\n}\n","import type { GenericFunction } from 'src/types.js';\n\nimport { before } from '@function/before';\n\n/**\n * Creates a function that is restricted to invoking `func` once.\n * Repeat calls to the function return the value of the first invocation.\n *\n * @example\n * const initialize = once(() => console.log('initialize'))\n * initialize()\n * initialize()\n * // => `createApplication` is invoked once\n *\n * @category Function\n * @param func - The function to restrict.\n * @returns Returns the new restricted function.\n */\n\nexport function once<TFunc extends GenericFunction<TFunc>>(func: TFunc): TFunc {\n return before(1, func);\n}\n","import type { GenericFunction } from 'src/types.js';\n\nimport { debounce } from '@function/debounce';\n\nexport function throttle<TFunc extends GenericFunction<TFunc>>(\n func: TFunc, wait = 0, options: { leading?: boolean, trailing?: boolean } = {}\n): (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>) => ReturnType<TFunc> {\n return debounce(func, wait, {\n leading: options.leading ?? true,\n maxWait: wait,\n trailing: options.trailing ?? true\n });\n}\n","/**\n * Invokes a function `n` times, returning an array of the results of\n * each invocation.\n *\n * The function is invoked with one argument: `index`\n *\n * @example\n * times(3, index => console.log(\"Run\", index)))\n * // => \"Run 0\" | \"Run 1\" | \"Run 2\"\n * times(3, Math.random)\n * // => [0.123, 0.456, 0.789]\n * times(4, () => 0)\n * // => [0, 0, 0, 0]\n * @category Function\n * @param n - The number of times to invoke `func`.\n * @param func - The function invoked per iteration.\n * @returns Returns an array of results.\n */\n\nexport function times<TInput>(n: number, func: (index: number) => TInput): TInput[] {\n const result: TInput[] = [];\n for (let i = 0; i < n; i++) {\n result.push(func(i));\n }\n return result;\n}","/**\n * Creates an object composed of the picked `object` properties.\n *\n * @example\n * const object = { 'a': 1, 'b': '2', 'c': 3 }\n *\n * pick(object, ['a', 'c'])\n * // => { 'a': 1, 'c': 3 }\n * @category Object\n * @param object - The source object.\n * @param keysToPick - The property paths to pick.\n * @returns Returns the new object.\n */\n\nexport function pick<TInput, Key extends keyof TInput>(object: TInput, keysToPick: Key[]): Pick<TInput, Key> {\n const result = {} as Pick<TInput, Key>;\n for (const key of keysToPick) {\n result[key] = object[key];\n }\n return result;\n}\n","import { pick } from './pick.js';\n\n/**\n * Omit specified keys from an object\n *\n * @example\n * const obj = {a: 1, b: 2, c: 3};\n * omit(obj, ['a', 'b']);\n * // => {c: 3}\n *\n * @param object - The object to filter\n * @param keysToOmit - The keys to exclude from the returned object\n * @returns - An object without the specified keys\n *\n */\n\nexport function omit<TObj extends object, Key extends keyof TObj>(object: TObj, keysToOmit: Key[]): Omit<TObj, Key> {\n const keys = Object.keys(object);\n const filteredKeys = keys.filter(key => !keysToOmit.includes(key as Key)) as Exclude<keyof TObj, Key>[];\n\n return pick(object, filteredKeys);\n}","/**\n * Sleeps for the given amount of time.\n *\n * @example\n * await sleep(1000);\n * // => Waits for 1 second.\n * @param ms - Amount of time to sleep in milliseconds.\n * @returns A promise that resolves after the given amount of time.\n */\nexport function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}","/**\n * Deburrs a string by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @example\n * deburr('déjà vu')\n * // => 'deja vu'\n * @category String\n * @param str - The string to deburr.\n * @returns Returns the deburred string.\n */\n\nexport function deburr(str: string): string {\n // eslint-disable-next-line no-control-regex\n return str.replace(/[^\\u0000-\\u007E]/g, (chr: string) =>\n chr.normalize('NFD').replace(/[\\u0300-\\u036F]/g, ''));\n}\n","import { deburr } from '@string/deburr';\n\nexport function splitWords(str: string): string[] {\n str = deburr(str);\n\n // Split non-alphanumeric characters with spaces and deal with camel/PascalCase\n const regex = new RegExp(\n '[^\\\\dA-Za-z]' + // match any character that is not a letter or a digit\n '|' + // or\n '(?<=[a-z])' + // lookbehind for a lowercase letter\n '(?=[A-Z])' + // lookahead for an uppercase letter\n '|' + // or\n '(?<=[A-Z])' + // lookbehind for an uppercase letter\n '(?=[A-Z][a-z])' // lookahead for an uppercase letter followed by a lowercase letter\n );\n\n return str.split(regex).filter(Boolean);\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts `string` to camelCase.\n *\n * @example\n * camelCase('Foo Bar')\n * // => 'fooBar'\n * camelCase('--foo-bar--')\n * // => 'fooBar'\n * camelCase('__FOO_BAR__')\n * // => 'fooBar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the camel cased string.\n */\n\nexport function camelCase(str: string): string {\n const words = splitWords(str);\n\n // Capitalize the first letter of each word\n const camelCase = words.map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n });\n\n return camelCase.join('');\n}\n","/**\n * Converts the first character of a string to upper case and the remaining to lower case.\n *\n * @example\n * capitalize('FRED')\n * // => 'Fred'\n * @category String\n * @param str - The string to capitalize.\n * @returns Returns the capitalized string.\n */\n\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","/**\n * Converts the characters `&`, `<`, `>`, `\"` and `'` in a string to their corresponding HTML entities.\n *\n * @example\n * escape('fred, barney, & pebbles')\n * // => 'fred, barney, &amp; pebbles'\n * @category String\n * @param str - The string to escape.\n * @returns Returns the escaped string.\n */\n\nexport function escapeHtml(str: string): string {\n const escapeChars: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\\'': '&#39;',\n '\"': '&quot;'\n };\n return str.replace(/[\"&'<>]/g, char => escapeChars[char] || char);\n}\n","/**\n * Escapes the `RegExp` special characters `^`, `$`, `\\`, `.`, `*`, `+`,\n * `?`, `(`, `)`, `[`, `]`, `{`, `}`, and `|` in a string.\n *\n * @example\n * escapeRegExp('[moderndash](https://moderndash.io/)')\n * // => '\\[moderndash\\]\\(https://moderndash\\.io/\\)'\n * @category String\n * @param str - The string to escape.\n * @returns Returns the escaped string.\n */\n\nexport function escapeRegExp(str: string): string {\n return str.replace(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&');\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to kebab-case.\n *\n * @example\n * kebabCase('Foo Bar')\n * // => 'foo-bar'\n * kebabCase('fooBar')\n * // => 'foo-bar'\n * kebabCase('__FOO_BAR__')\n * // => 'foo-bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the kebab cased string.\n */\n\nexport function kebabCase(str: string): string {\n const words = splitWords(str);\n let kebabCase = '';\n for (const word of words) {\n kebabCase += word.toLowerCase() + '-';\n }\n return kebabCase.slice(0, -1);\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n\n/**\n * Converts a string to PascalCase.\n *\n * @example\n * pascalCase('Foo Bar')\n * // => 'FooBar'\n * pascalCase('fooBar')\n * // => 'FooBar'\n * pascalCase('__FOO_BAR__')\n * // => 'FooBar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the pascal cased string.\n */\n\nexport function pascalCase(str: string): string {\n const words = splitWords(str);\n let pascalCase = '';\n for (const word of words) {\n pascalCase += word.charAt(0).toUpperCase() + word.slice(1);\n }\n return pascalCase;\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to snake_case.\n *\n * @example\n * snakeCase('Foo Bar')\n * // => 'foo_bar'\n * snakeCase('fooBar')\n * // => 'foo_bar'\n * snakeCase('--FOO-BAR--')\n * // => 'foo_bar'\n * snakeCase('foo2bar')\n * // => 'foo_2_bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the snake cased string.\n */\n\nexport function snakeCase(str: string): string {\n const words = splitWords(str);\n let snakeCase = '';\n for (const word of words) {\n if (snakeCase.length > 0) {\n snakeCase += '_';\n }\n snakeCase += word.toLowerCase();\n }\n return snakeCase;\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to Start Case.\n *\n * @example\n * startCase('--foo-bar--')\n * // => 'Foo Bar'\n * startCase('fooBar')\n * // => 'Foo Bar'\n * startCase('__FOO_BAR__')\n * // => 'Foo Bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the start cased string.\n */\n\nexport function startCase(str: string): string {\n const words = splitWords(str);\n let startCase = '';\n for (const word of words) {\n startCase += word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + ' ';\n }\n return startCase.trimEnd();\n}\n","import { deburr } from '@string/deburr';\n\n/**\n * Removes all special characters from a string.\n *\n * @example\n * stripSpecialChars('Héllo! World #$%&*!')\n * // => 'Hello World'\n * @category String\n * @param str - The string to remove special characters from.\n * @returns Returns the string with special characters removed.\n*/\n\nexport function stripSpecial(str: string): string {\n str = deburr(str);\n return str.replace(/[^\\s\\w]/gi, '');\n}\n","/**\n * Converts the HTML entities `&amp;`, `&lt;`, `&gt;`, `&quot;` and `&#39;`\n * in a string to their corresponding characters.\n *\n * @example\n * unescape('fred, barney, &amp; pebbles')\n * // => 'fred, barney, & pebbles'\n * @category String\n * @param str - The string to unescape.\n * @returns Returns the unescaped string.\n */\n\nexport function unescapeHtml(str: string): string {\n const entityMap: Record<string, string> = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': '\\''\n };\n return str.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g, (entity: string) => entityMap[entity] || entity);\n}\n","/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @example\n * isEmpty(null)\n * // => true\n *\n * isEmpty({})\n * // => true\n *\n * isEmpty(\"\")\n * // => true\n *\n * isEmpty([1, 2, 3])\n * // => false\n *\n * isEmpty('abc')\n * // => false\n *\n * isEmpty({ 'a': 1 })\n * // => false\n * @category Validate\n * @param value - The value to check.\n * @returns Returns `true` if given vlaue is empty, else `false`.\n */\n\nexport function isEmpty(value: string | object | null | undefined): boolean {\n if (value === null || value === undefined) {\n return true;\n }\n\n if (typeof value === 'string' || Array.isArray(value)) {\n return value.length === 0;\n }\n\n if (value instanceof Map || value instanceof Set) {\n return value.size === 0;\n }\n\n if (typeof value === 'object') {\n return Object.keys(value).length === 0;\n }\n\n return false;\n}\n","export function isPlainObject(value: unknown): value is object {\n return value !== null && typeof value === 'object' && value.constructor === Object;\n}\n","/**\n * Checks if given string is a valid URL\n *\n * @example\n * isUrl('https://google.com')\n * // => true\n * isUrl('google.com')\n * // => false\n * @param str - The string to check.\n * @returns Returns `true` if given string is a valid URL, else `false`.\n */\n\nexport function isUrl(str: string): boolean {\n try {\n new URL(str);\n return true;\n } catch {\n return false;\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAM,KAAsB;AACxC,MAAI;AACA,QAAI,IAAI,GAAG;AACX,WAAO;AAAA,EACX,QAAE;AACE,WAAO;AAAA,EACX;AACJ;","names":["difference","intersection","count","count","camelCase","kebabCase","pascalCase","snakeCase","startCase"]}
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ type NoUnion<T, U = T> = T extends U ? [U] extends [T] ? T : never : never;
24
24
  * @typeParam TFunc - The input function type
25
25
  */
26
26
  type GenericFunction<TFunc extends (...args: any) => any> = (...args: Parameters<TFunc>) => ReturnType<TFunc>;
27
+ type GenericObject = Record<RecordKey, unknown>;
27
28
 
28
29
  /**
29
30
  * Creates an object composed of keys generated from the results of running
@@ -314,46 +315,27 @@ declare function takeWhile<T>(array: T[], predicate: (elem: T) => boolean): T[];
314
315
  * Creates a duplicate-free version of an array, in which only the first occurrence of each element is kept.
315
316
  * The order of result values is determined by the order they occur in the array.
316
317
  *
317
- * @category Array
318
- * @param array - The array to inspect.
319
- * @returns Returns the new duplicate free array.
318
+ * An iteratee function is optional, to specify the value to be compared.
319
+ *
320
320
  * @example
321
- * uniq([2, 1, 2])
321
+ * unique([2, 1, 2])
322
322
  * // => [2, 1]
323
- */
324
- declare function uniq<TInput>(array: TInput[]): TInput[];
325
-
326
- /**
327
- * This method is like `uniq` except that it accepts `iteratee` which is
328
- * invoked for each element in `array` to generate the criterion by which
329
- * uniqueness is computed. The order of result values is determined by the
330
- * order they occur in the array.
331
323
  *
332
- * @category Array
333
- * @param array - The array to inspect.
334
- * @param iteratee - The iteratee invoked per element. Or property shorthand.
335
- * @returns Returns the new duplicate free array.
336
- * @example
337
- * uniqBy(Math.floor, [2.1, 1.2, 2.3])
338
- * // => [2.1, 1.2]
339
- */
340
- declare function uniqBy<T>(array: T[], iteratee: IterateeFunction<T> | PropertyShorthand<T>): T[];
341
-
342
- /**
343
- * This method is like `uniq` except that it accepts `comparator` which is invoked to compare elements of `array`.
344
- * The order of result values is determined by the order they occur in the array.
324
+ * const users = [
325
+ * { id: 1, name: 'a' },
326
+ * { id: 1, name: 'c' }
327
+ * ]
328
+ *
329
+ * unique(users, value => value.id)
330
+ * // => [{ id: 1, name: 'a' }]
331
+ *
345
332
  *
346
333
  * @category Array
347
334
  * @param array - The array to inspect.
348
- * @param comparator - The comparator invoked per element.
335
+ * @param iteratee - The iteratee invoked per element.
349
336
  * @returns Returns the new duplicate free array.
350
- * @example
351
- * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]
352
- *
353
- * uniqWith(isEqual, objects)
354
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
355
337
  */
356
- declare function uniqWith<TInput>(array: TInput[], comparator: (a: TInput, b: TInput) => boolean): TInput[];
338
+ declare function unique<TInput>(array: TInput[], iteratee?: IterateeFunction<TInput>): TInput[];
357
339
 
358
340
  /**
359
341
  * This method is like `zip` except that it accepts an array of grouped
@@ -821,4 +803,4 @@ declare function isPlainObject(value: unknown): value is object;
821
803
  */
822
804
  declare function isUrl(str: string): boolean;
823
805
 
824
- export { GenericFunction, IterateeFunction, MinimumTwoArrays, NoUnion, PropertyShorthand, RecordKey, after, before, camelCase, capitalize, chunk, count, debounce, deburr, difference, differenceBy, differenceWith, dropRightWhile, dropWhile, escapeHtml, escapeRegExp, group, intersection, intersectionBy, intersectionWith, isEmpty, isEqual, isPlainObject, isUrl, kebabCase, memoize, omit, once, pascalCase, pick, sample, sampleSize, shuffle, sleep, snakeCase, sort, startCase, stripSpecial, takeRightWhile, takeWhile, throttle, times, unescapeHtml, uniq, uniqBy, uniqWith, unzip, unzipWith, zip, zipWith };
806
+ export { GenericFunction, GenericObject, IterateeFunction, MinimumTwoArrays, NoUnion, PropertyShorthand, RecordKey, after, before, camelCase, capitalize, chunk, count, debounce, deburr, difference, differenceBy, differenceWith, dropRightWhile, dropWhile, escapeHtml, escapeRegExp, group, intersection, intersectionBy, intersectionWith, isEmpty, isEqual, isPlainObject, isUrl, kebabCase, memoize, omit, once, pascalCase, pick, sample, sampleSize, shuffle, sleep, snakeCase, sort, startCase, stripSpecial, takeRightWhile, takeWhile, throttle, times, unescapeHtml, unique, unzip, unzipWith, zip, zipWith };
package/dist/index.js CHANGED
@@ -235,24 +235,14 @@ function takeWhile(array, predicate) {
235
235
  return result;
236
236
  }
237
237
 
238
- // src/array/uniqWith.ts
239
- function uniqWith(array, comparator) {
238
+ // src/array/unique.ts
239
+ function unique(array, iteratee) {
240
+ const compareFn = (a, b) => isEqual(iteratee ? iteratee(a) : a, iteratee ? iteratee(b) : b);
240
241
  return array.filter((value, index, self) => {
241
- return self.findIndex((otherValue) => comparator(value, otherValue)) === index;
242
+ return self.findIndex((otherValue) => compareFn(value, otherValue)) === index;
242
243
  });
243
244
  }
244
245
 
245
- // src/array/uniq.ts
246
- function uniq(array) {
247
- return uniqWith(array, isEqual);
248
- }
249
-
250
- // src/array/uniqBy.ts
251
- function uniqBy(array, iteratee) {
252
- const iterateeFunction = getIterateFunction(iteratee);
253
- return uniqWith(array, (a, b) => iterateeFunction(a) === iterateeFunction(b));
254
- }
255
-
256
246
  // src/array/unzipWith.ts
257
247
  function unzipWith(array, iteratee) {
258
248
  const result = [];
@@ -639,9 +629,7 @@ export {
639
629
  throttle,
640
630
  times,
641
631
  unescapeHtml,
642
- uniq,
643
- uniqBy,
644
- uniqWith,
632
+ unique,
645
633
  unzip,
646
634
  unzipWith,
647
635
  zip,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/array/chunk.ts","../src/array/count.ts","../src/array/differenceWith.ts","../src/validate/isEqual.ts","../src/array/difference.ts","../src/helpers/typeofChecks.ts","../src/helpers/shortHands.ts","../src/array/differenceBy.ts","../src/array/dropRightWhile.ts","../src/array/dropWhile.ts","../src/array/group.ts","../src/array/intersectionWith.ts","../src/array/intersection.ts","../src/array/intersectionBy.ts","../src/array/sample.ts","../src/array/sampleSize.ts","../src/array/shuffle.ts","../src/array/sort.ts","../src/array/takeRightWhile.ts","../src/array/takeWhile.ts","../src/array/uniqWith.ts","../src/array/uniq.ts","../src/array/uniqBy.ts","../src/array/unzipWith.ts","../src/array/unzip.ts","../src/array/zipWith.ts","../src/array/zip.ts","../src/function/after.ts","../src/function/before.ts","../src/function/debounce.ts","../src/function/memoize.ts","../src/function/once.ts","../src/function/throttle.ts","../src/function/times.ts","../src/object/pick.ts","../src/object/omit.ts","../src/promise/sleep.ts","../src/string/deburr.ts","../src/helpers/stringModifiers.ts","../src/string/camelCase.ts","../src/string/capitalize.ts","../src/string/escapeHtml.ts","../src/string/escapeRegExp.ts","../src/string/kebabCase.ts","../src/string/pascalCase.ts","../src/string/snakeCase.ts","../src/string/startCase.ts","../src/string/stripSpecial.ts","../src/string/unescapeHtml.ts","../src/validate/isEmpty.ts","../src/validate/isPlainObject.ts","../src/validate/isUrl.ts"],"sourcesContent":["/**\n * Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.\n *\n * @category Array\n * @returns Returns the new array of chunks.\n * @param chunkSize - The array to process.\n * @param array - The length of each chunk\n * @example\n * chunk(2, ['a', 'b', 'c', 'd'])\n * // => [['a', 'b'], ['c', 'd']]\n *\n * chunk(3, ['a', 'b', 'c', 'd'])\n * // => [['a', 'b', 'c'], ['d']]\n */\n\nexport function chunk<TInput>(chunkSize: number, array: TInput[]): TInput[][] {\n const sizeInteger = Math.trunc(chunkSize);\n if (array.length === 0 || sizeInteger < 1) {\n return [];\n }\n\n const chunkedArray = [];\n let i = 0;\n\n while (i < array.length) {\n chunkedArray.push(array.slice(i, i + sizeInteger));\n i += sizeInteger;\n }\n\n return chunkedArray;\n}\n","import type { RecordKey } from '../types';\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`.\n *\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'betty', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ]\n *\n * count(users, value => value.active);\n * // => { 'true': 2, 'false': 1 }\n * @category Array\n * @param iteratee - The iteratee to transform keys.\n * @param collection - The array or record to iterate over.\n * @returns Returns the composed aggregate object.\n */\n\nexport function count<TInput, TKey extends RecordKey>(array: TInput[], iteratee: (value: TInput) => TKey): Record<TKey, number> {\n const result = {} as Record<TKey, number>;\n for (const value of array) {\n const key = iteratee(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (result[key] === undefined) {\n result[key] = 1;\n } else {\n result[key] += 1;\n }\n }\n return result;\n}\n","import type { MinimumTwoArrays } from '../types';\n\n/**\n * This method is like `difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`.\n * The order and references of result values are determined by the first array.\n * The comparator is invoked with two arguments: (arrVal, othVal).\n *\n * @example\n * differenceWith(isEqual, [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }], [{ 'x': 1, 'y': 2 }])\n * // => [{ 'x': 2, 'y': 1 }]\n * @category Array\n * @param comparator - The comparator invoked per element.\n * @param arrays - First array to inspect. Others are excluded.\n * @returns Returns the new array of filtered values.\n */\n\nexport function differenceWith<T>(comparator: (a: T, b: T) => boolean, ...arrays: MinimumTwoArrays<T>): T[] {\n const difference: T[] = [];\n const [firstArray, ...restArrays] = arrays;\n\n firstArray.forEach(element => {\n if (!restArrays.some(array => array.some(item => comparator(item, element)))) {\n difference.push(element);\n }\n });\n\n return difference;\n}\n","import type { RecordKey } from '../types';\n\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @example\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n * @category Validate\n * @param value1 - The value to compare.\n * @param value2 - The other value to compare.\n * @returns Returns `true` if the values are equivalent, else `false`.\n */\n\nexport function isEqual(value1: unknown, value2: unknown): boolean {\n if (value1 === value2) return true;\n\n if (Array.isArray(value1) && Array.isArray(value2)) {\n return isSameArray(value1, value2);\n }\n\n if (value1 instanceof RegExp && value2 instanceof RegExp) {\n return value1.toString() === value2.toString();\n }\n\n if (isObject(value1) && isObject(value2)) {\n return isSameObject(value1, value2);\n }\n\n return false;\n}\n\ntype KeyValueObject = Record<RecordKey, unknown>;\nfunction isObject(value: unknown): value is KeyValueObject {\n return typeof value === 'object'\n && value !== null\n && !Array.isArray(value)\n && Object.prototype.toString.call(value) === '[object Object]';\n}\n\nfunction isSameObject(value1: KeyValueObject, value2: KeyValueObject) {\n // check if the objects have the same keys\n const keys1 = Object.keys(value1);\n const keys2 = Object.keys(value2);\n if (!isEqual(keys1, keys2)) return false;\n\n // check if the values of each key in the objects are equal\n for (const key of keys1) {\n if (!isEqual(value1[key], value2[key])) return false;\n }\n\n // the objects are deeply equal\n return true;\n}\n\nfunction isSameArray(value1: unknown[], value2: unknown[]) {\n if (value1.length !== value2.length) return false;\n\n // check if the values of each element in the arrays are equal\n for (const [i, element] of value1.entries()) {\n if (!isEqual(element, value2[i])) return false;\n }\n\n return true;\n}\n","import type { MinimumTwoArrays } from '../types';\n\nimport { differenceWith } from '@array/differenceWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates an array of `array` values not included in the other given arrays. The order and references of result values are determined by the first array.\n *\n * **Note:** Unlike `pullAll`, this method returns a new array.\n *\n * @category Array\n * @param arrays - First array is inspected, others are excluded.\n * @returns Returns the new array of filtered values.\n * @example\n * difference([2, 1], [2, 3])\n * // => [1]\n */\n\nexport function difference<TInput>(...arrays: MinimumTwoArrays<TInput>): TInput[] {\n return differenceWith(isEqual, ...arrays);\n}\n","export function isObjectKey(key: unknown): key is keyof object {\n return typeof key === 'string' || typeof key === 'number' || typeof key === 'symbol';\n}\n","import type { IterateeFunction, PropertyShorthand } from '../types';\n\nimport { isObjectKey } from '@helpers/typeofChecks';\n\nexport function getPropertyShorthand<T, K extends keyof T>(key: K): (object: T) => T[K] {\n return object => object[key];\n}\n\nexport function getIterateFunction<T>(iteratee: IterateeFunction<T> | PropertyShorthand<T>) {\n if (typeof iteratee === 'function') {\n return iteratee;\n } else if (isObjectKey(iteratee)) {\n return getPropertyShorthand(iteratee);\n } else {\n throw new TypeError('Expected iteratee to be a function or a property name');\n }\n}\n","import type { IterateeFunction, MinimumTwoArrays, PropertyShorthand } from '../types';\n\nimport { differenceWith } from '@array/differenceWith';\nimport { getIterateFunction } from '@helpers/shortHands';\nimport { isEqual } from '@validate/isEqual.js';\n\n/**\n * This method is like `difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `pullAllBy`, this method returns a new array.\n *\n * @category Array\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @param arrays - First array to inspect. Others are excluded.\n\n * @returns Returns the new array of filtered values.\n * @example\n * differenceBy(Math.floor, [2.1, 1.2], [2.3, 3.4])\n * // => [1.2]\n * differenceBy('x', [{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }])\n * // => [{ 'x': 2 }]\n */\n\nexport function differenceBy<T>(iteratee: IterateeFunction<T> | PropertyShorthand<T>, ...arrays: MinimumTwoArrays<T>): T[] {\n const iterateeFn = getIterateFunction(iteratee);\n return differenceWith((a, b) => isEqual(iterateeFn(a), iterateeFn(b)), ...arrays);\n}\n","/**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * const users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': true }\n * ]\n *\n * dropRightWhile(users, { active }) => active)\n * // => objects for ['barney']\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n * @example\n */\n\n\nexport function dropRightWhile<T>(array: T[], predicate: (value: T) => boolean) {\n let i = array.length;\n while (i > 0 && predicate(array[i - 1])) {\n i--;\n }\n return array.slice(0, i);\n}\n","/**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': false }\n * ]\n *\n * dropWhile(users, ({ active }) => active)\n * // => objects for ['pebbles']\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n */\n\nexport function dropWhile<T>(array: T[], predicate: (value: T) => boolean): T[] {\n const index = array.findIndex(x => !predicate(x));\n return array.slice(index === -1 ? array.length : index);\n}\n","import type { RecordKey } from '../types';\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key.\n *\n * @example\n * group([6.1, 4.2, 6.3], Math.floor)\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * group([6.1, 4.2, 6.3], value => value > 5)\n * // => { 'false': [4.2], 'true': [6.1, 6.3] }\n * @category Array\n * @param collection - The array or object to iterate over.\n * @param iteratee - The iteratee to transform keys.\n * @returns Returns the composed aggregate object.\n */\n\nexport function group<T, U extends RecordKey>(array: T[], iteratee: (value: T) => U): Record<U, T[]> {\n const result = {} as Record<U, T[]>;\n for (const value of array) {\n const key = iteratee(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n result[key] = result[key] ?? [];\n result[key].push(value);\n }\n return result;\n}\n","import type { MinimumTwoArrays } from '../types';\n\n/**\n * This method is like `intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @example\n * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]\n *\n * intersectionWith(isEqual, objects, others)\n * // => [{ 'x': 1, 'y': 2 }]\n * @category Array\n * @param comparator - The comparator invoked per element.\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n */\n\nexport function intersectionWith<T>(comparator: (a: T, b: T) => boolean, ...arrays: MinimumTwoArrays<T>): T[] {\n const intersection: T[] = [];\n\n const [firstArray, ...restArrays] = arrays;\n\n firstArray.forEach(element => {\n if (restArrays.every(array => array.some(item => comparator(item, element)))) {\n intersection.push(element);\n }\n });\n\n return intersection;\n}\n","import type { MinimumTwoArrays } from '../types';\n\nimport { intersectionWith } from '@array/intersectionWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates an array of unique values that are included in all given arrays.\n * The order and references of result values are determined by the first array.\n *\n * @category Array\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n * @example\n * intersection([2, 1], [2, 3])\n * // => [2]\n */\n\nexport function intersection<TInput>(...arrays: MinimumTwoArrays<TInput>): TInput[] {\n return intersectionWith(isEqual, ...arrays);\n}\n","import type { IterateeFunction, MinimumTwoArrays, PropertyShorthand } from '../types';\n\nimport { intersectionWith } from '@array/intersectionWith';\nimport { getIterateFunction } from '@helpers/shortHands';\nimport { isEqual } from '@validate/isEqual.js';\n\n/**\n * This method is like `intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @example\n * intersectionBy(Math.floor, [2.1, 1.2], [2.3, 3.4])\n * // => [2.1]\n * @category Array\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n */\n\nexport function intersectionBy<TInput>(iteratee: IterateeFunction<TInput> | PropertyShorthand<TInput>, ...arrays: MinimumTwoArrays<TInput>): TInput[] {\n const iterateeFn = getIterateFunction(iteratee);\n return intersectionWith((a, b) => isEqual(iterateeFn(a), iterateeFn(b)), ...arrays);\n}\n","/**\n * Gets a random element from `array`.\n *\n * @example\n * sample([1, 2, 3, 4])\n * // => 2\n * @category Array\n * @param array - The array to sample.\n * @returns Returns the random element.\n */\n\nexport function sample<TInput>(array: TInput[]): TInput | undefined {\n if (array.length === 0) {\n return undefined;\n }\n const randomIndex = Math.floor(Math.random() * array.length);\n return array[randomIndex];\n}\n","import { sample } from '@array/sample';\n\n/**\n * Gets `n` random elements at unique keys from `array` up to the\n * size of `array`.\n *\n * @category Array\n * @param size The number of elements to sample.\n * @param array The array to sample.\n * @returns Returns the random elements.\n * @example\n * sampleSize([1, 2, 3], 2)\n * // => [3, 1]\n *\n * sampleSize([1, 2, 3], 4)\n * // => [2, 3, 1]\n */\n\nexport function sampleSize<TInput>(array: TInput[], size: number): TInput[] {\n const sampleArray: TInput[] = [];\n\n if (array.length === 0 || size <= 0) {\n return sampleArray;\n }\n\n for (let i = 0; i < size; i++) {\n sampleArray.push(sample(array) as TInput);\n }\n\n return sampleArray;\n}\n","/**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @example\n * shuffle([1, 2, 3, 4])\n * // => [4, 1, 3, 2]\n * @category Array\n * @param array - The array or object to shuffle.\n * @returns Returns the new shuffled array.\n */\n\nexport function shuffle<TInput>(array: TInput[]): TInput[] {\n const shuffledArray = [...array];\n let currentIndex = shuffledArray.length;\n let temporaryValue: TInput;\n let randomIndex: number;\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 -= 1;\n\n // And swap it with the current element.\n temporaryValue = shuffledArray[currentIndex];\n shuffledArray[currentIndex] = shuffledArray[randomIndex];\n shuffledArray[randomIndex] = temporaryValue;\n }\n\n return shuffledArray;\n}\n","\n/**\n * Sorts the array in ascending or descending order.\n * An iteratee function is optional to sort the array based on a specific property.\n *\n * @example\n * sort([1, 2, 3, 4], 'desc')\n * // => [4, 3, 2, 1]\n *\n * sort([{ a: 1 }, { a: 2 }, { a: 3 }], 'asc', item => item.a)\n * // => [{ a: 1 }, { a: 2 }, { a: 3 }]\n * @category Array\n * @param array - The array to sort.\n * @param order - The order in which to sort the array.\n * @param iteratee - The iteratee function to sort the array based on a specific property.\n * @returns Returns the sorted array.\n */\n\nexport function sort<TInput>(array: TInput[], order?: 'asc' | 'desc', iteratee?: (item: TInput) => number | bigint | Date | string): TInput[] {\n return [...array].sort((a, b) => {\n const aValue = iteratee ? iteratee(a) : a;\n const bValue = iteratee ? iteratee(b) : b;\n if (aValue < bValue) {\n return order === 'desc' ? 1 : -1;\n }\n if (aValue > bValue) {\n return order === 'desc' ? -1 : 1;\n }\n return 0;\n });\n}\n","/**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n * @example\n * const users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': true }\n * ]\n *\n * takeRightWhile(({ active }) => active, users)\n * // => objects for ['fred', 'pebbles']\n */\n\nexport function takeRightWhile<T>(predicate: (elem: T) => boolean, array: T[]): T[] {\n const result: T[] = [];\n\n for (let i = array.length - 1; i >= 0; i--) {\n if (predicate(array[i])) {\n result.unshift(array[i]);\n } else {\n break;\n }\n }\n\n return result;\n}\n","/**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @category Array\n * @param predicate The function invoked per iteration.\n * @param array The array to query.\n * @returns Returns the slice of `array`.\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': false }\n * ]\n *\n * takeWhile(({ active }) => active, users)\n * // => objects for ['barney', 'fred']\n */\n\nexport function takeWhile<T>(array: T[], predicate: (elem: T) => boolean): T[] {\n const result: T[] = [];\n\n for (const element of array) {\n if (predicate(element)) {\n result.push(element);\n } else {\n break;\n }\n }\n\n return result;\n}\n","/**\n * This method is like `uniq` except that it accepts `comparator` which is invoked to compare elements of `array`.\n * The order of result values is determined by the order they occur in the array.\n *\n * @category Array\n * @param array - The array to inspect.\n * @param comparator - The comparator invoked per element.\n * @returns Returns the new duplicate free array.\n * @example\n * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]\n *\n * uniqWith(isEqual, objects)\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n\nexport function uniqWith<TInput>(array: TInput[], comparator: (a: TInput, b: TInput) => boolean): TInput[] {\n return array.filter((value, index, self) => {\n return self.findIndex(otherValue => comparator(value, otherValue)) === index;\n });\n}\n","import { uniqWith } from '@array/uniqWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates a duplicate-free version of an array, in which only the first occurrence of each element is kept.\n * The order of result values is determined by the order they occur in the array.\n *\n * @category Array\n * @param array - The array to inspect.\n * @returns Returns the new duplicate free array.\n * @example\n * uniq([2, 1, 2])\n * // => [2, 1]\n */\n\nexport function uniq<TInput>(array: TInput[]): TInput[] {\n return uniqWith(array, isEqual);\n}\n","import type { IterateeFunction, PropertyShorthand } from '../types';\n\nimport { uniqWith } from '@array/uniqWith';\nimport { getIterateFunction } from '@helpers/shortHands';\n\n/**\n * This method is like `uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array.\n *\n * @category Array\n * @param array - The array to inspect.\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @returns Returns the new duplicate free array.\n * @example\n * uniqBy(Math.floor, [2.1, 1.2, 2.3])\n * // => [2.1, 1.2]\n */\n\nexport function uniqBy<T>( array: T[], iteratee: IterateeFunction<T> | PropertyShorthand<T>): T[] {\n const iterateeFunction = getIterateFunction(iteratee);\n\n return uniqWith(array, (a, b) => iterateeFunction(a) === iterateeFunction(b));\n}\n","/**\n * This method is like `unzip` except that it accepts `iteratee` to specify how regrouped values should be combined.\n *\n * @example\n * const zipped = zip([1, 2], [10, 20], [100, 200])\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * unzipWith(add, zipped)\n * // => [3, 30, 300]\n * @category Array\n * @param iteratee - The function to combine regrouped values.\n * @param array - The array of grouped elements to process.\n * @returns Returns the new array of regrouped elements.\n */\n\nexport function unzipWith<TInput extends unknown[], TOutput>(array: TInput[], iteratee: (...t: TInput) => TOutput): TOutput[] {\n const result: TOutput[] = [];\n\n for (const elements of array) {\n result.push(iteratee(...elements));\n }\n\n return result;\n}\n","import { unzipWith } from '@array/unzipWith';\n\n/**\n * This method is like `zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip configuration.\n *\n * @example\n * const zipped = zip(['a', 'b'], [1, 2], [true, false])\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * unzip(zipped)\n * // => [['a', 'b'], [1, 2], [true, false]]\n * @category Array\n * @param array - The array of grouped elements to process.\n * @returns Returns the new array of regrouped elements.\n */\n\nexport function unzip<TInput extends unknown[]>(array: TInput[]): TInput[] {\n return unzipWith(array, (...t) => t);\n}\n","// Types from https://gist.github.com/briancavalier/c4af1538ae9b2e4ab97caf14306625ab\ntype UnZip<A extends readonly unknown[]> = {\n [K in keyof A]: readonly A[K][]\n};\n\n/**\n * This method is like `zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @category Array\n * @param combineFunc - The function to combine grouped values.\n * @param arrays - The arrays to process.\n * @returns Returns the new array of grouped elements.\n * @example\n * zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c)\n * // => [111, 222]\n */\n\nexport function zipWith<Args extends unknown[], TOutput>(combineFunc: (...args: Args) => TOutput, ...arrays: UnZip<Args>): TOutput[] {\n const len = Math.min(...arrays.map(a => a.length));\n const zipped: TOutput[] = [];\n for (let i = 0; i < len; i++) {\n // Typescript needs the Args hint, or it infers any[]\n // TODO find a way to avoid the cast\n zipped[i] = combineFunc(...arrays.map(a => a[i]) as Args);\n }\n return zipped;\n}\n","import { zipWith } from '@array/zipWith';\n\n/**\n * Creates an array of grouped elements, the first of which contains the first elements of the given arrays,\n * the second of which contains the second elements of the given arrays, and so on.\n *\n * @category Array\n * @param arrays - The arrays to process.\n * @returns Returns the new array of grouped elements.\n * @example\n * zip(['a', 'b'], [1, 2], [true, false])\n * // => [['a', 1, true], ['b', 2, false]]\n */\n\nexport function zip<TInput>(...arrays: TInput[][]): TInput[][] {\n return zipWith((...t) => t, ...arrays);\n}\n","import type { GenericFunction } from '../types.js';\n\n/**\n * The opposite of `before`. This method creates a function that invokes `func` once it's called `n` or more times.\n *\n * @example\n * const caution = () => console.log(\"Caution!\");\n * const afterFN = after(2, caution);\n *\n * afterFN()\n * afterFN()\n * afterFN()\n * // => `caution` is invoked after called twice\n * @category Function\n * @param n The number of calls before `func` is invoked.\n * @param func The function to restrict.\n * @returns Returns the new restricted function.\n */\n\nexport function after<TFunc extends GenericFunction<TFunc>>(n: number, func: TFunc) {\n let count = 1;\n return (...args: Parameters<TFunc>): ReturnType<TFunc> | undefined => {\n if (count >= n) {\n return func(...args);\n }\n count += 1;\n };\n}\n","import type { GenericFunction } from 'src/types.js';\n\n/**\n * Creates a function that invokes `func`, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @category Function\n * @param n - The number of calls at which `func` is no longer invoked.\n * @param func - The function to restrict.\n * @returns Returns the new restricted function.\n * @example\n * const caution = () => console.log(\"Caution!\");\n *\n * // Only call caution two times\n * const reducedCaution = before(2, caution)\n *\n * reducedCaution()\n * reducedCaution()\n * reducedCaution()\n * // => `caution` is invoked twice\n */\n\nexport function before<TFunc extends GenericFunction<TFunc>>(n: number, func: TFunc): TFunc {\n let count = 0;\n let result: ReturnType<TFunc>;\n return ((...args: Parameters<TFunc>): ReturnType<TFunc> => {\n if (count < n) {\n count += 1;\n result = func(...args);\n }\n return result;\n }) as TFunc;\n}\n","import type { GenericFunction } from 'src/types.js';\n\n// TODO this is a port from lodash, it probably can be improved and shortened, also fix TS errors\nexport function debounce<TFunc extends GenericFunction<TFunc>>(\n fn: TFunc, wait = 0, options: { leading?: boolean, maxWait?: number, trailing?: boolean } = {}\n): (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>) => ReturnType<TFunc> {\n let lastArgs: Parameters<TFunc> | undefined;\n let lastThis: ThisParameterType<TFunc> | undefined;\n let result: ReturnType<TFunc>;\n let timerId: ReturnType<typeof setTimeout> | undefined;\n let lastCallTime: number | undefined;\n let lastInvokeTime = 0;\n const maxing = options.maxWait ?? false;\n const leading = options.leading ?? false;\n const trailing = options.trailing ?? true;\n const maxWait = options.maxWait ?? 0;\n\n function invokeFunc(time: number) {\n const args: Parameters<TFunc> | undefined = lastArgs;\n const thisArg: ThisParameterType<TFunc> | undefined = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n // @ts-expect-error\n result = fn.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time: number) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time: number) {\n // @ts-expect-error\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n const timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time: number) {\n if (lastCallTime === undefined)\n return true;\n\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return timeSinceLastCall >= wait || timeSinceLastCall < 0 || (maxing && timeSinceLastInvoke >= maxWait);\n }\n\n function timerExpired() {\n const time = Date.now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time: number) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `fn` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(Date.now());\n }\n\n function debounced(this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>): ReturnType<TFunc> {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs = args;\n // TODO Fix this assignment\n // eslint-disable-next-line @typescript-eslint/no-this-alias,unicorn/no-this-assignment\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n","import type{ GenericFunction } from 'src/types.js';\n\nconst defaultResolver = (...args: unknown[]) => JSON.stringify(args);\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, all arguments\n * provided to the memoized function are used as the map cache key.\n *\n * The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @example\n * const object = \\{ 'a': 1, 'b': 2 \\}\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(object)\n * // => [1, 2]\n *\n * object.a = 2\n * values(object)\n * // => [2, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n *\n * // Replace `memoize.Cache`.\n * memoize.Cache = WeakMap\n * @category Function\n * @param func - The function to have its output memoized.\n * @param resolver - The function to resolve the cache key.\n * @returns Returns the new memoized function.\n */\n\nexport function memoize<TFunc extends GenericFunction<TFunc>, Cache extends Map<string | symbol, ReturnType<TFunc>>>(\n func: TFunc, resolver: ((...args: Parameters<TFunc>) => string | symbol) = defaultResolver\n): TFunc & { cache: Cache } {\n\n const cache = new Map() as Cache;\n const memoizedFunc = (...args: Parameters<TFunc>): ReturnType<TFunc> => {\n const key = resolver(...args);\n if (cache.has(key)) {\n // eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style\n return cache.get(key) as ReturnType<TFunc>;\n }\n const result = func(...args);\n cache.set(key, result);\n return result;\n };\n memoizedFunc.cache = cache;\n return memoizedFunc as TFunc & { cache: Cache };\n}\n","import type { GenericFunction } from 'src/types.js';\n\nimport { before } from '@function/before';\n\n/**\n * Creates a function that is restricted to invoking `func` once.\n * Repeat calls to the function return the value of the first invocation.\n *\n * @example\n * const initialize = once(() => console.log('initialize'))\n * initialize()\n * initialize()\n * // => `createApplication` is invoked once\n *\n * @category Function\n * @param func - The function to restrict.\n * @returns Returns the new restricted function.\n */\n\nexport function once<TFunc extends GenericFunction<TFunc>>(func: TFunc): TFunc {\n return before(1, func);\n}\n","import type { GenericFunction } from 'src/types.js';\n\nimport { debounce } from '@function/debounce';\n\nexport function throttle<TFunc extends GenericFunction<TFunc>>(\n func: TFunc, wait = 0, options: { leading?: boolean, trailing?: boolean } = {}\n): (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>) => ReturnType<TFunc> {\n return debounce(func, wait, {\n leading: options.leading ?? true,\n maxWait: wait,\n trailing: options.trailing ?? true\n });\n}\n","/**\n * Invokes a function `n` times, returning an array of the results of\n * each invocation.\n *\n * The function is invoked with one argument: `index`\n *\n * @example\n * times(3, index => console.log(\"Run\", index)))\n * // => \"Run 0\" | \"Run 1\" | \"Run 2\"\n * times(3, Math.random)\n * // => [0.123, 0.456, 0.789]\n * times(4, () => 0)\n * // => [0, 0, 0, 0]\n * @category Function\n * @param n - The number of times to invoke `func`.\n * @param func - The function invoked per iteration.\n * @returns Returns an array of results.\n */\n\nexport function times<TInput>(n: number, func: (index: number) => TInput): TInput[] {\n const result: TInput[] = [];\n for (let i = 0; i < n; i++) {\n result.push(func(i));\n }\n return result;\n}","/**\n * Creates an object composed of the picked `object` properties.\n *\n * @example\n * const object = { 'a': 1, 'b': '2', 'c': 3 }\n *\n * pick(object, ['a', 'c'])\n * // => { 'a': 1, 'c': 3 }\n * @category Object\n * @param object - The source object.\n * @param keysToPick - The property paths to pick.\n * @returns Returns the new object.\n */\n\nexport function pick<TInput, Key extends keyof TInput>(object: TInput, keysToPick: Key[]): Pick<TInput, Key> {\n const result = {} as Pick<TInput, Key>;\n for (const key of keysToPick) {\n result[key] = object[key];\n }\n return result;\n}\n","import { pick } from './pick.js';\n\n/**\n * Omit specified keys from an object\n *\n * @example\n * const obj = {a: 1, b: 2, c: 3};\n * omit(obj, ['a', 'b']);\n * // => {c: 3}\n *\n * @param object - The object to filter\n * @param keysToOmit - The keys to exclude from the returned object\n * @returns - An object without the specified keys\n *\n */\n\nexport function omit<TObj extends object, Key extends keyof TObj>(object: TObj, keysToOmit: Key[]): Omit<TObj, Key> {\n const keys = Object.keys(object);\n const filteredKeys = keys.filter(key => !keysToOmit.includes(key as Key)) as Exclude<keyof TObj, Key>[];\n\n return pick(object, filteredKeys);\n}","/**\n * Sleeps for the given amount of time.\n *\n * @example\n * await sleep(1000);\n * // => Waits for 1 second.\n * @param ms - Amount of time to sleep in milliseconds.\n * @returns A promise that resolves after the given amount of time.\n */\nexport function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}","/**\n * Deburrs a string by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @example\n * deburr('déjà vu')\n * // => 'deja vu'\n * @category String\n * @param str - The string to deburr.\n * @returns Returns the deburred string.\n */\n\nexport function deburr(str: string): string {\n // eslint-disable-next-line no-control-regex\n return str.replace(/[^\\u0000-\\u007E]/g, (chr: string) =>\n chr.normalize('NFD').replace(/[\\u0300-\\u036F]/g, ''));\n}\n","import { deburr } from '@string/deburr';\n\nexport function splitWords(str: string): string[] {\n str = deburr(str);\n\n // Split non-alphanumeric characters with spaces and deal with camel/PascalCase\n const regex = new RegExp(\n '[^\\\\dA-Za-z]' + // match any character that is not a letter or a digit\n '|' + // or\n '(?<=[a-z])' + // lookbehind for a lowercase letter\n '(?=[A-Z])' + // lookahead for an uppercase letter\n '|' + // or\n '(?<=[A-Z])' + // lookbehind for an uppercase letter\n '(?=[A-Z][a-z])' // lookahead for an uppercase letter followed by a lowercase letter\n );\n\n return str.split(regex).filter(Boolean);\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts `string` to camelCase.\n *\n * @example\n * camelCase('Foo Bar')\n * // => 'fooBar'\n * camelCase('--foo-bar--')\n * // => 'fooBar'\n * camelCase('__FOO_BAR__')\n * // => 'fooBar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the camel cased string.\n */\n\nexport function camelCase(str: string): string {\n const words = splitWords(str);\n\n // Capitalize the first letter of each word\n const camelCase = words.map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n });\n\n return camelCase.join('');\n}\n","/**\n * Converts the first character of a string to upper case and the remaining to lower case.\n *\n * @example\n * capitalize('FRED')\n * // => 'Fred'\n * @category String\n * @param str - The string to capitalize.\n * @returns Returns the capitalized string.\n */\n\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","/**\n * Converts the characters `&`, `<`, `>`, `\"` and `'` in a string to their corresponding HTML entities.\n *\n * @example\n * escape('fred, barney, & pebbles')\n * // => 'fred, barney, &amp; pebbles'\n * @category String\n * @param str - The string to escape.\n * @returns Returns the escaped string.\n */\n\nexport function escapeHtml(str: string): string {\n const escapeChars: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\\'': '&#39;',\n '\"': '&quot;'\n };\n return str.replace(/[\"&'<>]/g, char => escapeChars[char] || char);\n}\n","/**\n * Escapes the `RegExp` special characters `^`, `$`, `\\`, `.`, `*`, `+`,\n * `?`, `(`, `)`, `[`, `]`, `{`, `}`, and `|` in a string.\n *\n * @example\n * escapeRegExp('[moderndash](https://moderndash.io/)')\n * // => '\\[moderndash\\]\\(https://moderndash\\.io/\\)'\n * @category String\n * @param str - The string to escape.\n * @returns Returns the escaped string.\n */\n\nexport function escapeRegExp(str: string): string {\n return str.replace(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&');\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to kebab-case.\n *\n * @example\n * kebabCase('Foo Bar')\n * // => 'foo-bar'\n * kebabCase('fooBar')\n * // => 'foo-bar'\n * kebabCase('__FOO_BAR__')\n * // => 'foo-bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the kebab cased string.\n */\n\nexport function kebabCase(str: string): string {\n const words = splitWords(str);\n let kebabCase = '';\n for (const word of words) {\n kebabCase += word.toLowerCase() + '-';\n }\n return kebabCase.slice(0, -1);\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n\n/**\n * Converts a string to PascalCase.\n *\n * @example\n * pascalCase('Foo Bar')\n * // => 'FooBar'\n * pascalCase('fooBar')\n * // => 'FooBar'\n * pascalCase('__FOO_BAR__')\n * // => 'FooBar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the pascal cased string.\n */\n\nexport function pascalCase(str: string): string {\n const words = splitWords(str);\n let pascalCase = '';\n for (const word of words) {\n pascalCase += word.charAt(0).toUpperCase() + word.slice(1);\n }\n return pascalCase;\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to snake_case.\n *\n * @example\n * snakeCase('Foo Bar')\n * // => 'foo_bar'\n * snakeCase('fooBar')\n * // => 'foo_bar'\n * snakeCase('--FOO-BAR--')\n * // => 'foo_bar'\n * snakeCase('foo2bar')\n * // => 'foo_2_bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the snake cased string.\n */\n\nexport function snakeCase(str: string): string {\n const words = splitWords(str);\n let snakeCase = '';\n for (const word of words) {\n if (snakeCase.length > 0) {\n snakeCase += '_';\n }\n snakeCase += word.toLowerCase();\n }\n return snakeCase;\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to Start Case.\n *\n * @example\n * startCase('--foo-bar--')\n * // => 'Foo Bar'\n * startCase('fooBar')\n * // => 'Foo Bar'\n * startCase('__FOO_BAR__')\n * // => 'Foo Bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the start cased string.\n */\n\nexport function startCase(str: string): string {\n const words = splitWords(str);\n let startCase = '';\n for (const word of words) {\n startCase += word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + ' ';\n }\n return startCase.trimEnd();\n}\n","import { deburr } from '@string/deburr';\n\n/**\n * Removes all special characters from a string.\n *\n * @example\n * stripSpecialChars('Héllo! World #$%&*!')\n * // => 'Hello World'\n * @category String\n * @param str - The string to remove special characters from.\n * @returns Returns the string with special characters removed.\n*/\n\nexport function stripSpecial(str: string): string {\n str = deburr(str);\n return str.replace(/[^\\s\\w]/gi, '');\n}\n","/**\n * Converts the HTML entities `&amp;`, `&lt;`, `&gt;`, `&quot;` and `&#39;`\n * in a string to their corresponding characters.\n *\n * @example\n * unescape('fred, barney, &amp; pebbles')\n * // => 'fred, barney, & pebbles'\n * @category String\n * @param str - The string to unescape.\n * @returns Returns the unescaped string.\n */\n\nexport function unescapeHtml(str: string): string {\n const entityMap: Record<string, string> = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': '\\''\n };\n return str.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g, (entity: string) => entityMap[entity] || entity);\n}\n","/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @example\n * isEmpty(null)\n * // => true\n *\n * isEmpty({})\n * // => true\n *\n * isEmpty(\"\")\n * // => true\n *\n * isEmpty([1, 2, 3])\n * // => false\n *\n * isEmpty('abc')\n * // => false\n *\n * isEmpty({ 'a': 1 })\n * // => false\n * @category Validate\n * @param value - The value to check.\n * @returns Returns `true` if given vlaue is empty, else `false`.\n */\n\nexport function isEmpty(value: string | object | null | undefined): boolean {\n if (value === null || value === undefined) {\n return true;\n }\n\n if (typeof value === 'string' || Array.isArray(value)) {\n return value.length === 0;\n }\n\n if (value instanceof Map || value instanceof Set) {\n return value.size === 0;\n }\n\n if (typeof value === 'object') {\n return Object.keys(value).length === 0;\n }\n\n return false;\n}\n","export function isPlainObject(value: unknown): value is object {\n return value !== null && typeof value === 'object' && value.constructor === Object;\n}\n","/**\n * Checks if given string is a valid URL\n *\n * @example\n * isUrl('https://google.com')\n * // => true\n * isUrl('google.com')\n * // => false\n * @param str - The string to check.\n * @returns Returns `true` if given string is a valid URL, else `false`.\n */\n\nexport function isUrl(str: string): boolean {\n try {\n new URL(str);\n return true;\n } catch {\n return false;\n }\n}"],"mappings":";AAeO,SAAS,MAAc,WAAmB,OAA6B;AAC1E,QAAM,cAAc,KAAK,MAAM,SAAS;AACxC,MAAI,MAAM,WAAW,KAAK,cAAc,GAAG;AACvC,WAAO,CAAC;AAAA,EACZ;AAEA,QAAM,eAAe,CAAC;AACtB,MAAI,IAAI;AAER,SAAO,IAAI,MAAM,QAAQ;AACrB,iBAAa,KAAK,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC;AACjD,SAAK;AAAA,EACT;AAEA,SAAO;AACX;;;ACRO,SAAS,MAAsC,OAAiB,UAAyD;AAC5H,QAAM,SAAS,CAAC;AAChB,aAAW,SAAS,OAAO;AACvB,UAAM,MAAM,SAAS,KAAK;AAE1B,QAAI,OAAO,SAAS,QAAW;AAC3B,aAAO,OAAO;AAAA,IAClB,OAAO;AACH,aAAO,QAAQ;AAAA,IACnB;AAAA,EACJ;AACA,SAAO;AACX;;;ACjBO,SAAS,eAAkB,eAAwC,QAAkC;AACxG,QAAMA,cAAkB,CAAC;AACzB,QAAM,CAAC,eAAe,UAAU,IAAI;AAEpC,aAAW,QAAQ,aAAW;AAC1B,QAAI,CAAC,WAAW,KAAK,WAAS,MAAM,KAAK,UAAQ,WAAW,MAAM,OAAO,CAAC,CAAC,GAAG;AAC1E,MAAAA,YAAW,KAAK,OAAO;AAAA,IAC3B;AAAA,EACJ,CAAC;AAED,SAAOA;AACX;;;ACAO,SAAS,QAAQ,QAAiB,QAA0B;AAC/D,MAAI,WAAW;AAAQ,WAAO;AAE9B,MAAI,MAAM,QAAQ,MAAM,KAAK,MAAM,QAAQ,MAAM,GAAG;AAChD,WAAO,YAAY,QAAQ,MAAM;AAAA,EACrC;AAEA,MAAI,kBAAkB,UAAU,kBAAkB,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,QAAQ,OAAO,UAAU,YAAY,MAAM,gBAAgB;AAChF;;;ACUO,SAAS,MAAM,KAAsB;AACxC,MAAI;AACA,QAAI,IAAI,GAAG;AACX,WAAO;AAAA,EACX,QAAE;AACE,WAAO;AAAA,EACX;AACJ;","names":["difference","intersection","count","count","camelCase","kebabCase","pascalCase","snakeCase","startCase"]}
1
+ {"version":3,"sources":["../src/array/chunk.ts","../src/array/count.ts","../src/array/differenceWith.ts","../src/validate/isEqual.ts","../src/array/difference.ts","../src/helpers/typeofChecks.ts","../src/helpers/shortHands.ts","../src/array/differenceBy.ts","../src/array/dropRightWhile.ts","../src/array/dropWhile.ts","../src/array/group.ts","../src/array/intersectionWith.ts","../src/array/intersection.ts","../src/array/intersectionBy.ts","../src/array/sample.ts","../src/array/sampleSize.ts","../src/array/shuffle.ts","../src/array/sort.ts","../src/array/takeRightWhile.ts","../src/array/takeWhile.ts","../src/array/unique.ts","../src/array/unzipWith.ts","../src/array/unzip.ts","../src/array/zipWith.ts","../src/array/zip.ts","../src/function/after.ts","../src/function/before.ts","../src/function/debounce.ts","../src/function/memoize.ts","../src/function/once.ts","../src/function/throttle.ts","../src/function/times.ts","../src/object/pick.ts","../src/object/omit.ts","../src/promise/sleep.ts","../src/string/deburr.ts","../src/helpers/stringModifiers.ts","../src/string/camelCase.ts","../src/string/capitalize.ts","../src/string/escapeHtml.ts","../src/string/escapeRegExp.ts","../src/string/kebabCase.ts","../src/string/pascalCase.ts","../src/string/snakeCase.ts","../src/string/startCase.ts","../src/string/stripSpecial.ts","../src/string/unescapeHtml.ts","../src/validate/isEmpty.ts","../src/validate/isPlainObject.ts","../src/validate/isUrl.ts"],"sourcesContent":["/**\n * Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.\n *\n * @category Array\n * @returns Returns the new array of chunks.\n * @param chunkSize - The array to process.\n * @param array - The length of each chunk\n * @example\n * chunk(2, ['a', 'b', 'c', 'd'])\n * // => [['a', 'b'], ['c', 'd']]\n *\n * chunk(3, ['a', 'b', 'c', 'd'])\n * // => [['a', 'b', 'c'], ['d']]\n */\n\nexport function chunk<TInput>(chunkSize: number, array: TInput[]): TInput[][] {\n const sizeInteger = Math.trunc(chunkSize);\n if (array.length === 0 || sizeInteger < 1) {\n return [];\n }\n\n const chunkedArray = [];\n let i = 0;\n\n while (i < array.length) {\n chunkedArray.push(array.slice(i, i + sizeInteger));\n i += sizeInteger;\n }\n\n return chunkedArray;\n}\n","import type { RecordKey } from '../types';\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`.\n *\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'betty', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ]\n *\n * count(users, value => value.active);\n * // => { 'true': 2, 'false': 1 }\n * @category Array\n * @param iteratee - The iteratee to transform keys.\n * @param collection - The array or record to iterate over.\n * @returns Returns the composed aggregate object.\n */\n\nexport function count<TInput, TKey extends RecordKey>(array: TInput[], iteratee: (value: TInput) => TKey): Record<TKey, number> {\n const result = {} as Record<TKey, number>;\n for (const value of array) {\n const key = iteratee(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (result[key] === undefined) {\n result[key] = 1;\n } else {\n result[key] += 1;\n }\n }\n return result;\n}\n","import type { MinimumTwoArrays } from '../types';\n\n/**\n * This method is like `difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`.\n * The order and references of result values are determined by the first array.\n * The comparator is invoked with two arguments: (arrVal, othVal).\n *\n * @example\n * differenceWith(isEqual, [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }], [{ 'x': 1, 'y': 2 }])\n * // => [{ 'x': 2, 'y': 1 }]\n * @category Array\n * @param comparator - The comparator invoked per element.\n * @param arrays - First array to inspect. Others are excluded.\n * @returns Returns the new array of filtered values.\n */\n\nexport function differenceWith<T>(comparator: (a: T, b: T) => boolean, ...arrays: MinimumTwoArrays<T>): T[] {\n const difference: T[] = [];\n const [firstArray, ...restArrays] = arrays;\n\n firstArray.forEach(element => {\n if (!restArrays.some(array => array.some(item => comparator(item, element)))) {\n difference.push(element);\n }\n });\n\n return difference;\n}\n","import type { RecordKey } from '../types';\n\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @example\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n * @category Validate\n * @param value1 - The value to compare.\n * @param value2 - The other value to compare.\n * @returns Returns `true` if the values are equivalent, else `false`.\n */\n\nexport function isEqual(value1: unknown, value2: unknown): boolean {\n if (value1 === value2) return true;\n\n if (Array.isArray(value1) && Array.isArray(value2)) {\n return isSameArray(value1, value2);\n }\n\n if (value1 instanceof RegExp && value2 instanceof RegExp) {\n return value1.toString() === value2.toString();\n }\n\n if (isObject(value1) && isObject(value2)) {\n return isSameObject(value1, value2);\n }\n\n return false;\n}\n\ntype KeyValueObject = Record<RecordKey, unknown>;\nfunction isObject(value: unknown): value is KeyValueObject {\n return typeof value === 'object'\n && value !== null\n && !Array.isArray(value)\n && Object.prototype.toString.call(value) === '[object Object]';\n}\n\nfunction isSameObject(value1: KeyValueObject, value2: KeyValueObject) {\n // check if the objects have the same keys\n const keys1 = Object.keys(value1);\n const keys2 = Object.keys(value2);\n if (!isEqual(keys1, keys2)) return false;\n\n // check if the values of each key in the objects are equal\n for (const key of keys1) {\n if (!isEqual(value1[key], value2[key])) return false;\n }\n\n // the objects are deeply equal\n return true;\n}\n\nfunction isSameArray(value1: unknown[], value2: unknown[]) {\n if (value1.length !== value2.length) return false;\n\n // check if the values of each element in the arrays are equal\n for (const [i, element] of value1.entries()) {\n if (!isEqual(element, value2[i])) return false;\n }\n\n return true;\n}\n","import type { MinimumTwoArrays } from '../types';\n\nimport { differenceWith } from '@array/differenceWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates an array of `array` values not included in the other given arrays. The order and references of result values are determined by the first array.\n *\n * **Note:** Unlike `pullAll`, this method returns a new array.\n *\n * @category Array\n * @param arrays - First array is inspected, others are excluded.\n * @returns Returns the new array of filtered values.\n * @example\n * difference([2, 1], [2, 3])\n * // => [1]\n */\n\nexport function difference<TInput>(...arrays: MinimumTwoArrays<TInput>): TInput[] {\n return differenceWith(isEqual, ...arrays);\n}\n","export function isObjectKey(key: unknown): key is keyof object {\n return typeof key === 'string' || typeof key === 'number' || typeof key === 'symbol';\n}\n","import type { IterateeFunction, PropertyShorthand } from '../types';\n\nimport { isObjectKey } from '@helpers/typeofChecks';\n\nexport function getPropertyShorthand<T, K extends keyof T>(key: K): (object: T) => T[K] {\n return object => object[key];\n}\n\nexport function getIterateFunction<T>(iteratee: IterateeFunction<T> | PropertyShorthand<T>) {\n if (typeof iteratee === 'function') {\n return iteratee;\n } else if (isObjectKey(iteratee)) {\n return getPropertyShorthand(iteratee);\n } else {\n throw new TypeError('Expected iteratee to be a function or a property name');\n }\n}\n","import type { IterateeFunction, MinimumTwoArrays, PropertyShorthand } from '../types';\n\nimport { differenceWith } from '@array/differenceWith';\nimport { getIterateFunction } from '@helpers/shortHands';\nimport { isEqual } from '@validate/isEqual.js';\n\n/**\n * This method is like `difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `pullAllBy`, this method returns a new array.\n *\n * @category Array\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @param arrays - First array to inspect. Others are excluded.\n\n * @returns Returns the new array of filtered values.\n * @example\n * differenceBy(Math.floor, [2.1, 1.2], [2.3, 3.4])\n * // => [1.2]\n * differenceBy('x', [{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }])\n * // => [{ 'x': 2 }]\n */\n\nexport function differenceBy<T>(iteratee: IterateeFunction<T> | PropertyShorthand<T>, ...arrays: MinimumTwoArrays<T>): T[] {\n const iterateeFn = getIterateFunction(iteratee);\n return differenceWith((a, b) => isEqual(iterateeFn(a), iterateeFn(b)), ...arrays);\n}\n","/**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * const users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': true }\n * ]\n *\n * dropRightWhile(users, { active }) => active)\n * // => objects for ['barney']\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n * @example\n */\n\n\nexport function dropRightWhile<T>(array: T[], predicate: (value: T) => boolean) {\n let i = array.length;\n while (i > 0 && predicate(array[i - 1])) {\n i--;\n }\n return array.slice(0, i);\n}\n","/**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': false }\n * ]\n *\n * dropWhile(users, ({ active }) => active)\n * // => objects for ['pebbles']\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n */\n\nexport function dropWhile<T>(array: T[], predicate: (value: T) => boolean): T[] {\n const index = array.findIndex(x => !predicate(x));\n return array.slice(index === -1 ? array.length : index);\n}\n","import type { RecordKey } from '../types';\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key.\n *\n * @example\n * group([6.1, 4.2, 6.3], Math.floor)\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * group([6.1, 4.2, 6.3], value => value > 5)\n * // => { 'false': [4.2], 'true': [6.1, 6.3] }\n * @category Array\n * @param collection - The array or object to iterate over.\n * @param iteratee - The iteratee to transform keys.\n * @returns Returns the composed aggregate object.\n */\n\nexport function group<T, U extends RecordKey>(array: T[], iteratee: (value: T) => U): Record<U, T[]> {\n const result = {} as Record<U, T[]>;\n for (const value of array) {\n const key = iteratee(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n result[key] = result[key] ?? [];\n result[key].push(value);\n }\n return result;\n}\n","import type { MinimumTwoArrays } from '../types';\n\n/**\n * This method is like `intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @example\n * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]\n *\n * intersectionWith(isEqual, objects, others)\n * // => [{ 'x': 1, 'y': 2 }]\n * @category Array\n * @param comparator - The comparator invoked per element.\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n */\n\nexport function intersectionWith<T>(comparator: (a: T, b: T) => boolean, ...arrays: MinimumTwoArrays<T>): T[] {\n const intersection: T[] = [];\n\n const [firstArray, ...restArrays] = arrays;\n\n firstArray.forEach(element => {\n if (restArrays.every(array => array.some(item => comparator(item, element)))) {\n intersection.push(element);\n }\n });\n\n return intersection;\n}\n","import type { MinimumTwoArrays } from '../types';\n\nimport { intersectionWith } from '@array/intersectionWith';\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates an array of unique values that are included in all given arrays.\n * The order and references of result values are determined by the first array.\n *\n * @category Array\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n * @example\n * intersection([2, 1], [2, 3])\n * // => [2]\n */\n\nexport function intersection<TInput>(...arrays: MinimumTwoArrays<TInput>): TInput[] {\n return intersectionWith(isEqual, ...arrays);\n}\n","import type { IterateeFunction, MinimumTwoArrays, PropertyShorthand } from '../types';\n\nimport { intersectionWith } from '@array/intersectionWith';\nimport { getIterateFunction } from '@helpers/shortHands';\nimport { isEqual } from '@validate/isEqual.js';\n\n/**\n * This method is like `intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @example\n * intersectionBy(Math.floor, [2.1, 1.2], [2.3, 3.4])\n * // => [2.1]\n * @category Array\n * @param iteratee - The iteratee invoked per element. Or property shorthand.\n * @param arrays - The arrays to inspect.\n * @returns Returns the new array of intersecting values.\n */\n\nexport function intersectionBy<TInput>(iteratee: IterateeFunction<TInput> | PropertyShorthand<TInput>, ...arrays: MinimumTwoArrays<TInput>): TInput[] {\n const iterateeFn = getIterateFunction(iteratee);\n return intersectionWith((a, b) => isEqual(iterateeFn(a), iterateeFn(b)), ...arrays);\n}\n","/**\n * Gets a random element from `array`.\n *\n * @example\n * sample([1, 2, 3, 4])\n * // => 2\n * @category Array\n * @param array - The array to sample.\n * @returns Returns the random element.\n */\n\nexport function sample<TInput>(array: TInput[]): TInput | undefined {\n if (array.length === 0) {\n return undefined;\n }\n const randomIndex = Math.floor(Math.random() * array.length);\n return array[randomIndex];\n}\n","import { sample } from '@array/sample';\n\n/**\n * Gets `n` random elements at unique keys from `array` up to the\n * size of `array`.\n *\n * @category Array\n * @param size The number of elements to sample.\n * @param array The array to sample.\n * @returns Returns the random elements.\n * @example\n * sampleSize([1, 2, 3], 2)\n * // => [3, 1]\n *\n * sampleSize([1, 2, 3], 4)\n * // => [2, 3, 1]\n */\n\nexport function sampleSize<TInput>(array: TInput[], size: number): TInput[] {\n const sampleArray: TInput[] = [];\n\n if (array.length === 0 || size <= 0) {\n return sampleArray;\n }\n\n for (let i = 0; i < size; i++) {\n sampleArray.push(sample(array) as TInput);\n }\n\n return sampleArray;\n}\n","/**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @example\n * shuffle([1, 2, 3, 4])\n * // => [4, 1, 3, 2]\n * @category Array\n * @param array - The array or object to shuffle.\n * @returns Returns the new shuffled array.\n */\n\nexport function shuffle<TInput>(array: TInput[]): TInput[] {\n const shuffledArray = [...array];\n let currentIndex = shuffledArray.length;\n let temporaryValue: TInput;\n let randomIndex: number;\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 -= 1;\n\n // And swap it with the current element.\n temporaryValue = shuffledArray[currentIndex];\n shuffledArray[currentIndex] = shuffledArray[randomIndex];\n shuffledArray[randomIndex] = temporaryValue;\n }\n\n return shuffledArray;\n}\n","\n/**\n * Sorts the array in ascending or descending order.\n * An iteratee function is optional to sort the array based on a specific property.\n *\n * @example\n * sort([1, 2, 3, 4], 'desc')\n * // => [4, 3, 2, 1]\n *\n * sort([{ a: 1 }, { a: 2 }, { a: 3 }], 'asc', item => item.a)\n * // => [{ a: 1 }, { a: 2 }, { a: 3 }]\n * @category Array\n * @param array - The array to sort.\n * @param order - The order in which to sort the array.\n * @param iteratee - The iteratee function to sort the array based on a specific property.\n * @returns Returns the sorted array.\n */\n\nexport function sort<TInput>(array: TInput[], order?: 'asc' | 'desc', iteratee?: (item: TInput) => number | bigint | Date | string): TInput[] {\n return [...array].sort((a, b) => {\n const aValue = iteratee ? iteratee(a) : a;\n const bValue = iteratee ? iteratee(b) : b;\n if (aValue < bValue) {\n return order === 'desc' ? 1 : -1;\n }\n if (aValue > bValue) {\n return order === 'desc' ? -1 : 1;\n }\n return 0;\n });\n}\n","/**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @category Array\n * @param predicate - The function invoked per iteration.\n * @param array - The array to query.\n * @returns Returns the slice of `array`.\n * @example\n * const users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': true }\n * ]\n *\n * takeRightWhile(({ active }) => active, users)\n * // => objects for ['fred', 'pebbles']\n */\n\nexport function takeRightWhile<T>(predicate: (elem: T) => boolean, array: T[]): T[] {\n const result: T[] = [];\n\n for (let i = array.length - 1; i >= 0; i--) {\n if (predicate(array[i])) {\n result.unshift(array[i]);\n } else {\n break;\n }\n }\n\n return result;\n}\n","/**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @category Array\n * @param predicate The function invoked per iteration.\n * @param array The array to query.\n * @returns Returns the slice of `array`.\n * @example\n * const users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': true },\n * { 'user': 'pebbles', 'active': false }\n * ]\n *\n * takeWhile(({ active }) => active, users)\n * // => objects for ['barney', 'fred']\n */\n\nexport function takeWhile<T>(array: T[], predicate: (elem: T) => boolean): T[] {\n const result: T[] = [];\n\n for (const element of array) {\n if (predicate(element)) {\n result.push(element);\n } else {\n break;\n }\n }\n\n return result;\n}\n","import type { IterateeFunction } from 'src/types.js';\n\nimport { isEqual } from '@validate/isEqual';\n\n/**\n * Creates a duplicate-free version of an array, in which only the first occurrence of each element is kept.\n * The order of result values is determined by the order they occur in the array.\n *\n * An iteratee function is optional, to specify the value to be compared.\n *\n * @example\n * unique([2, 1, 2])\n * // => [2, 1]\n *\n * const users = [\n * { id: 1, name: 'a' },\n * { id: 1, name: 'c' }\n * ]\n *\n * unique(users, value => value.id)\n * // => [{ id: 1, name: 'a' }]\n *\n *\n * @category Array\n * @param array - The array to inspect.\n * @param iteratee - The iteratee invoked per element.\n * @returns Returns the new duplicate free array.\n */\n\nexport function unique<TInput>(array: TInput[], iteratee?: IterateeFunction<TInput>): TInput[] {\n const compareFn = (a: TInput, b: TInput) =>\n isEqual(iteratee ? iteratee(a) : a, iteratee ? iteratee(b) : b);\n\n return array.filter((value, index, self) => {\n return self.findIndex(otherValue => compareFn(value, otherValue)) === index;\n });\n}\n","/**\n * This method is like `unzip` except that it accepts `iteratee` to specify how regrouped values should be combined.\n *\n * @example\n * const zipped = zip([1, 2], [10, 20], [100, 200])\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * unzipWith(add, zipped)\n * // => [3, 30, 300]\n * @category Array\n * @param iteratee - The function to combine regrouped values.\n * @param array - The array of grouped elements to process.\n * @returns Returns the new array of regrouped elements.\n */\n\nexport function unzipWith<TInput extends unknown[], TOutput>(array: TInput[], iteratee: (...t: TInput) => TOutput): TOutput[] {\n const result: TOutput[] = [];\n\n for (const elements of array) {\n result.push(iteratee(...elements));\n }\n\n return result;\n}\n","import { unzipWith } from '@array/unzipWith';\n\n/**\n * This method is like `zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip configuration.\n *\n * @example\n * const zipped = zip(['a', 'b'], [1, 2], [true, false])\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * unzip(zipped)\n * // => [['a', 'b'], [1, 2], [true, false]]\n * @category Array\n * @param array - The array of grouped elements to process.\n * @returns Returns the new array of regrouped elements.\n */\n\nexport function unzip<TInput extends unknown[]>(array: TInput[]): TInput[] {\n return unzipWith(array, (...t) => t);\n}\n","// Types from https://gist.github.com/briancavalier/c4af1538ae9b2e4ab97caf14306625ab\ntype UnZip<A extends readonly unknown[]> = {\n [K in keyof A]: readonly A[K][]\n};\n\n/**\n * This method is like `zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @category Array\n * @param combineFunc - The function to combine grouped values.\n * @param arrays - The arrays to process.\n * @returns Returns the new array of grouped elements.\n * @example\n * zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c)\n * // => [111, 222]\n */\n\nexport function zipWith<Args extends unknown[], TOutput>(combineFunc: (...args: Args) => TOutput, ...arrays: UnZip<Args>): TOutput[] {\n const len = Math.min(...arrays.map(a => a.length));\n const zipped: TOutput[] = [];\n for (let i = 0; i < len; i++) {\n // Typescript needs the Args hint, or it infers any[]\n // TODO find a way to avoid the cast\n zipped[i] = combineFunc(...arrays.map(a => a[i]) as Args);\n }\n return zipped;\n}\n","import { zipWith } from '@array/zipWith';\n\n/**\n * Creates an array of grouped elements, the first of which contains the first elements of the given arrays,\n * the second of which contains the second elements of the given arrays, and so on.\n *\n * @category Array\n * @param arrays - The arrays to process.\n * @returns Returns the new array of grouped elements.\n * @example\n * zip(['a', 'b'], [1, 2], [true, false])\n * // => [['a', 1, true], ['b', 2, false]]\n */\n\nexport function zip<TInput>(...arrays: TInput[][]): TInput[][] {\n return zipWith((...t) => t, ...arrays);\n}\n","import type { GenericFunction } from '../types.js';\n\n/**\n * The opposite of `before`. This method creates a function that invokes `func` once it's called `n` or more times.\n *\n * @example\n * const caution = () => console.log(\"Caution!\");\n * const afterFN = after(2, caution);\n *\n * afterFN()\n * afterFN()\n * afterFN()\n * // => `caution` is invoked after called twice\n * @category Function\n * @param n The number of calls before `func` is invoked.\n * @param func The function to restrict.\n * @returns Returns the new restricted function.\n */\n\nexport function after<TFunc extends GenericFunction<TFunc>>(n: number, func: TFunc) {\n let count = 1;\n return (...args: Parameters<TFunc>): ReturnType<TFunc> | undefined => {\n if (count >= n) {\n return func(...args);\n }\n count += 1;\n };\n}\n","import type { GenericFunction } from 'src/types.js';\n\n/**\n * Creates a function that invokes `func`, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @category Function\n * @param n - The number of calls at which `func` is no longer invoked.\n * @param func - The function to restrict.\n * @returns Returns the new restricted function.\n * @example\n * const caution = () => console.log(\"Caution!\");\n *\n * // Only call caution two times\n * const reducedCaution = before(2, caution)\n *\n * reducedCaution()\n * reducedCaution()\n * reducedCaution()\n * // => `caution` is invoked twice\n */\n\nexport function before<TFunc extends GenericFunction<TFunc>>(n: number, func: TFunc): TFunc {\n let count = 0;\n let result: ReturnType<TFunc>;\n return ((...args: Parameters<TFunc>): ReturnType<TFunc> => {\n if (count < n) {\n count += 1;\n result = func(...args);\n }\n return result;\n }) as TFunc;\n}\n","import type { GenericFunction } from 'src/types.js';\n\n// TODO this is a port from lodash, it probably can be improved and shortened, also fix TS errors\nexport function debounce<TFunc extends GenericFunction<TFunc>>(\n fn: TFunc, wait = 0, options: { leading?: boolean, maxWait?: number, trailing?: boolean } = {}\n): (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>) => ReturnType<TFunc> {\n let lastArgs: Parameters<TFunc> | undefined;\n let lastThis: ThisParameterType<TFunc> | undefined;\n let result: ReturnType<TFunc>;\n let timerId: ReturnType<typeof setTimeout> | undefined;\n let lastCallTime: number | undefined;\n let lastInvokeTime = 0;\n const maxing = options.maxWait ?? false;\n const leading = options.leading ?? false;\n const trailing = options.trailing ?? true;\n const maxWait = options.maxWait ?? 0;\n\n function invokeFunc(time: number) {\n const args: Parameters<TFunc> | undefined = lastArgs;\n const thisArg: ThisParameterType<TFunc> | undefined = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n // @ts-expect-error\n result = fn.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time: number) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time: number) {\n // @ts-expect-error\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n const timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time: number) {\n if (lastCallTime === undefined)\n return true;\n\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return timeSinceLastCall >= wait || timeSinceLastCall < 0 || (maxing && timeSinceLastInvoke >= maxWait);\n }\n\n function timerExpired() {\n const time = Date.now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time: number) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `fn` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(Date.now());\n }\n\n function debounced(this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>): ReturnType<TFunc> {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs = args;\n // TODO Fix this assignment\n // eslint-disable-next-line @typescript-eslint/no-this-alias,unicorn/no-this-assignment\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n","import type{ GenericFunction } from 'src/types.js';\n\nconst defaultResolver = (...args: unknown[]) => JSON.stringify(args);\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, all arguments\n * provided to the memoized function are used as the map cache key.\n *\n * The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @example\n * const object = \\{ 'a': 1, 'b': 2 \\}\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(object)\n * // => [1, 2]\n *\n * object.a = 2\n * values(object)\n * // => [2, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n *\n * // Replace `memoize.Cache`.\n * memoize.Cache = WeakMap\n * @category Function\n * @param func - The function to have its output memoized.\n * @param resolver - The function to resolve the cache key.\n * @returns Returns the new memoized function.\n */\n\nexport function memoize<TFunc extends GenericFunction<TFunc>, Cache extends Map<string | symbol, ReturnType<TFunc>>>(\n func: TFunc, resolver: ((...args: Parameters<TFunc>) => string | symbol) = defaultResolver\n): TFunc & { cache: Cache } {\n\n const cache = new Map() as Cache;\n const memoizedFunc = (...args: Parameters<TFunc>): ReturnType<TFunc> => {\n const key = resolver(...args);\n if (cache.has(key)) {\n // eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style\n return cache.get(key) as ReturnType<TFunc>;\n }\n const result = func(...args);\n cache.set(key, result);\n return result;\n };\n memoizedFunc.cache = cache;\n return memoizedFunc as TFunc & { cache: Cache };\n}\n","import type { GenericFunction } from 'src/types.js';\n\nimport { before } from '@function/before';\n\n/**\n * Creates a function that is restricted to invoking `func` once.\n * Repeat calls to the function return the value of the first invocation.\n *\n * @example\n * const initialize = once(() => console.log('initialize'))\n * initialize()\n * initialize()\n * // => `createApplication` is invoked once\n *\n * @category Function\n * @param func - The function to restrict.\n * @returns Returns the new restricted function.\n */\n\nexport function once<TFunc extends GenericFunction<TFunc>>(func: TFunc): TFunc {\n return before(1, func);\n}\n","import type { GenericFunction } from 'src/types.js';\n\nimport { debounce } from '@function/debounce';\n\nexport function throttle<TFunc extends GenericFunction<TFunc>>(\n func: TFunc, wait = 0, options: { leading?: boolean, trailing?: boolean } = {}\n): (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>) => ReturnType<TFunc> {\n return debounce(func, wait, {\n leading: options.leading ?? true,\n maxWait: wait,\n trailing: options.trailing ?? true\n });\n}\n","/**\n * Invokes a function `n` times, returning an array of the results of\n * each invocation.\n *\n * The function is invoked with one argument: `index`\n *\n * @example\n * times(3, index => console.log(\"Run\", index)))\n * // => \"Run 0\" | \"Run 1\" | \"Run 2\"\n * times(3, Math.random)\n * // => [0.123, 0.456, 0.789]\n * times(4, () => 0)\n * // => [0, 0, 0, 0]\n * @category Function\n * @param n - The number of times to invoke `func`.\n * @param func - The function invoked per iteration.\n * @returns Returns an array of results.\n */\n\nexport function times<TInput>(n: number, func: (index: number) => TInput): TInput[] {\n const result: TInput[] = [];\n for (let i = 0; i < n; i++) {\n result.push(func(i));\n }\n return result;\n}","/**\n * Creates an object composed of the picked `object` properties.\n *\n * @example\n * const object = { 'a': 1, 'b': '2', 'c': 3 }\n *\n * pick(object, ['a', 'c'])\n * // => { 'a': 1, 'c': 3 }\n * @category Object\n * @param object - The source object.\n * @param keysToPick - The property paths to pick.\n * @returns Returns the new object.\n */\n\nexport function pick<TInput, Key extends keyof TInput>(object: TInput, keysToPick: Key[]): Pick<TInput, Key> {\n const result = {} as Pick<TInput, Key>;\n for (const key of keysToPick) {\n result[key] = object[key];\n }\n return result;\n}\n","import { pick } from './pick.js';\n\n/**\n * Omit specified keys from an object\n *\n * @example\n * const obj = {a: 1, b: 2, c: 3};\n * omit(obj, ['a', 'b']);\n * // => {c: 3}\n *\n * @param object - The object to filter\n * @param keysToOmit - The keys to exclude from the returned object\n * @returns - An object without the specified keys\n *\n */\n\nexport function omit<TObj extends object, Key extends keyof TObj>(object: TObj, keysToOmit: Key[]): Omit<TObj, Key> {\n const keys = Object.keys(object);\n const filteredKeys = keys.filter(key => !keysToOmit.includes(key as Key)) as Exclude<keyof TObj, Key>[];\n\n return pick(object, filteredKeys);\n}","/**\n * Sleeps for the given amount of time.\n *\n * @example\n * await sleep(1000);\n * // => Waits for 1 second.\n * @param ms - Amount of time to sleep in milliseconds.\n * @returns A promise that resolves after the given amount of time.\n */\nexport function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}","/**\n * Deburrs a string by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @example\n * deburr('déjà vu')\n * // => 'deja vu'\n * @category String\n * @param str - The string to deburr.\n * @returns Returns the deburred string.\n */\n\nexport function deburr(str: string): string {\n // eslint-disable-next-line no-control-regex\n return str.replace(/[^\\u0000-\\u007E]/g, (chr: string) =>\n chr.normalize('NFD').replace(/[\\u0300-\\u036F]/g, ''));\n}\n","import { deburr } from '@string/deburr';\n\nexport function splitWords(str: string): string[] {\n str = deburr(str);\n\n // Split non-alphanumeric characters with spaces and deal with camel/PascalCase\n const regex = new RegExp(\n '[^\\\\dA-Za-z]' + // match any character that is not a letter or a digit\n '|' + // or\n '(?<=[a-z])' + // lookbehind for a lowercase letter\n '(?=[A-Z])' + // lookahead for an uppercase letter\n '|' + // or\n '(?<=[A-Z])' + // lookbehind for an uppercase letter\n '(?=[A-Z][a-z])' // lookahead for an uppercase letter followed by a lowercase letter\n );\n\n return str.split(regex).filter(Boolean);\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts `string` to camelCase.\n *\n * @example\n * camelCase('Foo Bar')\n * // => 'fooBar'\n * camelCase('--foo-bar--')\n * // => 'fooBar'\n * camelCase('__FOO_BAR__')\n * // => 'fooBar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the camel cased string.\n */\n\nexport function camelCase(str: string): string {\n const words = splitWords(str);\n\n // Capitalize the first letter of each word\n const camelCase = words.map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n });\n\n return camelCase.join('');\n}\n","/**\n * Converts the first character of a string to upper case and the remaining to lower case.\n *\n * @example\n * capitalize('FRED')\n * // => 'Fred'\n * @category String\n * @param str - The string to capitalize.\n * @returns Returns the capitalized string.\n */\n\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","/**\n * Converts the characters `&`, `<`, `>`, `\"` and `'` in a string to their corresponding HTML entities.\n *\n * @example\n * escape('fred, barney, & pebbles')\n * // => 'fred, barney, &amp; pebbles'\n * @category String\n * @param str - The string to escape.\n * @returns Returns the escaped string.\n */\n\nexport function escapeHtml(str: string): string {\n const escapeChars: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\\'': '&#39;',\n '\"': '&quot;'\n };\n return str.replace(/[\"&'<>]/g, char => escapeChars[char] || char);\n}\n","/**\n * Escapes the `RegExp` special characters `^`, `$`, `\\`, `.`, `*`, `+`,\n * `?`, `(`, `)`, `[`, `]`, `{`, `}`, and `|` in a string.\n *\n * @example\n * escapeRegExp('[moderndash](https://moderndash.io/)')\n * // => '\\[moderndash\\]\\(https://moderndash\\.io/\\)'\n * @category String\n * @param str - The string to escape.\n * @returns Returns the escaped string.\n */\n\nexport function escapeRegExp(str: string): string {\n return str.replace(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&');\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to kebab-case.\n *\n * @example\n * kebabCase('Foo Bar')\n * // => 'foo-bar'\n * kebabCase('fooBar')\n * // => 'foo-bar'\n * kebabCase('__FOO_BAR__')\n * // => 'foo-bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the kebab cased string.\n */\n\nexport function kebabCase(str: string): string {\n const words = splitWords(str);\n let kebabCase = '';\n for (const word of words) {\n kebabCase += word.toLowerCase() + '-';\n }\n return kebabCase.slice(0, -1);\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n\n/**\n * Converts a string to PascalCase.\n *\n * @example\n * pascalCase('Foo Bar')\n * // => 'FooBar'\n * pascalCase('fooBar')\n * // => 'FooBar'\n * pascalCase('__FOO_BAR__')\n * // => 'FooBar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the pascal cased string.\n */\n\nexport function pascalCase(str: string): string {\n const words = splitWords(str);\n let pascalCase = '';\n for (const word of words) {\n pascalCase += word.charAt(0).toUpperCase() + word.slice(1);\n }\n return pascalCase;\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to snake_case.\n *\n * @example\n * snakeCase('Foo Bar')\n * // => 'foo_bar'\n * snakeCase('fooBar')\n * // => 'foo_bar'\n * snakeCase('--FOO-BAR--')\n * // => 'foo_bar'\n * snakeCase('foo2bar')\n * // => 'foo_2_bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the snake cased string.\n */\n\nexport function snakeCase(str: string): string {\n const words = splitWords(str);\n let snakeCase = '';\n for (const word of words) {\n if (snakeCase.length > 0) {\n snakeCase += '_';\n }\n snakeCase += word.toLowerCase();\n }\n return snakeCase;\n}\n","import { splitWords } from '@helpers/stringModifiers';\n\n/**\n * Converts a string to Start Case.\n *\n * @example\n * startCase('--foo-bar--')\n * // => 'Foo Bar'\n * startCase('fooBar')\n * // => 'Foo Bar'\n * startCase('__FOO_BAR__')\n * // => 'Foo Bar'\n * @category String\n * @param str - The string to convert.\n * @returns Returns the start cased string.\n */\n\nexport function startCase(str: string): string {\n const words = splitWords(str);\n let startCase = '';\n for (const word of words) {\n startCase += word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + ' ';\n }\n return startCase.trimEnd();\n}\n","import { deburr } from '@string/deburr';\n\n/**\n * Removes all special characters from a string.\n *\n * @example\n * stripSpecialChars('Héllo! World #$%&*!')\n * // => 'Hello World'\n * @category String\n * @param str - The string to remove special characters from.\n * @returns Returns the string with special characters removed.\n*/\n\nexport function stripSpecial(str: string): string {\n str = deburr(str);\n return str.replace(/[^\\s\\w]/gi, '');\n}\n","/**\n * Converts the HTML entities `&amp;`, `&lt;`, `&gt;`, `&quot;` and `&#39;`\n * in a string to their corresponding characters.\n *\n * @example\n * unescape('fred, barney, &amp; pebbles')\n * // => 'fred, barney, & pebbles'\n * @category String\n * @param str - The string to unescape.\n * @returns Returns the unescaped string.\n */\n\nexport function unescapeHtml(str: string): string {\n const entityMap: Record<string, string> = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': '\\''\n };\n return str.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g, (entity: string) => entityMap[entity] || entity);\n}\n","/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @example\n * isEmpty(null)\n * // => true\n *\n * isEmpty({})\n * // => true\n *\n * isEmpty(\"\")\n * // => true\n *\n * isEmpty([1, 2, 3])\n * // => false\n *\n * isEmpty('abc')\n * // => false\n *\n * isEmpty({ 'a': 1 })\n * // => false\n * @category Validate\n * @param value - The value to check.\n * @returns Returns `true` if given vlaue is empty, else `false`.\n */\n\nexport function isEmpty(value: string | object | null | undefined): boolean {\n if (value === null || value === undefined) {\n return true;\n }\n\n if (typeof value === 'string' || Array.isArray(value)) {\n return value.length === 0;\n }\n\n if (value instanceof Map || value instanceof Set) {\n return value.size === 0;\n }\n\n if (typeof value === 'object') {\n return Object.keys(value).length === 0;\n }\n\n return false;\n}\n","export function isPlainObject(value: unknown): value is object {\n return value !== null && typeof value === 'object' && value.constructor === Object;\n}\n","/**\n * Checks if given string is a valid URL\n *\n * @example\n * isUrl('https://google.com')\n * // => true\n * isUrl('google.com')\n * // => false\n * @param str - The string to check.\n * @returns Returns `true` if given string is a valid URL, else `false`.\n */\n\nexport function isUrl(str: string): bool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AAAA,EAClC;AACA,SAAOA;AACX;;;ACZO,SAAS,UAAU,KAAqB;AAC3C,QAAM,QAAQ,WAAW,GAAG;AAC5B,MAAIC,aAAY;AAChB,aAAW,QAAQ,OAAO;AACtB,IAAAA,cAAa,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,EAAE,YAAY,IAAI;AAAA,EAC9E;AACA,SAAOA,WAAU,QAAQ;AAC7B;;;ACXO,SAAS,aAAa,KAAqB;AAC9C,QAAM,OAAO,GAAG;AAChB,SAAO,IAAI,QAAQ,aAAa,EAAE;AACtC;;;ACJO,SAAS,aAAa,KAAqB;AAC9C,QAAM,YAAoC;AAAA,IACtC,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,EACb;AACA,SAAO,IAAI,QAAQ,kCAAkC,CAAC,WAAmB,UAAU,WAAW,MAAM;AACxG;;;ACWO,SAAS,QAAQ,OAAoD;AACxE,MAAI,UAAU,QAAQ,UAAU,QAAW;AACvC,WAAO;AAAA,EACX;AAEA,MAAI,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG;AACnD,WAAO,MAAM,WAAW;AAAA,EAC5B;AAEA,MAAI,iBAAiB,OAAO,iBAAiB,KAAK;AAC9C,WAAO,MAAM,SAAS;AAAA,EAC1B;AAEA,MAAI,OAAO,UAAU,UAAU;AAC3B,WAAO,OAAO,KAAK,KAAK,EAAE,WAAW;AAAA,EACzC;AAEA,SAAO;AACX;;;AClDO,SAAS,cAAc,OAAiC;AAC3D,SAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,MAAM,gBAAgB;AAChF;;;ACUO,SAAS,MAAM,KAAsB;AACxC,MAAI;AACA,QAAI,IAAI,GAAG;AACX,WAAO;AAAA,EACX,QAAE;AACE,WAAO;AAAA,EACX;AACJ;","names":["difference","intersection","count","count","camelCase","kebabCase","pascalCase","snakeCase","startCase"]}
package/package.json CHANGED
@@ -48,5 +48,5 @@
48
48
  "tsup": "6.5.0",
49
49
  "ctix": "1.8.1"
50
50
  },
51
- "version": "0.1.3"
51
+ "version": "0.2.0"
52
52
  }