From 34f69d87e5c6f9094ba3a81dae2456c35a714191 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Mon, 20 Mar 2023 21:21:50 +0100 Subject: [PATCH 01/18] POC Sum const types --- package-lock.json | 7 +++++++ package.json | 1 + package/src/number/sum.ts | 16 +++++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fc66e9cd..d57f7d5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "eslint-plugin-sonarjs": "0.19.0", "eslint-plugin-svelte": "2.23.1", "eslint-plugin-unicorn": "46.0.0", + "hotscript": "1.0.10", "typedoc": "0.23.28", "typescript": "5.0.2", "vite": "4.2.1", @@ -4900,6 +4901,12 @@ "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, + "node_modules/hotscript": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/hotscript/-/hotscript-1.0.10.tgz", + "integrity": "sha512-eDbtzWfe3LN1Zd9NYoNjogmnqd/LiAo1lKztARnEzzsRy5QKW+VJ7TCWzsDwbSuq79KZ0yVoelQD+GPW83O21w==", + "dev": true + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", diff --git a/package.json b/package.json index e55ad981..da00e3fb 100644 --- a/package.json +++ b/package.json @@ -38,5 +38,6 @@ "@vitest/coverage-c8": "0.29.7", "@vitest/ui": "0.29.7", "vite": "4.2.1" + "hotscript": "1.0.10" } } diff --git a/package/src/number/sum.ts b/package/src/number/sum.ts index 4944c910..db65643b 100644 --- a/package/src/number/sum.ts +++ b/package/src/number/sum.ts @@ -1,3 +1,6 @@ + +import type { Pipe, Tuples, Call } from 'hotscript'; + /** * Calculates the sum of an array of numbers. * @@ -9,8 +12,15 @@ * @returns The sum of the input array */ -export function sum(numbers: readonly number[]): number { - if (numbers.length === 0) +export function sum(numbers: number[]): number; +export function sum(numbers: TNum): Call; +export function sum(numbers: TNum): Call | number { +if (numbers.length === 0) return NaN; return numbers.reduce((total, current) => total + current, 0); -} \ No newline at end of file +} + +const arr = [1, 2, 3] as const; + +const test = sum(arr); +// ^? From ac7fd7d6fd870d81d1173edf6a0d48e7473036dd Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Mon, 20 Mar 2023 22:18:12 +0100 Subject: [PATCH 02/18] Stricter set types --- package/src/object/set.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/src/object/set.ts b/package/src/object/set.ts index 522af4cd..da670ccf 100644 --- a/package/src/object/set.ts +++ b/package/src/object/set.ts @@ -1,6 +1,7 @@ import type { PlainObject } from '@type/PlainObject.js'; import { isPlainObject } from '@validate/isPlainObject.js'; +import { Call, Objects, Pipe, Strings } from 'hotscript'; const validPathRegex = /^(?:[^.[\]]+(?:\[\d+])*(?:\.|\[\d+]))+(?:[^.[\]]+(?:\[\d+])*)+$/; const pathSplitRegex = /\.|(?=\[)/g; @@ -30,10 +31,14 @@ const matchBracketsRegex = /[[\]]/g; * @param path The path of the property to set. * @param value The value to set. * @template TObj The type of the object. + * @template TPath The type of the object path. + * @template TVal The type of the value to set. * @returns The modified object. */ -export function set(obj: PlainObject, path: string, value: unknown): PlainObject { +export function set, TVal>(obj: TObj, path: TPath, value: TVal): Call, TObj>; +export function set(obj: TObj, path: string, value: unknown): TObj; +export function set(obj: TObj, path: string, value: unknown): TObj { if (!validPathRegex.test(path)) throw new Error('Invalid path, look at the examples for the correct format.'); From ee73acd8f38b10bf3cdcf7c0c8e6b327599be1c8 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Mon, 20 Mar 2023 22:20:09 +0100 Subject: [PATCH 03/18] remove sum debug code --- package/src/number/sum.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/package/src/number/sum.ts b/package/src/number/sum.ts index db65643b..2a95b45b 100644 --- a/package/src/number/sum.ts +++ b/package/src/number/sum.ts @@ -1,5 +1,5 @@ -import type { Pipe, Tuples, Call } from 'hotscript'; +import type { Tuples, Call } from 'hotscript'; /** * Calculates the sum of an array of numbers. @@ -14,13 +14,8 @@ import type { Pipe, Tuples, Call } from 'hotscript'; export function sum(numbers: number[]): number; export function sum(numbers: TNum): Call; -export function sum(numbers: TNum): Call | number { -if (numbers.length === 0) +export function sum(numbers: TNum): Call | number { + if (numbers.length === 0) return NaN; return numbers.reduce((total, current) => total + current, 0); -} - -const arr = [1, 2, 3] as const; - -const test = sum(arr); -// ^? +} \ No newline at end of file From 4f3534fcaed9363c3bba6f313d9759f24c25a029 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Mon, 20 Mar 2023 22:23:21 +0100 Subject: [PATCH 04/18] remove unused imports --- package/src/object/set.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/src/object/set.ts b/package/src/object/set.ts index da670ccf..813f8e92 100644 --- a/package/src/object/set.ts +++ b/package/src/object/set.ts @@ -1,7 +1,7 @@ import type { PlainObject } from '@type/PlainObject.js'; +import type { Call, Objects } from 'hotscript'; import { isPlainObject } from '@validate/isPlainObject.js'; -import { Call, Objects, Pipe, Strings } from 'hotscript'; const validPathRegex = /^(?:[^.[\]]+(?:\[\d+])*(?:\.|\[\d+]))+(?:[^.[\]]+(?:\[\d+])*)+$/; const pathSplitRegex = /\.|(?=\[)/g; From 8a58fc4bcd8ae1bf666082b9c2f7d878a17ad59d Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Wed, 22 Mar 2023 14:49:12 +0100 Subject: [PATCH 05/18] FlatKeys stricter types --- package/src/object/flatKeys.ts | 8 ++++++-- package/test/object/flatKeys.test.ts | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/package/src/object/flatKeys.ts b/package/src/object/flatKeys.ts index aa073dbb..2d802d10 100644 --- a/package/src/object/flatKeys.ts +++ b/package/src/object/flatKeys.ts @@ -1,7 +1,11 @@ import type { PlainObject } from '@type/PlainObject.js'; +import type { Call, Objects } from 'hotscript'; import { isPlainObject } from '@validate/isPlainObject.js'; +type StringIfNever = [Type] extends [never] ? string : Type; +type Paths = StringIfNever>; + /** * Flattens an object into a single level object. * @@ -15,7 +19,7 @@ import { isPlainObject } from '@validate/isPlainObject.js'; * @returns A new object with flattened keys. */ -export function flatKeys(obj: TObj): Record { +export function flatKeys(obj: TObj): Record, unknown> { const flatObject: Record = {}; for (const [key, value] of Object.entries(obj)) { @@ -39,4 +43,4 @@ function addToResult(prefix: string, value: unknown, flatObject: Record { test('correct flattened keys', () => { const obj = { a: 1, b: { c: 2, d: { e: 3 } } }; + const flat = flatKeys(obj); + const flatGeneric = flatKeys(obj as PlainObject); + + expectTypeOf(flat).toEqualTypeOf>(); + expectTypeOf(flatGeneric).toEqualTypeOf>(); + expect(flatKeys(obj)).toEqual({ a: 1, 'b.c': 2, 'b.d.e': 3 }); }); test('correct flattened keys with arrays', () => { const obj = { a: 1, b: { c: 2, d: [{ e: 3 }, { e: 4, f: { g: 5 } }] } }; - expect(flatKeys(obj)).toEqual({ a: 1, 'b.c': 2, 'b.d[0].e': 3, 'b.d[1].e': 4, 'b.d[1].f.g': 5 }); + const flat = flatKeys(obj); + expectTypeOf(flat).toEqualTypeOf>(); + expect(flat).toEqual({ a: 1, 'b.c': 2, 'b.d[0].e': 3, 'b.d[1].e': 4, 'b.d[1].f.g': 5 }); }); test('nested arrays', () => { From 211b3734c21d6add7c6f19a337a46e8b4c7048f2 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Wed, 22 Mar 2023 16:07:13 +0100 Subject: [PATCH 06/18] AutoComplete Paths for set but still allow any string --- package/src/object/set.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/package/src/object/set.ts b/package/src/object/set.ts index 813f8e92..254107bd 100644 --- a/package/src/object/set.ts +++ b/package/src/object/set.ts @@ -7,6 +7,11 @@ const validPathRegex = /^(?:[^.[\]]+(?:\[\d+])*(?:\.|\[\d+]))+(?:[^.[\]]+(?:\[\d const pathSplitRegex = /\.|(?=\[)/g; const matchBracketsRegex = /[[\]]/g; +// eslint-disable-next-line @typescript-eslint/ban-types +type AutoCompletePaths = Call | string & {}; +type AllPaths = Call; +type UpdateObj = Call, TObj>; + /** * Sets the value at path of object. If a portion of path doesn’t exist, it’s created. * @@ -36,9 +41,9 @@ const matchBracketsRegex = /[[\]]/g; * @returns The modified object. */ -export function set, TVal>(obj: TObj, path: TPath, value: TVal): Call, TObj>; -export function set(obj: TObj, path: string, value: unknown): TObj; -export function set(obj: TObj, path: string, value: unknown): TObj { +export function set, TVal>(obj: TObj, path: TPath, value: TVal): UpdateObj; +export function set(obj: TObj, path: AutoCompletePaths, value: unknown): TObj; +export function set(obj: TObj, path: AutoCompletePaths, value: unknown): TObj { if (!validPathRegex.test(path)) throw new Error('Invalid path, look at the examples for the correct format.'); From dde0f34d84d3c95295c20c0738ec39ec2827a9bc Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Wed, 22 Mar 2023 16:12:40 +0100 Subject: [PATCH 07/18] eslint ignore group assignment warning --- package/src/array/group.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/package/src/array/group.ts b/package/src/array/group.ts index 09b3cff9..46d89f16 100644 --- a/package/src/array/group.ts +++ b/package/src/array/group.ts @@ -18,6 +18,7 @@ export function group(array: readonly TElem[], const result = {} as Record; for (const elem of array) { const key = getGroupKey(elem); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition (result[key] ??= []).push(elem); } return result; From 1bbaa3c358501732fc6baf43c8bfb173348c74f0 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Mon, 27 Mar 2023 11:03:36 +0200 Subject: [PATCH 08/18] update hotscript to fix bugs --- package-lock.json | 8 ++++---- package.json | 4 ++-- package/src/object/set.ts | 11 ++++------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index d57f7d5e..04a43359 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "eslint-plugin-sonarjs": "0.19.0", "eslint-plugin-svelte": "2.23.1", "eslint-plugin-unicorn": "46.0.0", - "hotscript": "1.0.10", + "hotscript": "1.0.11", "typedoc": "0.23.28", "typescript": "5.0.2", "vite": "4.2.1", @@ -4902,9 +4902,9 @@ "dev": true }, "node_modules/hotscript": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/hotscript/-/hotscript-1.0.10.tgz", - "integrity": "sha512-eDbtzWfe3LN1Zd9NYoNjogmnqd/LiAo1lKztARnEzzsRy5QKW+VJ7TCWzsDwbSuq79KZ0yVoelQD+GPW83O21w==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/hotscript/-/hotscript-1.0.11.tgz", + "integrity": "sha512-p7tUz9Lb0M1a/tUJxrXp/8NJ0QbD2UyfFIa89tCkeXB+K8jdIIVSHm7njNDbxw8uorjxRk3iGc2y2KJB5UMKIg==", "dev": true }, "node_modules/html-escaper": { diff --git a/package.json b/package.json index da00e3fb..3c3ca38c 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "vitest": "0.29.7", "@vitest/coverage-c8": "0.29.7", "@vitest/ui": "0.29.7", - "vite": "4.2.1" - "hotscript": "1.0.10" + "vite": "4.2.1", + "hotscript": "1.0.11" } } diff --git a/package/src/object/set.ts b/package/src/object/set.ts index 254107bd..ede554ef 100644 --- a/package/src/object/set.ts +++ b/package/src/object/set.ts @@ -8,8 +8,7 @@ const pathSplitRegex = /\.|(?=\[)/g; const matchBracketsRegex = /[[\]]/g; // eslint-disable-next-line @typescript-eslint/ban-types -type AutoCompletePaths = Call | string & {}; -type AllPaths = Call; +type Paths = Call | string & {}; type UpdateObj = Call, TObj>; /** @@ -41,13 +40,11 @@ type UpdateObj = Call, TVal>(obj: TObj, path: TPath, value: TVal): UpdateObj; -export function set(obj: TObj, path: AutoCompletePaths, value: unknown): TObj; -export function set(obj: TObj, path: AutoCompletePaths, value: unknown): TObj { +export function set, TVal>(obj: TObj, path: TPath, value: TVal): UpdateObj { if (!validPathRegex.test(path)) throw new Error('Invalid path, look at the examples for the correct format.'); - const pathParts = path.split(pathSplitRegex); + const pathParts = (path as string).split(pathSplitRegex); let currentObj: PlainObject = obj; for (let index = 0; index < pathParts.length; index++) { const key = pathParts[index].replace(matchBracketsRegex, ''); @@ -68,5 +65,5 @@ export function set(obj: TObj, path: AutoCompletePaths currentObj = currentObj[key] as PlainObject; } - return obj; + return obj as UpdateObj; } \ No newline at end of file From 0ce3b2e40f1448e1a701018e47afac0ce603fe76 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Mon, 27 Mar 2023 11:49:06 +0200 Subject: [PATCH 09/18] set | add type test --- package/test/object/set.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package/test/object/set.test.ts b/package/test/object/set.test.ts index c8575f5d..9e9776ef 100644 --- a/package/test/object/set.test.ts +++ b/package/test/object/set.test.ts @@ -1,11 +1,13 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect, expectTypeOf } from 'vitest'; import { set } from '@object/set.js'; describe('set', () => { test('set a value', () => { const obj = { a: { b: 2 } }; - set(obj, 'a.c', 1); + const updatedObj = set(obj, 'a.c', 1); + + expectTypeOf(updatedObj).toEqualTypeOf<{ a: { b: number; c: number } }>(); expect(obj).toEqual({ a: { b: 2, c: 1 } }); }); @@ -23,7 +25,8 @@ describe('set', () => { test('recognise number key', () => { const obj = { a: 1 }; - set(obj, 'a.e0[0]', 1); + const updatedObj = set(obj, 'a[0]', 4); + expectTypeOf(updatedObj).toEqualTypeOf<{ a: number[] }>(); expect(obj).toEqual({ a: { e0: [1] } }); }); From 835f53205fcb7d5973fcedbd06fc84ec56d09802 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Mon, 27 Mar 2023 11:51:27 +0200 Subject: [PATCH 10/18] docs(changeset): `FlatKeys` | Correct return types --- .changeset/polite-lobsters-give.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/polite-lobsters-give.md diff --git a/.changeset/polite-lobsters-give.md b/.changeset/polite-lobsters-give.md new file mode 100644 index 00000000..ad994783 --- /dev/null +++ b/.changeset/polite-lobsters-give.md @@ -0,0 +1,5 @@ +--- +"moderndash": minor +--- + +`FlatKeys` | Correct return types From 745cdd3b1c929730377485f0df22ffb9f64ee607 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Mon, 27 Mar 2023 11:52:04 +0200 Subject: [PATCH 11/18] docs(changeset): `set` | Path autocomplete & correct return types --- .changeset/five-bikes-fly.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/five-bikes-fly.md diff --git a/.changeset/five-bikes-fly.md b/.changeset/five-bikes-fly.md new file mode 100644 index 00000000..ce115def --- /dev/null +++ b/.changeset/five-bikes-fly.md @@ -0,0 +1,5 @@ +--- +"moderndash": minor +--- + +`set` | Path autocomplete & correct return types From 1b240721b21a59f147dfccd5c61b8da85bb10e08 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Mon, 27 Mar 2023 11:54:34 +0200 Subject: [PATCH 12/18] update package lock --- package-lock.json | 292 +++++++++++++++++++++++----------------------- 1 file changed, 148 insertions(+), 144 deletions(-) diff --git a/package-lock.json b/package-lock.json index 04a43359..167f6bc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -339,9 +339,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.12.tgz", - "integrity": "sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.14.tgz", + "integrity": "sha512-0CnlwnjDU8cks0yJLXfkaU/uoLyRf9VZJs4p1PskBr2AlAHeEsFEwJEo0of/Z3g+ilw5mpyDwThlxzNEIxOE4g==", "cpu": [ "arm" ], @@ -355,9 +355,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz", - "integrity": "sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.14.tgz", + "integrity": "sha512-eLOpPO1RvtsP71afiFTvS7tVFShJBCT0txiv/xjFBo5a7R7Gjw7X0IgIaFoLKhqXYAXhahoXm7qAmRXhY4guJg==", "cpu": [ "arm64" ], @@ -371,9 +371,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.12.tgz", - "integrity": "sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.14.tgz", + "integrity": "sha512-nrfQYWBfLGfSGLvRVlt6xi63B5IbfHm3tZCdu/82zuFPQ7zez4XjmRtF/wIRYbJQ/DsZrxJdEvYFE67avYXyng==", "cpu": [ "x64" ], @@ -387,9 +387,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz", - "integrity": "sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.14.tgz", + "integrity": "sha512-eoSjEuDsU1ROwgBH/c+fZzuSyJUVXQTOIN9xuLs9dE/9HbV/A5IqdXHU1p2OfIMwBwOYJ9SFVGGldxeRCUJFyw==", "cpu": [ "arm64" ], @@ -403,9 +403,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz", - "integrity": "sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.14.tgz", + "integrity": "sha512-zN0U8RWfrDttdFNkHqFYZtOH8hdi22z0pFm0aIJPsNC4QQZv7je8DWCX5iA4Zx6tRhS0CCc0XC2m7wKsbWEo5g==", "cpu": [ "x64" ], @@ -419,9 +419,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz", - "integrity": "sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.14.tgz", + "integrity": "sha512-z0VcD4ibeZWVQCW1O7szaLxGsx54gcCnajEJMdYoYjLiq4g1jrP2lMq6pk71dbS5+7op/L2Aod+erw+EUr28/A==", "cpu": [ "arm64" ], @@ -435,9 +435,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz", - "integrity": "sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.14.tgz", + "integrity": "sha512-hd9mPcxfTgJlolrPlcXkQk9BMwNBvNBsVaUe5eNUqXut6weDQH8whcNaKNF2RO8NbpT6GY8rHOK2A9y++s+ehw==", "cpu": [ "x64" ], @@ -451,9 +451,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz", - "integrity": "sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.14.tgz", + "integrity": "sha512-BNTl+wSJ1omsH8s3TkQmIIIQHwvwJrU9u1ggb9XU2KTVM4TmthRIVyxSp2qxROJHhZuW/r8fht46/QE8hU8Qvg==", "cpu": [ "arm" ], @@ -467,9 +467,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz", - "integrity": "sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.14.tgz", + "integrity": "sha512-FhAMNYOq3Iblcj9i+K0l1Fp/MHt+zBeRu/Qkf0LtrcFu3T45jcwB6A1iMsemQ42vR3GBhjNZJZTaCe3VFPbn9g==", "cpu": [ "arm64" ], @@ -483,9 +483,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz", - "integrity": "sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.14.tgz", + "integrity": "sha512-91OK/lQ5y2v7AsmnFT+0EyxdPTNhov3y2CWMdizyMfxSxRqHazXdzgBKtlmkU2KYIc+9ZK3Vwp2KyXogEATYxQ==", "cpu": [ "ia32" ], @@ -499,9 +499,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz", - "integrity": "sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.14.tgz", + "integrity": "sha512-vp15H+5NR6hubNgMluqqKza85HcGJgq7t6rMH7O3Y6ApiOWPkvW2AJfNojUQimfTp6OUrACUXfR4hmpcENXoMQ==", "cpu": [ "loong64" ], @@ -515,9 +515,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz", - "integrity": "sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.14.tgz", + "integrity": "sha512-90TOdFV7N+fgi6c2+GO9ochEkmm9kBAKnuD5e08GQMgMINOdOFHuYLPQ91RYVrnWwQ5683sJKuLi9l4SsbJ7Hg==", "cpu": [ "mips64el" ], @@ -531,9 +531,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz", - "integrity": "sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.14.tgz", + "integrity": "sha512-NnBGeoqKkTugpBOBZZoktQQ1Yqb7aHKmHxsw43NddPB2YWLAlpb7THZIzsRsTr0Xw3nqiPxbA1H31ZMOG+VVPQ==", "cpu": [ "ppc64" ], @@ -547,9 +547,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz", - "integrity": "sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.14.tgz", + "integrity": "sha512-0qdlKScLXA8MGVy21JUKvMzCYWovctuP8KKqhtE5A6IVPq4onxXhSuhwDd2g5sRCzNDlDjitc5sX31BzDoL5Fw==", "cpu": [ "riscv64" ], @@ -563,9 +563,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz", - "integrity": "sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.14.tgz", + "integrity": "sha512-Hdm2Jo1yaaOro4v3+6/zJk6ygCqIZuSDJHdHaf8nVH/tfOuoEX5Riv03Ka15LmQBYJObUTNS1UdyoMk0WUn9Ww==", "cpu": [ "s390x" ], @@ -579,9 +579,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz", - "integrity": "sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.14.tgz", + "integrity": "sha512-8KHF17OstlK4DuzeF/KmSgzrTWQrkWj5boluiiq7kvJCiQVzUrmSkaBvcLB2UgHpKENO2i6BthPkmUhNDaJsVw==", "cpu": [ "x64" ], @@ -595,9 +595,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz", - "integrity": "sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.14.tgz", + "integrity": "sha512-nVwpqvb3yyXztxIT2+VsxJhB5GCgzPdk1n0HHSnchRAcxqKO6ghXwHhJnr0j/B+5FSyEqSxF4q03rbA2fKXtUQ==", "cpu": [ "x64" ], @@ -611,9 +611,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz", - "integrity": "sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.14.tgz", + "integrity": "sha512-1RZ7uQQ9zcy/GSAJL1xPdN7NDdOOtNEGiJalg/MOzeakZeTrgH/DoCkbq7TaPDiPhWqnDF+4bnydxRqQD7il6g==", "cpu": [ "x64" ], @@ -627,9 +627,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz", - "integrity": "sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.14.tgz", + "integrity": "sha512-nqMjDsFwv7vp7msrwWRysnM38Sd44PKmW8EzV01YzDBTcTWUpczQg6mGao9VLicXSgW/iookNK6AxeogNVNDZA==", "cpu": [ "x64" ], @@ -643,9 +643,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz", - "integrity": "sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.14.tgz", + "integrity": "sha512-xrD0mccTKRBBIotrITV7WVQAwNJ5+1va6L0H9zN92v2yEdjfAN7864cUaZwJS7JPEs53bDTzKFbfqVlG2HhyKQ==", "cpu": [ "arm64" ], @@ -659,9 +659,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz", - "integrity": "sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.14.tgz", + "integrity": "sha512-nXpkz9bbJrLLyUTYtRotSS3t5b+FOuljg8LgLdINWFs3FfqZMtbnBCZFUmBzQPyxqU87F8Av+3Nco/M3hEcu1w==", "cpu": [ "ia32" ], @@ -675,9 +675,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz", - "integrity": "sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.14.tgz", + "integrity": "sha512-gPQmsi2DKTaEgG14hc3CHXHp62k8g6qr0Pas+I4lUxRMugGSATh/Bi8Dgusoz9IQ0IfdrvLpco6kujEIBoaogA==", "cpu": [ "x64" ], @@ -691,9 +691,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.3.0.tgz", - "integrity": "sha512-v3oplH6FYCULtFuCeqyuTd9D2WKO937Dxdq+GmHOLL72TTRriLxz2VLlNfkZRsvj6PKnOPAtuT6dwrs/pA5DvA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" @@ -706,9 +706,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", - "integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.1.tgz", + "integrity": "sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -958,9 +958,9 @@ } }, "node_modules/@mdn/browser-compat-data": { - "version": "5.2.43", - "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.2.43.tgz", - "integrity": "sha512-J/hkYAUdvmnN1uk7W2UkwyIFEDbM2HK+rqqZpOKxUn9paJ8yzbUrtCv0dAA+mmCoy6U2bBewRq5bENx+M2YVlA==", + "version": "5.2.45", + "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.2.45.tgz", + "integrity": "sha512-Er03EjYAx3TTMvdBdm6Z3SG4IV0/FWfRJP4CBNtRLWoPVVyp9BdYt/9X4zSFw4GAIOVx6+6r7d8VAw0sbPtMjg==", "dev": true }, "node_modules/@nodelib/fs.scandir": { @@ -1307,9 +1307,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.15.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz", - "integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==", + "version": "18.15.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.10.tgz", + "integrity": "sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -2321,9 +2321,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001468", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001468.tgz", - "integrity": "sha512-zgAo8D5kbOyUcRAgSmgyuvBkjrGk5CGYG5TYgFdpQv+ywcyEpo1LOWoG8YmoflGnh+V+UsNuKYedsoYs0hzV5A==", + "version": "1.0.30001470", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001470.tgz", + "integrity": "sha512-065uNwY6QtHCBOExzbV6m236DDhYCCtPmQUCoQtwkVqzud8v5QPidoMr6CoMkC2nfp6nksjttqWQRRh75LqUmA==", "dev": true, "funding": [ { @@ -3007,9 +3007,9 @@ } }, "node_modules/ctix/node_modules/type-fest": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.6.1.tgz", - "integrity": "sha512-htXWckxlT6U4+ilVgweNliPqlsVSSucbxVexRYllyMVJDtf5rTjv6kF/s+qAd4QSL1BZcnJPEJavYBPQiWuZDA==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.7.1.tgz", + "integrity": "sha512-8LZNdvuztgxCF4eYpEmPYUPS0lbbByM2qHcp2oMxHZhWLIQB9QE36EeQ1PKwsUIDZXEP8HCBEmkBbT1//kLU4Q==", "dev": true, "engines": { "node": ">=14.16" @@ -3322,9 +3322,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.333", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.333.tgz", - "integrity": "sha512-YyE8+GKyGtPEP1/kpvqsdhD6rA/TP1DUFDN4uiU/YI52NzDxmwHkEb3qjId8hLBa5siJvG0sfC3O66501jMruQ==", + "version": "1.4.340", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.340.tgz", + "integrity": "sha512-zx8hqumOqltKsv/MF50yvdAlPF9S/4PXbyfzJS6ZGhbddGkRegdwImmfSVqCkEziYzrIGZ/TlrzBND4FysfkDg==", "dev": true }, "node_modules/emoji-regex": { @@ -3471,9 +3471,9 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.12.tgz", - "integrity": "sha512-bX/zHl7Gn2CpQwcMtRogTTBf9l1nl+H6R8nUbjk+RuKqAE3+8FDulLA+pHvX7aA7Xe07Iwa+CWvy9I8Y2qqPKQ==", + "version": "0.17.14", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.14.tgz", + "integrity": "sha512-vOO5XhmVj/1XQR9NQ1UPq6qvMYL7QFJU57J5fKBKBKxp17uDt5PgxFDb4A2nEiXhr1qQs4x0F5+66hVVw4ruNw==", "dev": true, "hasInstallScript": true, "bin": { @@ -3483,28 +3483,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.17.12", - "@esbuild/android-arm64": "0.17.12", - "@esbuild/android-x64": "0.17.12", - "@esbuild/darwin-arm64": "0.17.12", - "@esbuild/darwin-x64": "0.17.12", - "@esbuild/freebsd-arm64": "0.17.12", - "@esbuild/freebsd-x64": "0.17.12", - "@esbuild/linux-arm": "0.17.12", - "@esbuild/linux-arm64": "0.17.12", - "@esbuild/linux-ia32": "0.17.12", - "@esbuild/linux-loong64": "0.17.12", - "@esbuild/linux-mips64el": "0.17.12", - "@esbuild/linux-ppc64": "0.17.12", - "@esbuild/linux-riscv64": "0.17.12", - "@esbuild/linux-s390x": "0.17.12", - "@esbuild/linux-x64": "0.17.12", - "@esbuild/netbsd-x64": "0.17.12", - "@esbuild/openbsd-x64": "0.17.12", - "@esbuild/sunos-x64": "0.17.12", - "@esbuild/win32-arm64": "0.17.12", - "@esbuild/win32-ia32": "0.17.12", - "@esbuild/win32-x64": "0.17.12" + "@esbuild/android-arm": "0.17.14", + "@esbuild/android-arm64": "0.17.14", + "@esbuild/android-x64": "0.17.14", + "@esbuild/darwin-arm64": "0.17.14", + "@esbuild/darwin-x64": "0.17.14", + "@esbuild/freebsd-arm64": "0.17.14", + "@esbuild/freebsd-x64": "0.17.14", + "@esbuild/linux-arm": "0.17.14", + "@esbuild/linux-arm64": "0.17.14", + "@esbuild/linux-ia32": "0.17.14", + "@esbuild/linux-loong64": "0.17.14", + "@esbuild/linux-mips64el": "0.17.14", + "@esbuild/linux-ppc64": "0.17.14", + "@esbuild/linux-riscv64": "0.17.14", + "@esbuild/linux-s390x": "0.17.14", + "@esbuild/linux-x64": "0.17.14", + "@esbuild/netbsd-x64": "0.17.14", + "@esbuild/openbsd-x64": "0.17.14", + "@esbuild/sunos-x64": "0.17.14", + "@esbuild/win32-arm64": "0.17.14", + "@esbuild/win32-ia32": "0.17.14", + "@esbuild/win32-x64": "0.17.14" } }, "node_modules/escalade": { @@ -4619,9 +4619,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.4.0.tgz", - "integrity": "sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.5.0.tgz", + "integrity": "sha512-MjhiaIWCJ1sAU4pIQ5i5OfOuHHxVo1oYeNsWTON7jxYkod8pHocXeh+SSbmu5OZZZK73B6cbJ2XADzXehLyovQ==", "dev": true, "funding": { "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" @@ -5522,9 +5522,9 @@ } }, "node_modules/js-sdsl": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", - "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", + "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", "dev": true, "funding": { "type": "opencollective", @@ -6165,10 +6165,16 @@ } }, "node_modules/nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -7139,9 +7145,9 @@ } }, "node_modules/prettier": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", + "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -7460,9 +7466,9 @@ } }, "node_modules/remeda": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/remeda/-/remeda-1.9.1.tgz", - "integrity": "sha512-n8vx5dg27jRCUYlM7RXQ9MbJCspb18/9wmrRTLKNNECivtAZBuxok0Ei6yV0jcFsnKLr8Y6oiuLyDXU1jt5UKw==", + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/remeda/-/remeda-1.9.4.tgz", + "integrity": "sha512-T3UYE0SJuvKUvKYLnlf6BQ/p069ySRnX14jqMsXCCR+kcj+t0PjS9wAXzbGvTpMlTsJVu34C7NdHRNNSEuVo2g==", "dev": true }, "node_modules/require-directory": { @@ -7545,9 +7551,9 @@ } }, "node_modules/rollup": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.19.1.tgz", - "integrity": "sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==", + "version": "3.20.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.20.2.tgz", + "integrity": "sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -7992,9 +7998,9 @@ } }, "node_modules/sonic-boom": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.2.1.tgz", - "integrity": "sha512-iITeTHxy3B9FGu8aVdiDXUVAcHMF9Ss0cCsAOo2HfCrmVGT3/DT5oYaeu0M/YKZDlKTvChEyPq0zI9Hf33EX6A==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.3.0.tgz", + "integrity": "sha512-LYxp34KlZ1a2Jb8ZQgFCK3niIHzibdwtwNUWKg0qQRzsDoJ3Gfgkf8KdBTFU3SkejDEIlWwnSnpVdOZIhFMl/g==", "dev": true, "dependencies": { "atomic-sleep": "^1.0.0" @@ -8146,9 +8152,9 @@ "dev": true }, "node_modules/split2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", - "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true, "engines": { "node": ">= 10.x" @@ -8355,9 +8361,9 @@ } }, "node_modules/sucrase": { - "version": "3.29.0", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.29.0.tgz", - "integrity": "sha512-bZPAuGA5SdFHuzqIhTAqt9fvNEo9rESqXIG3oiKdF8K4UmkQxC4KlNL3lVyAErXp+mPvUqZ5l13qx6TrDIGf3A==", + "version": "3.31.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.31.0.tgz", + "integrity": "sha512-6QsHnkqyVEzYcaiHsOKkzOtOgdJcb8i54x6AV2hDwyZcY9ZyykGZVw6L/YN98xC0evwTP6utsWWrKRaa8QlfEQ==", "dev": true, "dependencies": { "commander": "^4.0.0", @@ -9306,9 +9312,9 @@ } }, "node_modules/typedoc/node_modules/minimatch": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", - "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.3.tgz", + "integrity": "sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A==", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -9968,7 +9974,6 @@ } }, "package": { - "name": "moderndash", "version": "3.1.0", "license": "MIT", "devDependencies": { @@ -9982,7 +9987,6 @@ } }, "website": { - "name": "documentation-website", "dependencies": { "typedoc-json-parser": "7.2.0" }, From cb60c3925509a1bcf86a04b6f20969e4f6d1abd9 Mon Sep 17 00:00:00 2001 From: Maximilian Dewald Date: Wed, 5 Apr 2023 18:06:02 +0200 Subject: [PATCH 13/18] eslint fixes --- .eslintrc.cjs | 189 +---- benchmark/array/chunk.bench.ts | 22 +- benchmark/array/count.bench.ts | 16 +- benchmark/array/difference.bench.ts | 36 +- benchmark/array/dropRightWhile.bench.ts | 18 +- benchmark/array/dropWhile.bench.ts | 18 +- benchmark/array/group.bench.ts | 22 +- benchmark/array/intersection.bench.ts | 28 +- benchmark/array/shuffle.bench.ts | 18 +- benchmark/array/takeRightWhile.bench.ts | 18 +- benchmark/array/takeWhile.bench.ts | 24 +- benchmark/array/unique.bench.ts | 24 +- benchmark/crypto/hash.bench.ts | 10 +- benchmark/crypto/randomInt.bench.ts | 12 +- benchmark/number/median.bench.ts | 14 +- benchmark/object/flatKeys.bench.ts | 12 +- benchmark/object/omit.bench.ts | 32 +- benchmark/object/pick.bench.ts | 32 +- benchmark/object/set.bench.ts | 40 +- benchmark/string/camelCase.bench.ts | 18 +- benchmark/string/deburr.bench.ts | 16 +- benchmark/string/kebabCase.bench.ts | 18 +- benchmark/string/titleCase.bench.ts | 18 +- benchmark/testData.ts | 4 +- benchmark/validate/isEmpty.bench.ts | 22 +- benchmark/validate/isEqual.bench.ts | 30 +- benchmark/vitest.config.ts | 4 +- package-lock.json | 645 ++++++++++-------- package.json | 25 +- package/src/array/difference.ts | 8 +- package/src/array/index.ts | 26 +- package/src/array/intersection.ts | 10 +- package/src/array/range.ts | 4 +- package/src/array/sort.ts | 6 +- package/src/crypto/hash.ts | 12 +- package/src/crypto/index.ts | 10 +- package/src/crypto/randomElem.ts | 2 +- package/src/crypto/randomFloat.ts | 2 +- package/src/crypto/randomInt.ts | 4 +- package/src/crypto/randomString.ts | 8 +- package/src/decorator/decDebounce.ts | 4 +- package/src/decorator/decMaxCalls.ts | 4 +- package/src/decorator/decMemoize.ts | 4 +- package/src/decorator/decMinCalls.ts | 4 +- package/src/decorator/decThrottle.ts | 4 +- package/src/decorator/index.ts | 12 +- package/src/decorator/toDecorator.ts | 2 +- package/src/function/debounce.ts | 2 +- package/src/function/index.ts | 12 +- package/src/function/maxCalls.ts | 2 +- package/src/function/memoize.ts | 2 +- package/src/function/minCalls.ts | 2 +- package/src/function/throttle.ts | 2 +- package/src/helpers/ArrayTypeUtils.ts | 2 +- package/src/index.ts | 20 +- package/src/number/average.ts | 2 +- package/src/number/index.ts | 8 +- package/src/number/sum.ts | 2 +- package/src/object/flatKeys.ts | 6 +- package/src/object/index.ts | 10 +- package/src/object/merge.ts | 6 +- package/src/object/omit.ts | 4 +- package/src/object/pick.ts | 2 +- package/src/object/set.ts | 18 +- package/src/promise/index.ts | 12 +- package/src/promise/queue.ts | 2 +- package/src/promise/retry.ts | 4 +- package/src/string/camelCase.ts | 6 +- package/src/string/deburr.ts | 2 +- package/src/string/escapeHtml.ts | 10 +- package/src/string/escapeRegExp.ts | 2 +- package/src/string/index.ts | 22 +- package/src/string/kebabCase.ts | 8 +- package/src/string/pascalCase.ts | 6 +- package/src/string/snakeCase.ts | 8 +- package/src/string/splitWords.ts | 14 +- package/src/string/titleCase.ts | 8 +- package/src/string/unescapeHtml.ts | 10 +- package/src/type/ArrayMinLength.ts | 2 +- package/src/type/index.ts | 8 +- package/src/validate/index.ts | 8 +- package/src/validate/isEmpty.ts | 4 +- package/src/validate/isEqual.ts | 4 +- package/src/validate/isPlainObject.ts | 2 +- package/test/array/chunk.test.ts | 16 +- package/test/array/count.test.ts | 22 +- package/test/array/difference.test.ts | 18 +- package/test/array/dropMethods.test.ts | 20 +- package/test/array/group.test.ts | 28 +- package/test/array/intersection.test.ts | 18 +- package/test/array/range.test.ts | 14 +- package/test/array/shuffle.test.ts | 10 +- package/test/array/sort.test.ts | 34 +- package/test/array/takeMethods.test.ts | 26 +- package/test/array/unique.test.ts | 20 +- package/test/crypto/hash.test.ts | 20 +- package/test/crypto/randomElem.test.ts | 14 +- package/test/crypto/randomFloat.test.ts | 16 +- package/test/crypto/randomInt.test.ts | 20 +- package/test/crypto/randomString.test.ts | 22 +- package/test/decorator/toDecorator.test.ts | 10 +- package/test/function/debounce.test.ts | 18 +- package/test/function/maxCalls.test.ts | 12 +- package/test/function/memoize.test.ts | 20 +- package/test/function/minCalls.test.ts | 12 +- package/test/function/throttle.test.ts | 12 +- package/test/function/times.test.ts | 12 +- package/test/number/average.test.ts | 18 +- package/test/number/median.test.ts | 18 +- package/test/number/round.test.ts | 8 +- package/test/number/sum.test.ts | 16 +- package/test/object/flatKeys.test.ts | 28 +- package/test/object/merge.test.ts | 16 +- package/test/object/omit.test.ts | 18 +- package/test/object/pick.test.ts | 16 +- package/test/object/set.test.ts | 34 +- package/test/promise/queue.test.ts | 38 +- package/test/promise/races.test.ts | 16 +- package/test/promise/retry.test.ts | 40 +- package/test/promise/sleep.test.ts | 8 +- package/test/promise/timeout.test.ts | 20 +- package/test/promise/tryCatch.test.ts | 16 +- package/test/string/camelCase.test.ts | 18 +- package/test/string/capitalize.test.ts | 18 +- package/test/string/deburr.test.ts | 20 +- package/test/string/escapeHtml.test.ts | 16 +- package/test/string/escapeRegExp.test.ts | 20 +- package/test/string/kebabCase.test.ts | 20 +- package/test/string/pascalCase.test.ts | 20 +- package/test/string/snakeCase.test.ts | 24 +- package/test/string/splitWords.test.ts | 26 +- package/test/string/titleCase.test.ts | 20 +- package/test/string/unescapeHtml.test.ts | 16 +- package/test/validate/isEmpty.test.ts | 26 +- package/test/validate/isEqual.test.ts | 48 +- package/test/validate/isPlainObject.test.ts | 12 +- package/test/validate/isUrl.test.ts | 12 +- package/tsup.config.ts | 8 +- package/vitest.config.ts | 26 +- website/src/components/EditButton.svelte | 4 +- website/src/components/Header.svelte | 16 +- website/src/components/Meta.svelte | 20 +- website/src/components/Playground.svelte | 64 +- .../src/components/sidebar/Catergory.svelte | 6 +- website/src/components/sidebar/Sidebar.svelte | 10 +- website/src/routes/+layout.server.ts | 10 +- website/src/routes/+layout.svelte | 12 +- website/src/routes/+page.server.ts | 8 +- website/src/routes/+page.svelte | 6 +- .../src/routes/docs/[method]/+page.server.ts | 32 +- website/src/routes/docs/[method]/+page.svelte | 8 +- website/src/utils/docData.ts | 4 +- website/src/utils/markdown.ts | 2 +- website/src/utils/searchStore.ts | 4 +- website/vite.config.ts | 17 +- 155 files changed, 1476 insertions(+), 1576 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1c79954d..e59d35d3 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,190 +1,5 @@ /** @type {import('eslint').Linter.Config} */ module.exports = { root: true, - parser: '@typescript-eslint/parser', - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:@typescript-eslint/strict", - "plugin:compat/recommended", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:import/typescript", - "plugin:sonarjs/recommended", - "plugin:unicorn/recommended", - "plugin:svelte/recommended" - ], - plugins: [ - '@typescript-eslint', - "compat", - "deprecate", - "import", - "sonarjs", - "unicorn", - ], - ignorePatterns: [ - "**/build/**", - "**/node_modules/**", - "**/.svelte-kit/**", - "**/dist/**", - "website/*.config.*", - ".eslintrc.cjs", - "**/coverage/**" - ], - overrides: [ - { - files: ["*.svelte"], - parser: "svelte-eslint-parser", - parserOptions: { - parser: "@typescript-eslint/parser", - project: './*/tsconfig.json' - }, - } - ], - env: { - browser: true, - es2022: true, - node: true - }, - settings: { - "import/resolver": { - typescript: { - alwaysTryTypes: true, - project: './*/tsconfig.json', - }, - } - }, - parserOptions: { - sourceType: "module", - ecmaVersion: "latest", - project: './*/tsconfig.json', - extraFileExtensions: [".svelte"] - }, - rules: { - "no-constant-condition": 0, - "array-bracket-spacing": ["error", "never"], - "array-callback-return": "error", - "arrow-spacing": "error", - "block-spacing": "error", - "camelcase": ["error", { "properties": "always" }], - "complexity": ["error", 12], - "default-case-last": "error", - "eqeqeq": ["error", "always"], - "import/default": 2, - "import/extensions": 0, //["error", "ignorePackages", { "json": "always", "svg": "always", "ts": "never", "tsx": "never" }], - "import/no-commonjs": 2, - "import/no-self-import": 2, - "import/no-named-as-default": 0, - "import/no-unresolved": ["error", { "ignore": ["^\\$"] }], - "import/no-useless-path-segments": 2, - "import/order": [ - "warn", { - "alphabetize": { "order": "asc", "caseInsensitive": true }, - "groups": ["type", "builtin", "external", "internal", "parent", "sibling", "index", "object"], - "pathGroupsExcludedImportTypes": ["builtin"], - "newlines-between": "always" - } - ], - "linebreak-style": ["error", "unix"], - "max-depth": ["error", 4], - "max-lines": ["warn", { "max": 250, "skipComments": true, "skipBlankLines": true }], - "max-params": ["error", 6], - "new-cap": ["error", { "capIsNewExceptions": ["Router"] }], - "no-await-in-loop": "error", - "no-bitwise": "error", - "no-eval": "error", - "no-lone-blocks": "error", - "no-mixed-operators": "error", - "no-multiple-empty-lines": [2, { "max": 2, "maxEOF": 1 }], - "no-return-await": "error", - "no-self-assign": 0, - "no-self-compare": "error", - "no-unmodified-loop-condition": "error", - "no-unneeded-ternary": "error", - "no-unreachable-loop": "error", - "no-unsafe-optional-chaining": "error", - "no-useless-concat": "error", - "no-useless-rename": "error", - "no-var": "error", - "no-whitespace-before-property": "error", - "no-implicit-coercion": 2, - "no-negated-condition": 2, - "object-shorthand": ["error", "properties"], - "operator-assignment": ["error", "always"], - "prefer-const": ["error", { "destructuring": "all" }], - "prefer-object-spread": "error", - "prefer-spread": "error", - "require-returns-description": 0, - "semi-spacing": "error", - "sonarjs/cognitive-complexity": 0, - "sonarjs/no-duplicate-string": 0, - "sonarjs/no-nested-template-literals": 0, - "spaced-comment": ["error", "always", { "markers": ["/"] }], - "template-curly-spacing": "error", - "unicorn/filename-case": ["error", { "cases": { "camelCase": true, "pascalCase": true } }], - "unicorn/no-null": 0, - "unicorn/no-array-reduce": 2, - "unicorn/no-thenable": 0, - "unicorn/prefer-at": 1, - "unicorn/no-useless-undefined": 0, - "unicorn/numeric-separators-style": ["error", { "onlyIfContainsSeparator": true }], - "unicorn/prefer-module": 0, - "unicorn/no-new-array": 0, - "unicorn/prefer-number-properties": 0, - "unicorn/prefer-switch": 0, - "unicorn/prefer-ternary": ["error", "only-single-line"], - "unicorn/prevent-abbreviations": 0, - "unicorn/switch-case-braces": ["error", "avoid"], - "@typescript-eslint/brace-style": ["error", "1tbs", { "allowSingleLine": true }], - "@typescript-eslint/comma-dangle": ["error", "never"], - "@typescript-eslint/naming-convention": ["error", { "selector": "typeLike", "format": ["PascalCase"] }], - "@typescript-eslint/consistent-type-imports": 2, - "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }], - "@typescript-eslint/type-annotation-spacing": 1, - "@typescript-eslint/consistent-type-definitions": 0, - "@typescript-eslint/default-param-last": 2, - "@typescript-eslint/no-useless-empty-export": 2, - "@typescript-eslint/no-confusing-void-expression": ["warn", { "ignoreArrowShorthand": true, "ignoreVoidOperator": true }], - "@typescript-eslint/switch-exhaustiveness-check": "warn", - "@typescript-eslint/indent": ["warn", 4, { "SwitchCase": 1 }], - "@typescript-eslint/keyword-spacing": 2, - "@typescript-eslint/no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], - "@typescript-eslint/object-curly-spacing": ["error", "always", { "objectsInObjects": true }], - "@typescript-eslint/quotes": ["error", "single"], - "@typescript-eslint/require-await": "error", - "@typescript-eslint/semi": ["error", "always", { "omitLastInOneLineBlock": true }], - "@typescript-eslint/space-before-blocks": "error", - "@typescript-eslint/space-before-function-paren": ["error", { "anonymous": "always", "named": "never", "asyncArrow": "always" }], - "@typescript-eslint/space-infix-ops": "error", - "@typescript-eslint/no-redundant-type-constituents": "warn", - "@typescript-eslint/no-confusing-void-expression": ["warn", { ignoreArrowShorthand: true }], - "@typescript-eslint/prefer-enum-initializers": "warn", - "@typescript-eslint/comma-spacing": "warn", - "@typescript-eslint/no-non-null-assertion": 0, - "@typescript-eslint/prefer-nullish-coalescing": ["warn", { "ignoreTernaryTests": false, "ignoreConditionalTests": false, "ignoreMixedLogicalExpressions": false }], - "svelte/require-optimized-style-attribute": "error", - "svelte/html-closing-bracket-spacing": ["error", { - "startTag": "never", - "endTag": "never", - "selfClosingTag": "never" - }], - "svelte/html-quotes": "error", - "svelte/html-self-closing": "error", - "svelte/indent": ["warn", { - "indent": 4, - "switchCase": 2, - }], - "svelte/mustache-spacing": "error", - "svelte/no-extra-reactive-curlies": "error", - "svelte/no-spaces-around-equal-signs-in-attribute": "error", - "svelte/prefer-class-directive": "error", - "svelte/prefer-style-directive": "error", - "svelte/shorthand-attribute": "error", - "svelte/shorthand-directive": "error", - "svelte/no-at-html-tags": 0, - "svelte/valid-prop-names-in-kit-pages": 2, - "svelte/require-store-reactive-access": 2, - "svelte/block-lang": ["error", { "script": "ts" }] - }, -}; + extends: ["dewald"] +}; \ No newline at end of file diff --git a/benchmark/array/chunk.bench.ts b/benchmark/array/chunk.bench.ts index beb64fd4..a14025dd 100644 --- a/benchmark/array/chunk.bench.ts +++ b/benchmark/array/chunk.bench.ts @@ -1,35 +1,35 @@ -import { chunk as chunkLodash } from 'lodash-es'; -import { chunk } from 'moderndash'; -import { cluster as chunkRadash } from 'radash'; -import { chunk as chunkRemeda } from 'remeda'; -import { bench, describe } from 'vitest'; +import { chunk as chunkLodash } from "lodash-es"; +import { chunk } from "moderndash"; +import { cluster as chunkRadash } from "radash"; +import { chunk as chunkRemeda } from "remeda"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomObjectArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomObjectArray, randomStringArray } from "../testData.js"; -describe('chunk', () => { +describe("chunk", () => { const strArray = randomStringArray(100); const numArray = randomNumberArray(100); const objArray = randomObjectArray(20); - bench('moderndash', () => { + bench("moderndash", () => { chunk(strArray, 5); chunk(numArray, 5); chunk(objArray, 5); }); - bench('lodash', () => { + bench("lodash", () => { chunkLodash(strArray, 5); chunkLodash(numArray, 5); chunkLodash(objArray, 5); }); - bench('radash', () => { + bench("radash", () => { chunkRadash(strArray, 5); chunkRadash(numArray, 5); chunkRadash(objArray, 5); }); - bench('remeda', () => { + bench("remeda", () => { chunkRemeda(strArray, 5); chunkRemeda(numArray, 5); chunkRemeda(objArray, 5); diff --git a/benchmark/array/count.bench.ts b/benchmark/array/count.bench.ts index 5a38eab4..bfb8a099 100644 --- a/benchmark/array/count.bench.ts +++ b/benchmark/array/count.bench.ts @@ -1,27 +1,27 @@ -import { countBy as lodashVersion } from 'lodash-es'; -import { count, randomInt, randomString } from 'moderndash'; -import { counting as radashVersion } from 'radash'; -import { bench, describe } from 'vitest'; +import { countBy as lodashVersion } from "lodash-es"; +import { count, randomInt, randomString } from "moderndash"; +import { counting as radashVersion } from "radash"; +import { bench, describe } from "vitest"; const arraySize = 500; const getRandomArray = () => Array.from({ length: arraySize }, () => ({ a: randomString(3), b: randomInt(1, 3) })); -describe('count', () => { +describe("count", () => { const arr = getRandomArray(); - bench('moderndash', () => { + bench("moderndash", () => { count(arr, elem => elem.b); count(arr, elem => elem.a + elem.b.toString()); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(arr, elem => elem.b); lodashVersion(arr, elem => elem.a + elem.b.toString()); }); - bench('radash', () => { + bench("radash", () => { radashVersion(arr, elem => elem.b); radashVersion(arr, elem => elem.a + elem.b.toString()); }); diff --git a/benchmark/array/difference.bench.ts b/benchmark/array/difference.bench.ts index 1f5b42b0..a20cf572 100644 --- a/benchmark/array/difference.bench.ts +++ b/benchmark/array/difference.bench.ts @@ -1,68 +1,68 @@ -import { difference as lodashVersion, differenceWith as lodashVersionWith } from 'lodash-es'; -import { difference } from 'moderndash'; -import { diff as radashVersion } from 'radash'; -import { difference as remedaVersion, differenceWith as remedaVersionWith } from 'remeda'; -import { bench, describe } from 'vitest'; +import { difference as lodashVersion, differenceWith as lodashVersionWith } from "lodash-es"; +import { difference } from "moderndash"; +import { diff as radashVersion } from "radash"; +import { difference as remedaVersion, differenceWith as remedaVersionWith } from "remeda"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomStringArray } from "../testData.js"; -describe('difference', () => { +describe("difference", () => { const array1 = randomNumberArray(50, 0, 50); const array2 = randomNumberArray(50, 0, 50); const array3 = randomStringArray(50); const array4 = randomStringArray(50); - bench('moderndash', () => { + bench("moderndash", () => { difference(array1, array2); difference(array3, array4); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(array1, array2); lodashVersion(array3, array4); }); - bench('radash', () => { + bench("radash", () => { radashVersion(array1, array2); radashVersion(array3, array4); }); - bench('remeda', () => { + bench("remeda", () => { remedaVersion(array1, array2); remedaVersion(array3, array4); }); }); -describe('difference 4 arrays', () => { +describe("difference 4 arrays", () => { const array1 = randomNumberArray(50, 0, 50); const array2 = randomNumberArray(50, 0, 50); const array3 = randomNumberArray(50, 0, 50); const array4 = randomNumberArray(50, 0, 50); - bench('moderndash', () => { + bench("moderndash", () => { difference(array1, array2, array3, array4); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(array1, array2, array3, array4); }); }); -describe('difference compareFn', () => { +describe("difference compareFn", () => { const array1 = randomNumberArray(50, 0, 50); const array2 = randomNumberArray(50, 0, 50); - bench('moderndash', () => { + bench("moderndash", () => { difference(array1, array2, (a, b) => a - 1 === b); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersionWith(array1, array2, (a, b) => a - 1 === b); }); - bench('remeda', () => { + bench("remeda", () => { remedaVersionWith(array1, array2, (a, b) => a - 1 === b); }); }); \ No newline at end of file diff --git a/benchmark/array/dropRightWhile.bench.ts b/benchmark/array/dropRightWhile.bench.ts index 0e83444c..6f191309 100644 --- a/benchmark/array/dropRightWhile.bench.ts +++ b/benchmark/array/dropRightWhile.bench.ts @@ -1,20 +1,20 @@ -import { dropRightWhile as lodashVersion } from 'lodash-es'; -import { dropRightWhile } from 'moderndash'; -import { bench, describe } from 'vitest'; +import { dropRightWhile as lodashVersion } from "lodash-es"; +import { dropRightWhile } from "moderndash"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomStringArray } from "../testData.js"; -describe('dropRightWhile', () => { +describe("dropRightWhile", () => { const numArray = randomNumberArray(200); const stringArray = randomStringArray(200); - bench('moderndash', () => { + bench("moderndash", () => { dropRightWhile(numArray, (num) => num < 20); - dropRightWhile(stringArray, (str) => str.includes('a')); + dropRightWhile(stringArray, (str) => str.includes("a")); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(numArray, (num) => num < 20); - lodashVersion(stringArray, (str) => str.includes('a')); + lodashVersion(stringArray, (str) => str.includes("a")); }); }); \ No newline at end of file diff --git a/benchmark/array/dropWhile.bench.ts b/benchmark/array/dropWhile.bench.ts index 69a1019b..4c8ac4d5 100644 --- a/benchmark/array/dropWhile.bench.ts +++ b/benchmark/array/dropWhile.bench.ts @@ -1,20 +1,20 @@ -import { dropWhile as lodashVersion } from 'lodash-es'; -import { dropWhile } from 'moderndash'; -import { bench, describe } from 'vitest'; +import { dropWhile as lodashVersion } from "lodash-es"; +import { dropWhile } from "moderndash"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomStringArray } from "../testData.js"; -describe('dropWhile', () => { +describe("dropWhile", () => { const numArray = randomNumberArray(200); const stringArray = randomStringArray(200); - bench('moderndash', () => { + bench("moderndash", () => { dropWhile(numArray, (num) => num < 20); - dropWhile(stringArray, (str) => str.includes('a')); + dropWhile(stringArray, (str) => str.includes("a")); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(numArray, (num) => num < 20); - lodashVersion(stringArray, (str) => str.includes('a')); + lodashVersion(stringArray, (str) => str.includes("a")); }); }); \ No newline at end of file diff --git a/benchmark/array/group.bench.ts b/benchmark/array/group.bench.ts index 1fa2d43e..1cd6e730 100644 --- a/benchmark/array/group.bench.ts +++ b/benchmark/array/group.bench.ts @@ -1,31 +1,31 @@ -import { groupBy as lodashVersion } from 'lodash-es'; -import { group } from 'moderndash'; -import { group as radashVersion } from 'radash'; -import { groupBy as remedaVersion } from 'remeda'; -import { bench, describe } from 'vitest'; +import { groupBy as lodashVersion } from "lodash-es"; +import { group } from "moderndash"; +import { group as radashVersion } from "radash"; +import { groupBy as remedaVersion } from "remeda"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomStringArray } from "../testData.js"; -describe('group', () => { +describe("group", () => { const strArray = randomStringArray(100); const numArray = randomNumberArray(100); - bench('moderndash', () => { + bench("moderndash", () => { group(strArray, (elem) => elem.length); group(numArray, (elem) => elem % 2); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(strArray, (elem) => elem.length); lodashVersion(numArray, (elem) => elem % 2); }); - bench('radash', () => { + bench("radash", () => { radashVersion(strArray, (elem) => elem.length); radashVersion(numArray, (elem) => elem % 2); }); - bench('remeda', () => { + bench("remeda", () => { remedaVersion(strArray, (elem) => elem.length); remedaVersion(numArray, (elem) => elem % 2); }); diff --git a/benchmark/array/intersection.bench.ts b/benchmark/array/intersection.bench.ts index bbad3790..b5402ecb 100644 --- a/benchmark/array/intersection.bench.ts +++ b/benchmark/array/intersection.bench.ts @@ -1,47 +1,47 @@ -import { intersection as lodashVersion, intersectionWith as lodashVersionWith } from 'lodash-es'; -import { intersection } from 'moderndash'; -import { intersection as remedaVersion } from 'remeda'; -import { bench, describe } from 'vitest'; +import { intersection as lodashVersion, intersectionWith as lodashVersionWith } from "lodash-es"; +import { intersection } from "moderndash"; +import { intersection as remedaVersion } from "remeda"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomStringArray } from "../testData.js"; -describe('intersection', () => { +describe("intersection", () => { const array1 = randomNumberArray(50, 0, 50); const array2 = randomNumberArray(50, 0, 50); const array3 = randomStringArray(50); const array4 = randomStringArray(50); - bench('moderndash', () => { + bench("moderndash", () => { intersection(array1, array2); intersection(array3, array4); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(array1, array2); lodashVersion(array3, array4); }); - bench('remeda', () => { + bench("remeda", () => { remedaVersion(array1, array2); remedaVersion(array3, array4); }); }); -describe('intersectionWith', () => { +describe("intersectionWith", () => { const array1 = randomNumberArray(50, 0, 50); const array2 = randomNumberArray(50, 0, 50); const array3 = randomStringArray(50); const array4 = randomStringArray(50); - bench('moderndash', () => { + bench("moderndash", () => { intersection(array1, array2, (a, b) => a - b === 0); - intersection(array3, array4, (a, b) => a.replace('a', '') === b.replace('a', 'b')); + intersection(array3, array4, (a, b) => a.replace("a", "") === b.replace("a", "b")); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersionWith(array1, array2, (a, b) => a - b === 0); - lodashVersionWith(array3, array4, (a, b) => a.replace('a', '') === b.replace('a', 'b')); + lodashVersionWith(array3, array4, (a, b) => a.replace("a", "") === b.replace("a", "b")); }); }); diff --git a/benchmark/array/shuffle.bench.ts b/benchmark/array/shuffle.bench.ts index 7ca4a154..3f1cdeed 100644 --- a/benchmark/array/shuffle.bench.ts +++ b/benchmark/array/shuffle.bench.ts @@ -1,27 +1,27 @@ -import { shuffle as lodashVersion } from 'lodash-es'; -import { shuffle } from 'moderndash'; -import { shuffle as radashVersion } from 'radash'; -import { bench, describe } from 'vitest'; +import { shuffle as lodashVersion } from "lodash-es"; +import { shuffle } from "moderndash"; +import { shuffle as radashVersion } from "radash"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomStringArray } from "../testData.js"; -describe('shuffle', () => { +describe("shuffle", () => { const strings = randomStringArray(200); const numbers = randomNumberArray(200); - bench('moderndash', () => { + bench("moderndash", () => { shuffle(strings); shuffle(numbers); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(strings); lodashVersion(numbers); }); - bench('radash', () => { + bench("radash", () => { radashVersion(strings); radashVersion(numbers); }); diff --git a/benchmark/array/takeRightWhile.bench.ts b/benchmark/array/takeRightWhile.bench.ts index 5fbd765d..c1bbd0c4 100644 --- a/benchmark/array/takeRightWhile.bench.ts +++ b/benchmark/array/takeRightWhile.bench.ts @@ -1,21 +1,21 @@ -import { takeRightWhile as lodashVersion } from 'lodash-es'; -import { takeRightWhile } from 'moderndash'; -import { bench, describe } from 'vitest'; +import { takeRightWhile as lodashVersion } from "lodash-es"; +import { takeRightWhile } from "moderndash"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomStringArray } from "../testData.js"; -describe('takeRightWhile', () => { +describe("takeRightWhile", () => { const numArray = randomNumberArray(200); const stringArray = randomStringArray(200); - bench('moderndash', () => { + bench("moderndash", () => { takeRightWhile(numArray, (num) => num < 20); - takeRightWhile(stringArray, (str) => str.includes('a')); + takeRightWhile(stringArray, (str) => str.includes("a")); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(numArray, (num) => num < 20); - lodashVersion(stringArray, (str) => str.includes('a')); + lodashVersion(stringArray, (str) => str.includes("a")); }); }); \ No newline at end of file diff --git a/benchmark/array/takeWhile.bench.ts b/benchmark/array/takeWhile.bench.ts index dc8fc8e1..dbb398f5 100644 --- a/benchmark/array/takeWhile.bench.ts +++ b/benchmark/array/takeWhile.bench.ts @@ -1,27 +1,27 @@ -import { takeWhile as lodashVersion } from 'lodash-es'; -import { takeWhile } from 'moderndash'; -import { takeWhile as remedaVersion } from 'remeda'; -import { bench, describe } from 'vitest'; +import { takeWhile as lodashVersion } from "lodash-es"; +import { takeWhile } from "moderndash"; +import { takeWhile as remedaVersion } from "remeda"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomStringArray } from "../testData.js"; -describe('takeWhile', () => { +describe("takeWhile", () => { const numArray = randomNumberArray(100); const stringArray = randomStringArray(100); - bench('moderndash', () => { + bench("moderndash", () => { takeWhile(numArray, (num) => num < 20); - takeWhile(stringArray, (str) => str.includes('a')); + takeWhile(stringArray, (str) => str.includes("a")); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(numArray, (num) => num < 20); - lodashVersion(stringArray, (str) => str.includes('a')); + lodashVersion(stringArray, (str) => str.includes("a")); }); - bench('remeda', () => { + bench("remeda", () => { remedaVersion(numArray, (num) => num < 20); - remedaVersion(stringArray, (str) => str.includes('a')); + remedaVersion(stringArray, (str) => str.includes("a")); }); }); \ No newline at end of file diff --git a/benchmark/array/unique.bench.ts b/benchmark/array/unique.bench.ts index 46759f58..cc207559 100644 --- a/benchmark/array/unique.bench.ts +++ b/benchmark/array/unique.bench.ts @@ -1,31 +1,31 @@ -import { uniq } from 'lodash-es'; -import { unique } from 'moderndash'; -import { unique as uniqueRadash } from 'radash'; -import { uniq as uniqRemeda } from 'remeda'; -import { bench, describe } from 'vitest'; +import { uniq } from "lodash-es"; +import { unique } from "moderndash"; +import { unique as uniqueRadash } from "radash"; +import { uniq as uniqRemeda } from "remeda"; +import { bench, describe } from "vitest"; -import { randomNumberArray, randomStringArray } from '../testData.js'; +import { randomNumberArray, randomStringArray } from "../testData.js"; -describe('unique', () => { - const strings = randomStringArray(100, 'ab'); +describe("unique", () => { + const strings = randomStringArray(100, "ab"); const numbers = randomNumberArray(100, 1, 50); - bench('moderndash', () => { + bench("moderndash", () => { unique(strings); unique(numbers); }); - bench('lodash', () => { + bench("lodash", () => { uniq(strings); uniq(numbers); }); - bench('radash', () => { + bench("radash", () => { uniqueRadash(strings); uniqueRadash(numbers); }); - bench('remeda', () => { + bench("remeda", () => { uniqRemeda(strings); uniqRemeda(numbers); }); diff --git a/benchmark/crypto/hash.bench.ts b/benchmark/crypto/hash.bench.ts index 1de028ea..8bf196e0 100644 --- a/benchmark/crypto/hash.bench.ts +++ b/benchmark/crypto/hash.bench.ts @@ -1,12 +1,12 @@ -import { hash } from 'moderndash'; -import { bench, describe } from 'vitest'; +import { hash } from "moderndash"; +import { bench, describe } from "vitest"; -import { randomObjectArray } from '../testData.js'; +import { randomObjectArray } from "../testData.js"; -describe('hash', () => { +describe("hash", () => { const objArr = randomObjectArray(20); - bench('moderndash', async () => { + bench("moderndash", async () => { for (const obj of objArr) { // eslint-disable-next-line no-await-in-loop await hash(obj); diff --git a/benchmark/crypto/randomInt.bench.ts b/benchmark/crypto/randomInt.bench.ts index 5ef29646..1b8638e8 100644 --- a/benchmark/crypto/randomInt.bench.ts +++ b/benchmark/crypto/randomInt.bench.ts @@ -1,14 +1,14 @@ -import { random } from 'lodash-es'; -import { randomInt } from 'moderndash'; -import { bench, describe } from 'vitest'; +import { random } from "lodash-es"; +import { randomInt } from "moderndash"; +import { bench, describe } from "vitest"; -describe('randomInt', () => { - bench('moderndash', () => { +describe("randomInt", () => { + bench("moderndash", () => { randomInt(1, 10); }); // uses Math.random and is not cryptographically secure but is faster - bench('lodash', () => { + bench("lodash", () => { random(1, 10); }); }); \ No newline at end of file diff --git a/benchmark/number/median.bench.ts b/benchmark/number/median.bench.ts index fc53dd7e..49bbb93f 100644 --- a/benchmark/number/median.bench.ts +++ b/benchmark/number/median.bench.ts @@ -1,22 +1,22 @@ -import { median } from 'moderndash'; -import { median as rambdaVersion } from 'rambda'; -import { bench, describe } from 'vitest'; +import { median } from "moderndash"; +import { median as rambdaVersion } from "rambda"; +import { bench, describe } from "vitest"; -import { randomNumberArray } from '../testData.js'; +import { randomNumberArray } from "../testData.js"; -describe('median', () => { +describe("median", () => { const numbers1 = randomNumberArray(100); const numbers2 = randomNumberArray(80); const numbers3 = randomNumberArray(60); - bench('moderndash', () => { + bench("moderndash", () => { median(numbers1); median(numbers2); median(numbers3); }); - bench('rambda', () => { + bench("rambda", () => { rambdaVersion(numbers1); rambdaVersion(numbers2); rambdaVersion(numbers3); diff --git a/benchmark/object/flatKeys.bench.ts b/benchmark/object/flatKeys.bench.ts index e5d97c7d..5a1c8b2d 100644 --- a/benchmark/object/flatKeys.bench.ts +++ b/benchmark/object/flatKeys.bench.ts @@ -1,15 +1,15 @@ -import { flatKeys } from 'moderndash'; -import { crush as radashVersion } from 'radash'; -import { bench, describe } from 'vitest'; +import { flatKeys } from "moderndash"; +import { crush as radashVersion } from "radash"; +import { bench, describe } from "vitest"; -describe('set', () => { +describe("set", () => { const obj = { a: { b: 2 }, c: { d: 3 }, e: { f: [1, 2] } }; - bench('moderndash', () => { + bench("moderndash", () => { flatKeys(obj); }); - bench('radash', () => { + bench("radash", () => { radashVersion(obj); }); }); diff --git a/benchmark/object/omit.bench.ts b/benchmark/object/omit.bench.ts index d2d09231..98a8716a 100644 --- a/benchmark/object/omit.bench.ts +++ b/benchmark/object/omit.bench.ts @@ -1,38 +1,38 @@ -import { omit as lodashVersion } from 'lodash-es'; -import { omit } from 'moderndash'; -import { omit as radashVersion } from 'radash'; -import { omit as remedaVersion } from 'remeda'; -import { bench, describe } from 'vitest'; +import { omit as lodashVersion } from "lodash-es"; +import { omit } from "moderndash"; +import { omit as radashVersion } from "radash"; +import { omit as remedaVersion } from "remeda"; +import { bench, describe } from "vitest"; -import { randomObjectArray } from '../testData.js'; +import { randomObjectArray } from "../testData.js"; -describe('omit', () => { +describe("omit", () => { const objects = randomObjectArray(50); - const objWithAField = objects.map((obj) => ({ ...obj, a: 'a', b: 'b', c: 'c', d: 'd', e: 'e' })); + const objWithAField = objects.map((obj) => ({ ...obj, a: "a", b: "b", c: "c", d: "d", e: "e" })); - bench('moderndash', () => { + bench("moderndash", () => { for (const obj of objWithAField) { - omit(obj, ['a', 'b', 'c', 'd', 'e']); + omit(obj, ["a", "b", "c", "d", "e"]); } }); - bench('radash', () => { + bench("radash", () => { for (const obj of objWithAField) { - radashVersion(obj, ['a', 'b', 'c', 'd', 'e']); + radashVersion(obj, ["a", "b", "c", "d", "e"]); } }); - bench('lodash', () => { + bench("lodash", () => { for (const obj of objWithAField) { - lodashVersion(obj, ['a', 'b', 'c', 'd', 'e']); + lodashVersion(obj, ["a", "b", "c", "d", "e"]); } }); - bench('remeda', () => { + bench("remeda", () => { for (const obj of objWithAField) { - remedaVersion(obj, ['a', 'b', 'c', 'd', 'e']); + remedaVersion(obj, ["a", "b", "c", "d", "e"]); } }); }); \ No newline at end of file diff --git a/benchmark/object/pick.bench.ts b/benchmark/object/pick.bench.ts index 41fa9f29..044209e3 100644 --- a/benchmark/object/pick.bench.ts +++ b/benchmark/object/pick.bench.ts @@ -1,38 +1,38 @@ -import { pick as lodashVersion } from 'lodash-es'; -import { pick } from 'moderndash'; -import { pick as radashVersion } from 'radash'; -import { pick as remedaVersion } from 'remeda'; -import { bench, describe } from 'vitest'; +import { pick as lodashVersion } from "lodash-es"; +import { pick } from "moderndash"; +import { pick as radashVersion } from "radash"; +import { pick as remedaVersion } from "remeda"; +import { bench, describe } from "vitest"; -import { randomObjectArray } from '../testData.js'; +import { randomObjectArray } from "../testData.js"; -describe('pick', () => { +describe("pick", () => { const objects = randomObjectArray(50); - const objWithAField = objects.map((obj) => ({ ...obj, a: 'a', b: 'b', c: 'c', d: 'd', e: 'e' })); + const objWithAField = objects.map((obj) => ({ ...obj, a: "a", b: "b", c: "c", d: "d", e: "e" })); - bench('moderndash', () => { + bench("moderndash", () => { for (const obj of objWithAField) { - pick(obj, ['a', 'b', 'c', 'd', 'e']); + pick(obj, ["a", "b", "c", "d", "e"]); } }); - bench('radash', () => { + bench("radash", () => { for (const obj of objWithAField) { - radashVersion(obj, ['a', 'b', 'c', 'd', 'e']); + radashVersion(obj, ["a", "b", "c", "d", "e"]); } }); - bench('lodash', () => { + bench("lodash", () => { for (const obj of objWithAField) { - lodashVersion(obj, ['a', 'b', 'c', 'd', 'e']); + lodashVersion(obj, ["a", "b", "c", "d", "e"]); } }); - bench('remeda', () => { + bench("remeda", () => { for (const obj of objWithAField) { - remedaVersion(obj, ['a', 'b', 'c', 'd', 'e']); + remedaVersion(obj, ["a", "b", "c", "d", "e"]); } }); }); \ No newline at end of file diff --git a/benchmark/object/set.bench.ts b/benchmark/object/set.bench.ts index c398c9ac..139211f7 100644 --- a/benchmark/object/set.bench.ts +++ b/benchmark/object/set.bench.ts @@ -1,30 +1,30 @@ -import { set as lodashVersion } from 'lodash-es'; -import { set } from 'moderndash'; -import { set as radashVersion } from 'radash'; -import { bench, describe } from 'vitest'; +import { set as lodashVersion } from "lodash-es"; +import { set } from "moderndash"; +import { set as radashVersion } from "radash"; +import { bench, describe } from "vitest"; -describe('set', () => { - bench('moderndash', () => { +describe("set", () => { + bench("moderndash", () => { const obj = { a: { b: 2 } }; - set(obj, 'a.c[3].d', 'test'); - set(obj, 'a.c[3].f', 'test3'); - set(obj, 'a.c[3].f', 'test5'); - set(obj, 'a.c[3].g.a', 'test7'); + set(obj, "a.c[3].d", "test"); + set(obj, "a.c[3].f", "test3"); + set(obj, "a.c[3].f", "test5"); + set(obj, "a.c[3].g.a", "test7"); }); - bench('radash', () => { + bench("radash", () => { const obj = { a: { b: 2 } }; - radashVersion(obj, 'a.c[3].d', 'test'); - radashVersion(obj, 'a.c[3].f', 'test3'); - radashVersion(obj, 'a.c[3].f', 'test5'); - radashVersion(obj, 'a.c[3].g.a', 'test7'); + radashVersion(obj, "a.c[3].d", "test"); + radashVersion(obj, "a.c[3].f", "test3"); + radashVersion(obj, "a.c[3].f", "test5"); + radashVersion(obj, "a.c[3].g.a", "test7"); }); - bench('lodash', () => { + bench("lodash", () => { const obj = { a: { b: 2 } }; - lodashVersion(obj, 'a.c[3].d', 'test'); - lodashVersion(obj, 'a.c[3].f', 'test3'); - lodashVersion(obj, 'a.c[3].f', 'test5'); - lodashVersion(obj, 'a.c[3].g.a', 'test7'); + lodashVersion(obj, "a.c[3].d", "test"); + lodashVersion(obj, "a.c[3].f", "test3"); + lodashVersion(obj, "a.c[3].f", "test5"); + lodashVersion(obj, "a.c[3].g.a", "test7"); }); }); diff --git a/benchmark/string/camelCase.bench.ts b/benchmark/string/camelCase.bench.ts index 19a4d0ac..dfcbd794 100644 --- a/benchmark/string/camelCase.bench.ts +++ b/benchmark/string/camelCase.bench.ts @@ -1,26 +1,26 @@ -import { camelCase as lodashVersion } from 'lodash-es'; -import { camelCase } from 'moderndash'; -import { camel as radashVersion } from 'radash'; -import { bench, describe } from 'vitest'; +import { camelCase as lodashVersion } from "lodash-es"; +import { camelCase } from "moderndash"; +import { camel as radashVersion } from "radash"; +import { bench, describe } from "vitest"; -import { randomStringArray } from '../testData.js'; +import { randomStringArray } from "../testData.js"; -describe('camelCase', () => { +describe("camelCase", () => { const stringArray = randomStringArray(200); - bench('moderndash', () => { + bench("moderndash", () => { for (const str of stringArray) { camelCase(str); } }); - bench('lodash', () => { + bench("lodash", () => { for (const str of stringArray) { lodashVersion(str); } }); - bench('radash', () => { + bench("radash", () => { for (const str of stringArray) { radashVersion(str); } diff --git a/benchmark/string/deburr.bench.ts b/benchmark/string/deburr.bench.ts index 8b8f3493..71fece8b 100644 --- a/benchmark/string/deburr.bench.ts +++ b/benchmark/string/deburr.bench.ts @@ -1,19 +1,19 @@ -import { deburr as lodashVersion } from 'lodash-es'; -import { deburr } from 'moderndash'; -import { bench, describe } from 'vitest'; +import { deburr as lodashVersion } from "lodash-es"; +import { deburr } from "moderndash"; +import { bench, describe } from "vitest"; -import { randomStringArray } from '../testData.js'; +import { randomStringArray } from "../testData.js"; -describe('deburr', () => { - const strings = randomStringArray(100, 'avdasfaáäæÅèÊ'); +describe("deburr", () => { + const strings = randomStringArray(100, "avdasfaáäæÅèÊ"); - bench('moderndash', () => { + bench("moderndash", () => { for (const str of strings) { deburr(str); } }); - bench('lodash', () => { + bench("lodash", () => { for (const str of strings) { lodashVersion(str); } diff --git a/benchmark/string/kebabCase.bench.ts b/benchmark/string/kebabCase.bench.ts index 1a79a986..5830ef95 100644 --- a/benchmark/string/kebabCase.bench.ts +++ b/benchmark/string/kebabCase.bench.ts @@ -1,26 +1,26 @@ -import { kebabCase as lodashVersion } from 'lodash-es'; -import { kebabCase } from 'moderndash'; -import { dash as radashVersion } from 'radash'; -import { bench, describe } from 'vitest'; +import { kebabCase as lodashVersion } from "lodash-es"; +import { kebabCase } from "moderndash"; +import { dash as radashVersion } from "radash"; +import { bench, describe } from "vitest"; -import { randomStringArray } from '../testData.js'; +import { randomStringArray } from "../testData.js"; -describe('kebabCase', () => { +describe("kebabCase", () => { const stringArray = randomStringArray(200); - bench('moderndash', () => { + bench("moderndash", () => { for (const str of stringArray) { kebabCase(str); } }); - bench('lodash', () => { + bench("lodash", () => { for (const str of stringArray) { lodashVersion(str); } }); - bench('radash', () => { + bench("radash", () => { for (const str of stringArray) { radashVersion(str); } diff --git a/benchmark/string/titleCase.bench.ts b/benchmark/string/titleCase.bench.ts index b9723c4a..e1ff35c2 100644 --- a/benchmark/string/titleCase.bench.ts +++ b/benchmark/string/titleCase.bench.ts @@ -1,26 +1,26 @@ -import { startCase as lodashVersion } from 'lodash-es'; -import { titleCase } from 'moderndash'; -import { title as radashVersion } from 'radash'; -import { bench, describe } from 'vitest'; +import { startCase as lodashVersion } from "lodash-es"; +import { titleCase } from "moderndash"; +import { title as radashVersion } from "radash"; +import { bench, describe } from "vitest"; -import { randomStringArray } from '../testData.js'; +import { randomStringArray } from "../testData.js"; -describe('titleCase', () => { +describe("titleCase", () => { const stringArray = randomStringArray(200); - bench('moderndash', () => { + bench("moderndash", () => { for (const str of stringArray) { titleCase(str); } }); - bench('lodash', () => { + bench("lodash", () => { for (const str of stringArray) { lodashVersion(str); } }); - bench('radash', () => { + bench("radash", () => { for (const str of stringArray) { radashVersion(str); } diff --git a/benchmark/testData.ts b/benchmark/testData.ts index 89bbc2ab..c604b534 100644 --- a/benchmark/testData.ts +++ b/benchmark/testData.ts @@ -1,4 +1,4 @@ -import { randomInt, randomString } from 'moderndash'; +import { randomInt, randomString } from "moderndash"; type RandomObject = Record; @@ -6,7 +6,7 @@ export function randomObject(fieldCount: number, allowNested = true): RandomObje const generatedObj = {} as RandomObject; for (let i = 0; i < fieldCount; i++) { - let generatedObjField: object | number | string | boolean = ''; + let generatedObjField: object | number | string | boolean = ""; switch (randomInt(0, allowNested ? 5 : 4)) { case 0: diff --git a/benchmark/validate/isEmpty.bench.ts b/benchmark/validate/isEmpty.bench.ts index 5a1817cd..0deaa646 100644 --- a/benchmark/validate/isEmpty.bench.ts +++ b/benchmark/validate/isEmpty.bench.ts @@ -1,25 +1,25 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ -import { isEmpty as lodashVersion } from 'lodash-es'; -import { isEmpty } from 'moderndash'; -import { isEmpty as radashVersion } from 'radash'; -import { bench, describe } from 'vitest'; +import { isEmpty as lodashVersion } from "lodash-es"; +import { isEmpty } from "moderndash"; +import { isEmpty as radashVersion } from "radash"; +import { bench, describe } from "vitest"; -import { randomObject } from '../testData.js'; +import { randomObject } from "../testData.js"; -describe('isEmpty', () => { - const object = { 'a': 1, 'b': 2, 'c': 3, 'd': [1, 2, 3] }; +describe("isEmpty", () => { + const object = { "a": 1, "b": 2, "c": 3, "d": [1, 2, 3] }; const emptyObj = {}; const set = new Set([1, 2, 3, 4]); const emtpySet = new Set(); - const map = new Map([['a', 1], ['b', 2], ['c', 3], ['d', 4]]); + const map = new Map([["a", 1], ["b", 2], ["c", 3], ["d", 4]]); const emptyMap = new Map(); const bigObject = randomObject(6, true); - bench('moderndash', () => { + bench("moderndash", () => { isEmpty(object); isEmpty(emptyObj); isEmpty(set); @@ -29,7 +29,7 @@ describe('isEmpty', () => { isEmpty(bigObject); }); - bench('lodash', () => { + bench("lodash", () => { lodashVersion(object); lodashVersion(emptyObj); lodashVersion(set); @@ -39,7 +39,7 @@ describe('isEmpty', () => { lodashVersion(bigObject); }); - bench('radash', () => { + bench("radash", () => { radashVersion(object); radashVersion(emptyObj); radashVersion(set); diff --git a/benchmark/validate/isEqual.bench.ts b/benchmark/validate/isEqual.bench.ts index 6f44cfa5..ef9ae89f 100644 --- a/benchmark/validate/isEqual.bench.ts +++ b/benchmark/validate/isEqual.bench.ts @@ -1,14 +1,14 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ -import { isEqual as equalLodash } from 'lodash-es'; -import { isEqual } from 'moderndash'; -import { isEqual as equalRadash } from 'radash'; -import { equals as equalRemeda } from 'remeda'; -import { bench, describe } from 'vitest'; +import { isEqual as equalLodash } from "lodash-es"; +import { isEqual } from "moderndash"; +import { isEqual as equalRadash } from "radash"; +import { equals as equalRemeda } from "remeda"; +import { bench, describe } from "vitest"; -describe('isEqual', () => { - const object = { 'a': 1, 'b': 2, 'c': 3, 'd': [1, 2, 3] }; - const other = { 'a': 1, 'b': 2, 'c': 3, 'd': [1, 2, 4] }; +describe("isEqual", () => { + const object = { "a": 1, "b": 2, "c": 3, "d": [1, 2, 3] }; + const other = { "a": 1, "b": 2, "c": 3, "d": [1, 2, 4] }; const same = structuredClone(object); const set = new Set([1, 2, 3, 4]); @@ -16,11 +16,11 @@ describe('isEqual', () => { const otherSet = new Set([1, 2, 3, 5]); // Try object with regex/map/date - const complex = { 'a': 1, 'b': 2, 'c': 3, 'd': [1, 2, 3], 'e': /abc/, 'f': new Map(), 'g': new Date(1) }; - const sameComplex = { 'a': 1, 'b': 2, 'c': 3, 'd': [1, 2, 3], 'e': /abc/, 'f': new Map(), 'g': new Date(1) }; - const otherComplex = { 'a': 1, 'b': 2, 'c': 3, 'd': [1, 2, 3], 'e': /abc/, 'f': new Map(), 'g': new Date(3) }; + const complex = { "a": 1, "b": 2, "c": 3, "d": [1, 2, 3], "e": /abc/, "f": new Map(), "g": new Date(1) }; + const sameComplex = { "a": 1, "b": 2, "c": 3, "d": [1, 2, 3], "e": /abc/, "f": new Map(), "g": new Date(1) }; + const otherComplex = { "a": 1, "b": 2, "c": 3, "d": [1, 2, 3], "e": /abc/, "f": new Map(), "g": new Date(3) }; - bench('moderndash', () => { + bench("moderndash", () => { isEqual(object, other); isEqual(object, same); @@ -31,7 +31,7 @@ describe('isEqual', () => { isEqual(set, sameSet); }); - bench('lodash', () => { + bench("lodash", () => { equalLodash(object, other); equalLodash(object, same); @@ -42,7 +42,7 @@ describe('isEqual', () => { equalLodash(set, sameSet); }); - bench('radash', () => { + bench("radash", () => { equalRadash(object, other); equalRadash(object, same); @@ -53,7 +53,7 @@ describe('isEqual', () => { equalRadash(set, sameSet); }); - bench('remeda', () => { + bench("remeda", () => { equalRemeda(object, other); equalRemeda(object, same); diff --git a/benchmark/vitest.config.ts b/benchmark/vitest.config.ts index cb574355..bd20e563 100644 --- a/benchmark/vitest.config.ts +++ b/benchmark/vitest.config.ts @@ -1,10 +1,10 @@ -import { defineConfig } from 'vite'; +import { defineConfig } from "vite"; export default defineConfig({ test: { deps: { - inline: ['lodash-es'] + inline: ["lodash-es"] } } }); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 167f6bc7..d97d409f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,23 +13,15 @@ "devDependencies": { "@changesets/cli": "2.26.1", "@svitejs/changesets-changelog-github-compact": "1.1.0", - "@typescript-eslint/eslint-plugin": "5.56.0", - "@typescript-eslint/parser": "5.56.0", - "@vitest/coverage-c8": "0.29.7", - "@vitest/ui": "0.29.7", - "eslint": "8.36.0", - "eslint-import-resolver-typescript": "3.5.3", - "eslint-plugin-compat": "4.1.2", - "eslint-plugin-deprecate": "0.7.0", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-sonarjs": "0.19.0", - "eslint-plugin-svelte": "2.23.1", - "eslint-plugin-unicorn": "46.0.0", + "@vitest/coverage-c8": "0.29.8", + "@vitest/ui": "0.29.8", + "eslint": "8.37.0", + "eslint-config-dewald": "1.0.8", "hotscript": "1.0.11", "typedoc": "0.23.28", - "typescript": "5.0.2", + "typescript": "5.0.3", "vite": "4.2.1", - "vitest": "0.29.7" + "vitest": "0.29.8" }, "engines": { "node": ">=19.x.x", @@ -48,9 +40,9 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", + "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", "dev": true, "dependencies": { "@babel/highlight": "^7.18.6" @@ -339,9 +331,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.14.tgz", - "integrity": "sha512-0CnlwnjDU8cks0yJLXfkaU/uoLyRf9VZJs4p1PskBr2AlAHeEsFEwJEo0of/Z3g+ilw5mpyDwThlxzNEIxOE4g==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.15.tgz", + "integrity": "sha512-sRSOVlLawAktpMvDyJIkdLI/c/kdRTOqo8t6ImVxg8yT7LQDUYV5Rp2FKeEosLr6ZCja9UjYAzyRSxGteSJPYg==", "cpu": [ "arm" ], @@ -355,9 +347,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.14.tgz", - "integrity": "sha512-eLOpPO1RvtsP71afiFTvS7tVFShJBCT0txiv/xjFBo5a7R7Gjw7X0IgIaFoLKhqXYAXhahoXm7qAmRXhY4guJg==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.15.tgz", + "integrity": "sha512-0kOB6Y7Br3KDVgHeg8PRcvfLkq+AccreK///B4Z6fNZGr/tNHX0z2VywCc7PTeWp+bPvjA5WMvNXltHw5QjAIA==", "cpu": [ "arm64" ], @@ -371,9 +363,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.14.tgz", - "integrity": "sha512-nrfQYWBfLGfSGLvRVlt6xi63B5IbfHm3tZCdu/82zuFPQ7zez4XjmRtF/wIRYbJQ/DsZrxJdEvYFE67avYXyng==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.15.tgz", + "integrity": "sha512-MzDqnNajQZ63YkaUWVl9uuhcWyEyh69HGpMIrf+acR4otMkfLJ4sUCxqwbCyPGicE9dVlrysI3lMcDBjGiBBcQ==", "cpu": [ "x64" ], @@ -387,9 +379,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.14.tgz", - "integrity": "sha512-eoSjEuDsU1ROwgBH/c+fZzuSyJUVXQTOIN9xuLs9dE/9HbV/A5IqdXHU1p2OfIMwBwOYJ9SFVGGldxeRCUJFyw==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.15.tgz", + "integrity": "sha512-7siLjBc88Z4+6qkMDxPT2juf2e8SJxmsbNVKFY2ifWCDT72v5YJz9arlvBw5oB4W/e61H1+HDB/jnu8nNg0rLA==", "cpu": [ "arm64" ], @@ -403,9 +395,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.14.tgz", - "integrity": "sha512-zN0U8RWfrDttdFNkHqFYZtOH8hdi22z0pFm0aIJPsNC4QQZv7je8DWCX5iA4Zx6tRhS0CCc0XC2m7wKsbWEo5g==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.15.tgz", + "integrity": "sha512-NbImBas2rXwYI52BOKTW342Tm3LTeVlaOQ4QPZ7XuWNKiO226DisFk/RyPk3T0CKZkKMuU69yOvlapJEmax7cg==", "cpu": [ "x64" ], @@ -419,9 +411,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.14.tgz", - "integrity": "sha512-z0VcD4ibeZWVQCW1O7szaLxGsx54gcCnajEJMdYoYjLiq4g1jrP2lMq6pk71dbS5+7op/L2Aod+erw+EUr28/A==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.15.tgz", + "integrity": "sha512-Xk9xMDjBVG6CfgoqlVczHAdJnCs0/oeFOspFap5NkYAmRCT2qTn1vJWA2f419iMtsHSLm+O8B6SLV/HlY5cYKg==", "cpu": [ "arm64" ], @@ -435,9 +427,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.14.tgz", - "integrity": "sha512-hd9mPcxfTgJlolrPlcXkQk9BMwNBvNBsVaUe5eNUqXut6weDQH8whcNaKNF2RO8NbpT6GY8rHOK2A9y++s+ehw==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.15.tgz", + "integrity": "sha512-3TWAnnEOdclvb2pnfsTWtdwthPfOz7qAfcwDLcfZyGJwm1SRZIMOeB5FODVhnM93mFSPsHB9b/PmxNNbSnd0RQ==", "cpu": [ "x64" ], @@ -451,9 +443,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.14.tgz", - "integrity": "sha512-BNTl+wSJ1omsH8s3TkQmIIIQHwvwJrU9u1ggb9XU2KTVM4TmthRIVyxSp2qxROJHhZuW/r8fht46/QE8hU8Qvg==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.15.tgz", + "integrity": "sha512-MLTgiXWEMAMr8nmS9Gigx43zPRmEfeBfGCwxFQEMgJ5MC53QKajaclW6XDPjwJvhbebv+RzK05TQjvH3/aM4Xw==", "cpu": [ "arm" ], @@ -467,9 +459,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.14.tgz", - "integrity": "sha512-FhAMNYOq3Iblcj9i+K0l1Fp/MHt+zBeRu/Qkf0LtrcFu3T45jcwB6A1iMsemQ42vR3GBhjNZJZTaCe3VFPbn9g==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.15.tgz", + "integrity": "sha512-T0MVnYw9KT6b83/SqyznTs/3Jg2ODWrZfNccg11XjDehIved2oQfrX/wVuev9N936BpMRaTR9I1J0tdGgUgpJA==", "cpu": [ "arm64" ], @@ -483,9 +475,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.14.tgz", - "integrity": "sha512-91OK/lQ5y2v7AsmnFT+0EyxdPTNhov3y2CWMdizyMfxSxRqHazXdzgBKtlmkU2KYIc+9ZK3Vwp2KyXogEATYxQ==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.15.tgz", + "integrity": "sha512-wp02sHs015T23zsQtU4Cj57WiteiuASHlD7rXjKUyAGYzlOKDAjqK6bk5dMi2QEl/KVOcsjwL36kD+WW7vJt8Q==", "cpu": [ "ia32" ], @@ -499,9 +491,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.14.tgz", - "integrity": "sha512-vp15H+5NR6hubNgMluqqKza85HcGJgq7t6rMH7O3Y6ApiOWPkvW2AJfNojUQimfTp6OUrACUXfR4hmpcENXoMQ==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.15.tgz", + "integrity": "sha512-k7FsUJjGGSxwnBmMh8d7IbObWu+sF/qbwc+xKZkBe/lTAF16RqxRCnNHA7QTd3oS2AfGBAnHlXL67shV5bBThQ==", "cpu": [ "loong64" ], @@ -515,9 +507,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.14.tgz", - "integrity": "sha512-90TOdFV7N+fgi6c2+GO9ochEkmm9kBAKnuD5e08GQMgMINOdOFHuYLPQ91RYVrnWwQ5683sJKuLi9l4SsbJ7Hg==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.15.tgz", + "integrity": "sha512-ZLWk6czDdog+Q9kE/Jfbilu24vEe/iW/Sj2d8EVsmiixQ1rM2RKH2n36qfxK4e8tVcaXkvuV3mU5zTZviE+NVQ==", "cpu": [ "mips64el" ], @@ -531,9 +523,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.14.tgz", - "integrity": "sha512-NnBGeoqKkTugpBOBZZoktQQ1Yqb7aHKmHxsw43NddPB2YWLAlpb7THZIzsRsTr0Xw3nqiPxbA1H31ZMOG+VVPQ==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.15.tgz", + "integrity": "sha512-mY6dPkIRAiFHRsGfOYZC8Q9rmr8vOBZBme0/j15zFUKM99d4ILY4WpOC7i/LqoY+RE7KaMaSfvY8CqjJtuO4xg==", "cpu": [ "ppc64" ], @@ -547,9 +539,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.14.tgz", - "integrity": "sha512-0qdlKScLXA8MGVy21JUKvMzCYWovctuP8KKqhtE5A6IVPq4onxXhSuhwDd2g5sRCzNDlDjitc5sX31BzDoL5Fw==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.15.tgz", + "integrity": "sha512-EcyUtxffdDtWjjwIH8sKzpDRLcVtqANooMNASO59y+xmqqRYBBM7xVLQhqF7nksIbm2yHABptoioS9RAbVMWVA==", "cpu": [ "riscv64" ], @@ -563,9 +555,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.14.tgz", - "integrity": "sha512-Hdm2Jo1yaaOro4v3+6/zJk6ygCqIZuSDJHdHaf8nVH/tfOuoEX5Riv03Ka15LmQBYJObUTNS1UdyoMk0WUn9Ww==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.15.tgz", + "integrity": "sha512-BuS6Jx/ezxFuHxgsfvz7T4g4YlVrmCmg7UAwboeyNNg0OzNzKsIZXpr3Sb/ZREDXWgt48RO4UQRDBxJN3B9Rbg==", "cpu": [ "s390x" ], @@ -579,9 +571,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.14.tgz", - "integrity": "sha512-8KHF17OstlK4DuzeF/KmSgzrTWQrkWj5boluiiq7kvJCiQVzUrmSkaBvcLB2UgHpKENO2i6BthPkmUhNDaJsVw==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.15.tgz", + "integrity": "sha512-JsdS0EgEViwuKsw5tiJQo9UdQdUJYuB+Mf6HxtJSPN35vez1hlrNb1KajvKWF5Sa35j17+rW1ECEO9iNrIXbNg==", "cpu": [ "x64" ], @@ -595,9 +587,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.14.tgz", - "integrity": "sha512-nVwpqvb3yyXztxIT2+VsxJhB5GCgzPdk1n0HHSnchRAcxqKO6ghXwHhJnr0j/B+5FSyEqSxF4q03rbA2fKXtUQ==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.15.tgz", + "integrity": "sha512-R6fKjtUysYGym6uXf6qyNephVUQAGtf3n2RCsOST/neIwPqRWcnc3ogcielOd6pT+J0RDR1RGcy0ZY7d3uHVLA==", "cpu": [ "x64" ], @@ -611,9 +603,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.14.tgz", - "integrity": "sha512-1RZ7uQQ9zcy/GSAJL1xPdN7NDdOOtNEGiJalg/MOzeakZeTrgH/DoCkbq7TaPDiPhWqnDF+4bnydxRqQD7il6g==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.15.tgz", + "integrity": "sha512-mVD4PGc26b8PI60QaPUltYKeSX0wxuy0AltC+WCTFwvKCq2+OgLP4+fFd+hZXzO2xW1HPKcytZBdjqL6FQFa7w==", "cpu": [ "x64" ], @@ -627,9 +619,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.14.tgz", - "integrity": "sha512-nqMjDsFwv7vp7msrwWRysnM38Sd44PKmW8EzV01YzDBTcTWUpczQg6mGao9VLicXSgW/iookNK6AxeogNVNDZA==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.15.tgz", + "integrity": "sha512-U6tYPovOkw3459t2CBwGcFYfFRjivcJJc1WC8Q3funIwX8x4fP+R6xL/QuTPNGOblbq/EUDxj9GU+dWKX0oWlQ==", "cpu": [ "x64" ], @@ -643,9 +635,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.14.tgz", - "integrity": "sha512-xrD0mccTKRBBIotrITV7WVQAwNJ5+1va6L0H9zN92v2yEdjfAN7864cUaZwJS7JPEs53bDTzKFbfqVlG2HhyKQ==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.15.tgz", + "integrity": "sha512-W+Z5F++wgKAleDABemiyXVnzXgvRFs+GVKThSI+mGgleLWluv0D7Diz4oQpgdpNzh4i2nNDzQtWbjJiqutRp6Q==", "cpu": [ "arm64" ], @@ -659,9 +651,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.14.tgz", - "integrity": "sha512-nXpkz9bbJrLLyUTYtRotSS3t5b+FOuljg8LgLdINWFs3FfqZMtbnBCZFUmBzQPyxqU87F8Av+3Nco/M3hEcu1w==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.15.tgz", + "integrity": "sha512-Muz/+uGgheShKGqSVS1KsHtCyEzcdOn/W/Xbh6H91Etm+wiIfwZaBn1W58MeGtfI8WA961YMHFYTthBdQs4t+w==", "cpu": [ "ia32" ], @@ -675,9 +667,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.14.tgz", - "integrity": "sha512-gPQmsi2DKTaEgG14hc3CHXHp62k8g6qr0Pas+I4lUxRMugGSATh/Bi8Dgusoz9IQ0IfdrvLpco6kujEIBoaogA==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.15.tgz", + "integrity": "sha512-DjDa9ywLUUmjhV2Y9wUTIF+1XsmuFGvZoCmOWkli1XcNAh5t25cc7fgsCx4Zi/Uurep3TTLyDiKATgGEg61pkA==", "cpu": [ "x64" ], @@ -706,23 +698,23 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.1.tgz", - "integrity": "sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.0.tgz", + "integrity": "sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.1.tgz", - "integrity": "sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.2.tgz", + "integrity": "sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.0", + "espree": "^9.5.1", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -756,9 +748,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.36.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.36.0.tgz", - "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==", + "version": "8.37.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.37.0.tgz", + "integrity": "sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -958,10 +950,11 @@ } }, "node_modules/@mdn/browser-compat-data": { - "version": "5.2.45", - "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.2.45.tgz", - "integrity": "sha512-Er03EjYAx3TTMvdBdm6Z3SG4IV0/FWfRJP4CBNtRLWoPVVyp9BdYt/9X4zSFw4GAIOVx6+6r7d8VAw0sbPtMjg==", - "dev": true + "version": "5.2.48", + "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.2.48.tgz", + "integrity": "sha512-D5cAp2r0Eq9yN4lBNkVpHzoULHYeCQjLFF7PbD/LBBCuWXPIB4X3rbi12REvaCnEar/0UiSSfjIMWxFAw0vIJg==", + "dev": true, + "peer": true }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -1051,6 +1044,7 @@ "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.1.tgz", "integrity": "sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==", "dev": true, + "peer": true, "dependencies": { "cross-spawn": "^7.0.3", "is-glob": "^4.0.3", @@ -1129,15 +1123,15 @@ } }, "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.0.3.tgz", - "integrity": "sha512-o+cguBFdwIGtRbNkYOyqTM7KvRUffxh5bfK4oJsWKG2obu+v/cbpT03tJrGl58C7tRXo/aEC0/axN5FVHBj0nA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.0.4.tgz", + "integrity": "sha512-pjqhW00KwK2uzDGEr+yJBwut+D+4XfJO/+bHHdHzPRXn9+1Jeq5JcFHyrUiYaXgHtyhX0RsllCTm4ssAx4ZY7Q==", "dev": true, "dependencies": { "debug": "^4.3.4", - "deepmerge": "^4.3.0", + "deepmerge": "^4.3.1", "kleur": "^4.1.5", - "magic-string": "^0.29.0", + "magic-string": "^0.30.0", "svelte-hmr": "^0.15.1", "vitefu": "^0.2.4" }, @@ -1149,18 +1143,6 @@ "vite": "^4.0.0" } }, - "node_modules/@sveltejs/vite-plugin-svelte/node_modules/magic-string": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.29.0.tgz", - "integrity": "sha512-WcfidHrDjMY+eLjlU+8OvwREqHwpgCeKVBUpQ3OhYYuvfaYCUgcbuBzappNzZvg/v8onU3oQj+BYpkOJe9Iw4Q==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.13" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@svitejs/changesets-changelog-github-compact": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@svitejs/changesets-changelog-github-compact/-/changesets-changelog-github-compact-1.1.0.tgz", @@ -1271,18 +1253,20 @@ "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/lodash": { - "version": "4.14.191", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.191.tgz", - "integrity": "sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ==", + "version": "4.14.192", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.192.tgz", + "integrity": "sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==", "dev": true }, "node_modules/@types/lodash-es": { @@ -1307,9 +1291,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.15.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.10.tgz", - "integrity": "sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ==", + "version": "18.15.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", + "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -1331,15 +1315,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.56.0.tgz", - "integrity": "sha512-ZNW37Ccl3oMZkzxrYDUX4o7cnuPgU+YrcaYXzsRtLB16I1FR5SHMqga3zGsaSliZADCWo2v8qHWqAYIj8nWCCg==", + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.0.tgz", + "integrity": "sha512-itag0qpN6q2UMM6Xgk6xoHa0D0/P+M17THnr4SVgqn9Rgam5k/He33MA7/D7QoJcdMxHFyX7U9imaBonAX/6qA==", "dev": true, + "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/type-utils": "5.56.0", - "@typescript-eslint/utils": "5.56.0", + "@typescript-eslint/scope-manager": "5.57.0", + "@typescript-eslint/type-utils": "5.57.0", + "@typescript-eslint/utils": "5.57.0", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -1369,6 +1354,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, + "peer": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -1380,14 +1366,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.56.0.tgz", - "integrity": "sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg==", + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.57.0.tgz", + "integrity": "sha512-orrduvpWYkgLCyAdNtR1QIWovcNZlEm6yL8nwH/eTxWLd8gsP+25pdLHYzL2QdkqrieaDwLpytHqycncv0woUQ==", "dev": true, + "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/typescript-estree": "5.56.0", + "@typescript-eslint/scope-manager": "5.57.0", + "@typescript-eslint/types": "5.57.0", + "@typescript-eslint/typescript-estree": "5.57.0", "debug": "^4.3.4" }, "engines": { @@ -1407,13 +1394,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz", - "integrity": "sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw==", + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.0.tgz", + "integrity": "sha512-NANBNOQvllPlizl9LatX8+MHi7bx7WGIWYjPHDmQe5Si/0YEYfxSljJpoTyTWFTgRy3X8gLYSE4xQ2U+aCozSw==", "dev": true, + "peer": true, "dependencies": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0" + "@typescript-eslint/types": "5.57.0", + "@typescript-eslint/visitor-keys": "5.57.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1424,13 +1412,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.56.0.tgz", - "integrity": "sha512-8WxgOgJjWRy6m4xg9KoSHPzBNZeQbGlQOH7l2QEhQID/+YseaFxg5J/DLwWSsi9Axj4e/cCiKx7PVzOq38tY4A==", + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.57.0.tgz", + "integrity": "sha512-kxXoq9zOTbvqzLbdNKy1yFrxLC6GDJFE2Yuo3KqSwTmDOFjUGeWSakgoXT864WcK5/NAJkkONCiKb1ddsqhLXQ==", "dev": true, + "peer": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.56.0", - "@typescript-eslint/utils": "5.56.0", + "@typescript-eslint/typescript-estree": "5.57.0", + "@typescript-eslint/utils": "5.57.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -1451,10 +1440,11 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.56.0.tgz", - "integrity": "sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w==", + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.0.tgz", + "integrity": "sha512-mxsod+aZRSyLT+jiqHw1KK6xrANm19/+VFALVFP5qa/aiJnlP38qpyaTd0fEKhWvQk6YeNZ5LGwI1pDpBRBhtQ==", "dev": true, + "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -1464,13 +1454,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz", - "integrity": "sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==", + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.0.tgz", + "integrity": "sha512-LTzQ23TV82KpO8HPnWuxM2V7ieXW8O142I7hQTxWIHDcCEIjtkat6H96PFkYBQqGFLW/G/eVVOB9Z8rcvdY/Vw==", "dev": true, + "peer": true, "dependencies": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0", + "@typescript-eslint/types": "5.57.0", + "@typescript-eslint/visitor-keys": "5.57.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1495,6 +1486,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, + "peer": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -1506,17 +1498,18 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.56.0.tgz", - "integrity": "sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA==", + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.57.0.tgz", + "integrity": "sha512-ps/4WohXV7C+LTSgAL5CApxvxbMkl9B9AUZRtnEFonpIxZDIT7wC1xfvuJONMidrkB9scs4zhtRyIwHh4+18kw==", "dev": true, + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/typescript-estree": "5.56.0", + "@typescript-eslint/scope-manager": "5.57.0", + "@typescript-eslint/types": "5.57.0", + "@typescript-eslint/typescript-estree": "5.57.0", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -1535,13 +1528,15 @@ "version": "7.3.13", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@typescript-eslint/utils/node_modules/semver": { "version": "7.3.8", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, + "peer": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -1553,12 +1548,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz", - "integrity": "sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q==", + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.0.tgz", + "integrity": "sha512-ery2g3k0hv5BLiKpPuwYt9KBkAp2ugT6VvyShXdLOkax895EC55sP0Tx5L0fZaQueiK3fBLvHVvEl3jFS5ia+g==", "dev": true, + "peer": true, "dependencies": { - "@typescript-eslint/types": "5.56.0", + "@typescript-eslint/types": "5.57.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1570,9 +1566,9 @@ } }, "node_modules/@vitest/coverage-c8": { - "version": "0.29.7", - "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.29.7.tgz", - "integrity": "sha512-TSubtP9JFBuI/wuApxwknHe40VDkX8hFbBak0OXj4/jCeXrEu5B5GPWcxzyk9YvzXgCaDvoiZV79I7AvhNI9YQ==", + "version": "0.29.8", + "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.29.8.tgz", + "integrity": "sha512-y+sEMQMctWokjnSqm3FCQEYFkjLrYaznsxEZHxcx8z2aftpYg3A5tvI1S5himfdEFo7o+OeHzh40bPSWZHW4oQ==", "dev": true, "dependencies": { "c8": "^7.13.0", @@ -1587,23 +1583,23 @@ } }, "node_modules/@vitest/expect": { - "version": "0.29.7", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.29.7.tgz", - "integrity": "sha512-UtG0tW0DP6b3N8aw7PHmweKDsvPv4wjGvrVZW7OSxaFg76ShtVdMiMcUkZJgCE8QWUmhwaM0aQhbbVLo4F4pkA==", + "version": "0.29.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.29.8.tgz", + "integrity": "sha512-xlcVXn5I5oTq6NiZSY3ykyWixBxr5mG8HYtjvpgg6KaqHm0mvhX18xuwl5YGxIRNt/A5jidd7CWcNHrSvgaQqQ==", "dev": true, "dependencies": { - "@vitest/spy": "0.29.7", - "@vitest/utils": "0.29.7", + "@vitest/spy": "0.29.8", + "@vitest/utils": "0.29.8", "chai": "^4.3.7" } }, "node_modules/@vitest/runner": { - "version": "0.29.7", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.29.7.tgz", - "integrity": "sha512-Yt0+csM945+odOx4rjZSjibQfl2ymxqVsmYz6sO2fiO5RGPYDFCo60JF6tLL9pz4G/kjY4irUxadeB1XT+H1jg==", + "version": "0.29.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.29.8.tgz", + "integrity": "sha512-FzdhnRDwEr/A3Oo1jtIk/B952BBvP32n1ObMEb23oEJNO+qO5cBet6M2XWIDQmA7BDKGKvmhUf2naXyp/2JEwQ==", "dev": true, "dependencies": { - "@vitest/utils": "0.29.7", + "@vitest/utils": "0.29.8", "p-limit": "^4.0.0", "pathe": "^1.1.0" } @@ -1624,18 +1620,18 @@ } }, "node_modules/@vitest/spy": { - "version": "0.29.7", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.29.7.tgz", - "integrity": "sha512-IalL0iO6A6Xz8hthR8sctk6ZS//zVBX48EiNwQguYACdgdei9ZhwMaBFV70mpmeYAFCRAm+DpoFHM5470Im78A==", + "version": "0.29.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.29.8.tgz", + "integrity": "sha512-VdjBe9w34vOMl5I5mYEzNX8inTxrZ+tYUVk9jxaZJmHFwmDFC/GV3KBFTA/JKswr3XHvZL+FE/yq5EVhb6pSAw==", "dev": true, "dependencies": { "tinyspy": "^1.0.2" } }, "node_modules/@vitest/ui": { - "version": "0.29.7", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.29.7.tgz", - "integrity": "sha512-KeOztcAldlFU5i8DKCQcmGrih1dVowurZy/9iPz5JyQdPJzej+nW1nI4nYvc4ZmUtA8+IAe9uViqnU7IXc1RNw==", + "version": "0.29.8", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.29.8.tgz", + "integrity": "sha512-+vbLd+c1R/XUWfzJsWeyjeiw13fwJ95I5tguxaqXRg61y9iYUKesVljg7Pttp2uo7VK+kAjvY91J41NZ1Vx3vg==", "dev": true, "dependencies": { "fast-glob": "^3.2.12", @@ -1646,9 +1642,9 @@ } }, "node_modules/@vitest/utils": { - "version": "0.29.7", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.29.7.tgz", - "integrity": "sha512-vNgGadp2eE5XKCXtZXL5UyNEDn68npSct75OC9AlELenSK0DiV1Mb9tfkwJHKjRb69iek+e79iipoJx8+s3SdA==", + "version": "0.29.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.29.8.tgz", + "integrity": "sha512-qGzuf3vrTbnoY+RjjVVIBYfuWMjn3UMUqyQtdGNZ6ZIIyte7B37exj6LaVkrZiUTvzSadVvO/tJm8AEgbGCBPg==", "dev": true, "dependencies": { "cli-truncate": "^3.1.0", @@ -1834,6 +1830,7 @@ "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, + "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -1880,6 +1877,7 @@ "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", "dev": true, + "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -1916,6 +1914,7 @@ "resolved": "https://registry.npmjs.org/ast-metadata-inferer/-/ast-metadata-inferer-0.7.0.tgz", "integrity": "sha512-OkMLzd8xelb3gmnp6ToFvvsHLtS6CbagTkFQvQ+ZYFe3/AIl9iKikNR9G7pY3GfOR/2Xc222hwBjzI7HLkE76Q==", "dev": true, + "peer": true, "dependencies": { "@mdn/browser-compat-data": "^3.3.14" } @@ -1924,7 +1923,8 @@ "version": "3.3.14", "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-3.3.14.tgz", "integrity": "sha512-n2RC9d6XatVbWFdHLimzzUJxJ1KY8LdjqrW6YvGPiRmsHkhOUx74/Ct10x5Yo7bC/Jvqx7cDEW8IMPv/+vwEzA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/atomic-sleep": { "version": "1.0.0", @@ -2054,6 +2054,7 @@ "url": "https://tidelift.com/funding/github/npm/browserslist" } ], + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001449", "electron-to-chromium": "^1.4.284", @@ -2111,6 +2112,7 @@ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true, + "peer": true, "engines": { "node": ">=6" }, @@ -2321,9 +2323,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001470", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001470.tgz", - "integrity": "sha512-065uNwY6QtHCBOExzbV6m236DDhYCCtPmQUCoQtwkVqzud8v5QPidoMr6CoMkC2nfp6nksjttqWQRRh75LqUmA==", + "version": "1.0.30001474", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001474.tgz", + "integrity": "sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q==", "dev": true, "funding": [ { @@ -2333,8 +2335,13 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } - ] + ], + "peer": true }, "node_modules/capital-case": { "version": "1.0.4", @@ -2473,6 +2480,7 @@ "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", "dev": true, + "peer": true, "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -2534,9 +2542,9 @@ } }, "node_modules/cli-spinners": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.7.0.tgz", - "integrity": "sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.8.0.tgz", + "integrity": "sha512-/eG5sJcvEIwxcdYM86k5tPwn0MUzkX5YY3eImTGpJOZgVe4SdTMY14vQpcxgBzJ0wXwAYrS8E+c3uHeK4JNyzQ==", "dev": true, "engines": { "node": ">=6" @@ -3007,9 +3015,9 @@ } }, "node_modules/ctix/node_modules/type-fest": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.7.1.tgz", - "integrity": "sha512-8LZNdvuztgxCF4eYpEmPYUPS0lbbByM2qHcp2oMxHZhWLIQB9QE36EeQ1PKwsUIDZXEP8HCBEmkBbT1//kLU4Q==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.8.0.tgz", + "integrity": "sha512-FVNSzGQz9Th+/9R6Lvv7WIAkstylfHN2/JYxkyhhmKFYh9At2DST8t6L6Lref9eYO8PXFTfG9Sg1Agg0K3vq3Q==", "dev": true, "engines": { "node": ">=14.16" @@ -3186,6 +3194,7 @@ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -3322,10 +3331,11 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.340", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.340.tgz", - "integrity": "sha512-zx8hqumOqltKsv/MF50yvdAlPF9S/4PXbyfzJS6ZGhbddGkRegdwImmfSVqCkEziYzrIGZ/TlrzBND4FysfkDg==", - "dev": true + "version": "1.4.352", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.352.tgz", + "integrity": "sha512-ikFUEyu5/q+wJpMOxWxTaEVk2M1qKqTGKKyfJmod1CPZxKfYnxVS41/GCBQg21ItBpZybyN8sNpRqCUGm+Zc4Q==", + "dev": true, + "peer": true }, "node_modules/emoji-regex": { "version": "9.2.2", @@ -3347,6 +3357,7 @@ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", "dev": true, + "peer": true, "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -3471,9 +3482,9 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.17.14", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.14.tgz", - "integrity": "sha512-vOO5XhmVj/1XQR9NQ1UPq6qvMYL7QFJU57J5fKBKBKxp17uDt5PgxFDb4A2nEiXhr1qQs4x0F5+66hVVw4ruNw==", + "version": "0.17.15", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.15.tgz", + "integrity": "sha512-LBUV2VsUIc/iD9ME75qhT4aJj0r75abCVS0jakhFzOtR7TQsqQA5w0tZ+KTKnwl3kXE0MhskNdHDh/I5aCR1Zw==", "dev": true, "hasInstallScript": true, "bin": { @@ -3483,28 +3494,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.17.14", - "@esbuild/android-arm64": "0.17.14", - "@esbuild/android-x64": "0.17.14", - "@esbuild/darwin-arm64": "0.17.14", - "@esbuild/darwin-x64": "0.17.14", - "@esbuild/freebsd-arm64": "0.17.14", - "@esbuild/freebsd-x64": "0.17.14", - "@esbuild/linux-arm": "0.17.14", - "@esbuild/linux-arm64": "0.17.14", - "@esbuild/linux-ia32": "0.17.14", - "@esbuild/linux-loong64": "0.17.14", - "@esbuild/linux-mips64el": "0.17.14", - "@esbuild/linux-ppc64": "0.17.14", - "@esbuild/linux-riscv64": "0.17.14", - "@esbuild/linux-s390x": "0.17.14", - "@esbuild/linux-x64": "0.17.14", - "@esbuild/netbsd-x64": "0.17.14", - "@esbuild/openbsd-x64": "0.17.14", - "@esbuild/sunos-x64": "0.17.14", - "@esbuild/win32-arm64": "0.17.14", - "@esbuild/win32-ia32": "0.17.14", - "@esbuild/win32-x64": "0.17.14" + "@esbuild/android-arm": "0.17.15", + "@esbuild/android-arm64": "0.17.15", + "@esbuild/android-x64": "0.17.15", + "@esbuild/darwin-arm64": "0.17.15", + "@esbuild/darwin-x64": "0.17.15", + "@esbuild/freebsd-arm64": "0.17.15", + "@esbuild/freebsd-x64": "0.17.15", + "@esbuild/linux-arm": "0.17.15", + "@esbuild/linux-arm64": "0.17.15", + "@esbuild/linux-ia32": "0.17.15", + "@esbuild/linux-loong64": "0.17.15", + "@esbuild/linux-mips64el": "0.17.15", + "@esbuild/linux-ppc64": "0.17.15", + "@esbuild/linux-riscv64": "0.17.15", + "@esbuild/linux-s390x": "0.17.15", + "@esbuild/linux-x64": "0.17.15", + "@esbuild/netbsd-x64": "0.17.15", + "@esbuild/openbsd-x64": "0.17.15", + "@esbuild/sunos-x64": "0.17.15", + "@esbuild/win32-arm64": "0.17.15", + "@esbuild/win32-ia32": "0.17.15", + "@esbuild/win32-x64": "0.17.15" } }, "node_modules/escalade": { @@ -3526,15 +3537,15 @@ } }, "node_modules/eslint": { - "version": "8.36.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.36.0.tgz", - "integrity": "sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==", + "version": "8.37.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.37.0.tgz", + "integrity": "sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.1", - "@eslint/js": "8.36.0", + "@eslint/eslintrc": "^2.0.2", + "@eslint/js": "8.37.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -3545,8 +3556,8 @@ "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.1.1", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.5.0", + "eslint-visitor-keys": "^3.4.0", + "espree": "^9.5.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -3582,11 +3593,32 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-dewald": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/eslint-config-dewald/-/eslint-config-dewald-1.0.8.tgz", + "integrity": "sha512-6+V4uh5qODgQocNWF+JcYR+r3wJF42/jAGG2E9janKc5qK/FPMqvG59p+JYtBgwJCywTSv8r4BIusb0Gaw+RbA==", + "dev": true, + "dependencies": { + "eslint": "8.37.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "5.57.0", + "@typescript-eslint/parser": "5.57.0", + "eslint-import-resolver-typescript": "3.5.3", + "eslint-plugin-compat": "4.1.2", + "eslint-plugin-deprecate": "0.7.0", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-sonarjs": "0.19.0", + "eslint-plugin-svelte": "2.23.1", + "eslint-plugin-unicorn": "46.0.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.7", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", "dev": true, + "peer": true, "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.11.0", @@ -3598,6 +3630,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -3607,6 +3640,7 @@ "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.5.3.tgz", "integrity": "sha512-njRcKYBc3isE42LaTcJNVANR3R99H9bAxBDMNDr2W7yq5gYPxbU3MkdhsQukxZ/Xg9C2vcyLlDsbKfRDg0QvCQ==", "dev": true, + "peer": true, "dependencies": { "debug": "^4.3.4", "enhanced-resolve": "^5.10.0", @@ -3632,6 +3666,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz", "integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==", "dev": true, + "peer": true, "dependencies": { "dir-glob": "^3.0.1", "fast-glob": "^3.2.11", @@ -3651,6 +3686,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, + "peer": true, "engines": { "node": ">=12" }, @@ -3663,6 +3699,7 @@ "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", "dev": true, + "peer": true, "dependencies": { "debug": "^3.2.7" }, @@ -3680,6 +3717,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -3689,6 +3727,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-compat/-/eslint-plugin-compat-4.1.2.tgz", "integrity": "sha512-DNrQgDi5L4mAL4FdFboKBlSRg6MWfd75eA7K91lMjtP5ryN+O11qT2FDn7Z6zqy6sZ4sJawUR5V75qzB6l0CBg==", "dev": true, + "peer": true, "dependencies": { "@mdn/browser-compat-data": "^5.2.34", "ast-metadata-inferer": "^0.7.0", @@ -3710,6 +3749,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "peer": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -3726,6 +3766,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "peer": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -3741,6 +3782,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "peer": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -3756,6 +3798,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "peer": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -3771,6 +3814,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, + "peer": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -3786,6 +3830,7 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "peer": true, "engines": { "node": ">=10" }, @@ -3798,6 +3843,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-deprecate/-/eslint-plugin-deprecate-0.7.0.tgz", "integrity": "sha512-MylhCqoH/SJ2MwzVgX0we6oE+lKPVwhOu9hAJ98vMCmbz3FNwqJ8XipdI23bCF7NHxUbhd6mdxFjywKE52pt7A==", "dev": true, + "peer": true, "peerDependencies": { "eslint": ">=2.x" } @@ -3807,6 +3853,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", "dev": true, + "peer": true, "dependencies": { "array-includes": "^3.1.6", "array.prototype.flat": "^1.3.1", @@ -3836,6 +3883,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -3845,6 +3893,7 @@ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, + "peer": true, "dependencies": { "esutils": "^2.0.2" }, @@ -3857,6 +3906,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, + "peer": true, "bin": { "semver": "bin/semver.js" } @@ -3866,6 +3916,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.19.0.tgz", "integrity": "sha512-6+s5oNk5TFtVlbRxqZN7FIGmjdPCYQKaTzFPmqieCmsU1kBYDzndTeQav0xtQNwZJWu5awWfTGe8Srq9xFOGnw==", "dev": true, + "peer": true, "engines": { "node": ">=14" }, @@ -3878,6 +3929,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-2.23.1.tgz", "integrity": "sha512-hBlptt4auhlae+/cSsOdaB7MV+LcXpyOV0bMAQxXi72oAlCGBCWBSdQbiRmn1OkikfhQKkAe7gjk+XseBYAbyA==", "dev": true, + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -3910,6 +3962,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-46.0.0.tgz", "integrity": "sha512-j07WkC+PFZwk8J33LYp6JMoHa1lXc1u6R45pbSAipjpfpb7KIGr17VE2D685zCxR5VL4cjrl65kTJflziQWMDA==", "dev": true, + "peer": true, "dependencies": { "@babel/helper-validator-identifier": "^7.19.1", "@eslint-community/eslint-utils": "^4.1.2", @@ -3943,6 +3996,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, + "peer": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -3958,6 +4012,7 @@ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, + "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -3967,12 +4022,15 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz", + "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/ansi-styles": { @@ -4177,14 +4235,14 @@ "dev": true }, "node_modules/espree": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.0.tgz", - "integrity": "sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==", + "version": "9.5.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.1.tgz", + "integrity": "sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==", "dev": true, "dependencies": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -4253,6 +4311,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, + "peer": true, "engines": { "node": ">=4.0" } @@ -4623,6 +4682,7 @@ "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.5.0.tgz", "integrity": "sha512-MjhiaIWCJ1sAU4pIQ5i5OfOuHHxVo1oYeNsWTON7jxYkod8pHocXeh+SSbmu5OZZZK73B6cbJ2XADzXehLyovQ==", "dev": true, + "peer": true, "funding": { "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } @@ -5107,6 +5167,7 @@ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", "dev": true, + "peer": true, "dependencies": { "builtin-modules": "^3.3.0" }, @@ -5173,6 +5234,7 @@ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, + "peer": true, "bin": { "is-docker": "cli.js" }, @@ -5442,6 +5504,7 @@ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, + "peer": true, "dependencies": { "is-docker": "^2.0.0" }, @@ -5555,6 +5618,7 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, + "peer": true, "bin": { "jsesc": "bin/jsesc" }, @@ -5585,6 +5649,7 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "peer": true, "dependencies": { "minimist": "^1.2.0" }, @@ -5628,7 +5693,8 @@ "version": "0.27.0", "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.27.0.tgz", "integrity": "sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/levn": { "version": "0.4.1", @@ -5710,7 +5776,8 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/lodash-es": { "version": "4.17.21", @@ -5722,7 +5789,8 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", - "dev": true + "dev": true, + "peer": true }, "node_modules/lodash.merge": { "version": "4.6.2", @@ -5851,6 +5919,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "peer": true, "dependencies": { "yallist": "^4.0.0" }, @@ -6192,7 +6261,8 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true + "dev": true, + "peer": true }, "node_modules/no-case": { "version": "3.0.4", @@ -6228,7 +6298,8 @@ "version": "2.0.10", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", - "dev": true + "dev": true, + "peer": true }, "node_modules/normalize-package-data": { "version": "2.5.0", @@ -6322,6 +6393,7 @@ "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", "dev": true, + "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -6369,6 +6441,7 @@ "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", "dev": true, + "peer": true, "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", @@ -6900,6 +6973,7 @@ "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, + "peer": true, "engines": { "node": ">=4" } @@ -7017,6 +7091,7 @@ "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", "dev": true, + "peer": true, "engines": { "node": ">=12.0" }, @@ -7195,9 +7270,9 @@ } }, "node_modules/process-warning": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.1.0.tgz", - "integrity": "sha512-9C20RLxrZU/rFnxWncDkuF6O999NdIf3E1ws4B0ZeY3sRVPzWBMsYDE2lxjxhiXxg464cQTgKUGm8/i6y2YGXg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.2.0.tgz", + "integrity": "sha512-/1WZ8+VQjR6avWOgHeEPd7SDQmFQ1B5mC1eRXsCm5TarlNmx/wCsa5GEaxGm05BORRtyG/Ex/3xq3TuRvq57qg==", "dev": true }, "node_modules/pseudomap": { @@ -7261,9 +7336,9 @@ } }, "node_modules/radash": { - "version": "10.7.1", - "resolved": "https://registry.npmjs.org/radash/-/radash-10.7.1.tgz", - "integrity": "sha512-iEytYXfDN0DxU9fjf8q0aVdikGJxxYYoG6nY6WqYEBXfXjrghiiNhx+IAFmtbrKy2S2aVETq7RBxhZbaEHE4YA==", + "version": "10.8.1", + "resolved": "https://registry.npmjs.org/radash/-/radash-10.8.1.tgz", + "integrity": "sha512-NzYo3XgM9Tzjf5iFPIMG2l5+LSOCi2H7Axe3Ry/1PrhlvuqxUoiLsmcTBtw4CfKtzy5Fzo79STiEj9JZWMfDQg==", "dev": true, "engines": { "node": ">=14.18.0" @@ -7423,6 +7498,7 @@ "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.24.tgz", "integrity": "sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw==", "dev": true, + "peer": true, "bin": { "regexp-tree": "bin/regexp-tree" } @@ -7449,6 +7525,7 @@ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", "dev": true, + "peer": true, "dependencies": { "jsesc": "~0.5.0" }, @@ -7461,14 +7538,15 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", "dev": true, + "peer": true, "bin": { "jsesc": "bin/jsesc" } }, "node_modules/remeda": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/remeda/-/remeda-1.9.4.tgz", - "integrity": "sha512-T3UYE0SJuvKUvKYLnlf6BQ/p069ySRnX14jqMsXCCR+kcj+t0PjS9wAXzbGvTpMlTsJVu34C7NdHRNNSEuVo2g==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/remeda/-/remeda-1.12.0.tgz", + "integrity": "sha512-IuuWrP1UEyAafKHPQ6bSRGKUxvMh/Kla5LP8ujM/BMf3ciwt5M68j0vlYOl1pIv3J2pS+BMlFKqLtHoYuzcwYQ==", "dev": true }, "node_modules/require-directory": { @@ -7626,6 +7704,7 @@ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", "dev": true, + "peer": true, "dependencies": { "regexp-tree": "~0.1.1" } @@ -8474,6 +8553,7 @@ "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-0.24.2.tgz", "integrity": "sha512-MYZYe8Z7C3eoZxF1VPOeVGe98BrgiX07+roCesACzCxCKpUkFJhi4w5JZwjdw60LGF71rfMJNypwb7AIG1/DYA==", "dev": true, + "peer": true, "dependencies": { "eslint-scope": "^7.0.0", "eslint-visitor-keys": "^3.0.0", @@ -8499,6 +8579,7 @@ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, + "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -8512,6 +8593,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "peer": true, "engines": { "node": ">=4.0" } @@ -8642,6 +8724,7 @@ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", "dev": true, + "peer": true, "dependencies": { "@pkgr/utils": "^2.3.1", "tslib": "^2.5.0" @@ -8736,6 +8819,7 @@ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -8861,9 +8945,9 @@ } }, "node_modules/totalist": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.0.tgz", - "integrity": "sha512-eM+pCBxXO/njtF7vdFsHuqb+ElbxqtI4r5EAvk6grfAFyJ6IvWlSkfZ5T9ozC6xWw3Fj1fGoSmrl0gUs46JVIw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", "dev": true, "engines": { "node": ">=6" @@ -8914,6 +8998,7 @@ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", "dev": true, + "peer": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -9014,6 +9099,7 @@ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, + "peer": true, "dependencies": { "tslib": "^1.8.1" }, @@ -9028,7 +9114,8 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/tty-table": { "version": "4.2.1", @@ -9312,9 +9399,9 @@ } }, "node_modules/typedoc/node_modules/minimatch": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.3.tgz", - "integrity": "sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A==", + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.5.tgz", + "integrity": "sha512-OzOamaOmNBJZUv2qqY1OSWa+++4YPpOkLgkc0w30Oov5ufKlWWXnFUl0l4dgmSv5Shq/zRVkEOXAe2NaqO4l5Q==", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -9326,9 +9413,9 @@ } }, "node_modules/typescript": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", - "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9403,6 +9490,7 @@ "url": "https://tidelift.com/funding/github/npm/browserslist" } ], + "peer": true, "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0" @@ -9521,9 +9609,9 @@ } }, "node_modules/vite-node": { - "version": "0.29.7", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.29.7.tgz", - "integrity": "sha512-PakCZLvz37yFfUPWBnLa1OYHPCGm5v4pmRrTcFN4V/N/T3I6tyP3z07S//9w+DdeL7vVd0VSeyMZuAh+449ZWw==", + "version": "0.29.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.29.8.tgz", + "integrity": "sha512-b6OtCXfk65L6SElVM20q5G546yu10/kNrhg08afEoWlFRJXFq9/6glsvSVY+aI6YeC1tu2TtAqI2jHEQmOmsFw==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -9558,18 +9646,18 @@ } }, "node_modules/vitest": { - "version": "0.29.7", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.29.7.tgz", - "integrity": "sha512-aWinOSOu4jwTuZHkb+cCyrqQ116Q9TXaJrNKTHudKBknIpR0VplzeaOUuDF9jeZcrbtQKZQt6yrtd+eakbaxHg==", + "version": "0.29.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.29.8.tgz", + "integrity": "sha512-JIAVi2GK5cvA6awGpH0HvH/gEG9PZ0a/WoxdiV3PmqK+3CjQMf8c+J/Vhv4mdZ2nRyXFw66sAg6qz7VNkaHfDQ==", "dev": true, "dependencies": { "@types/chai": "^4.3.4", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.29.7", - "@vitest/runner": "0.29.7", - "@vitest/spy": "0.29.7", - "@vitest/utils": "0.29.7", + "@vitest/expect": "0.29.8", + "@vitest/runner": "0.29.8", + "@vitest/spy": "0.29.8", + "@vitest/utils": "0.29.8", "acorn": "^8.8.1", "acorn-walk": "^8.2.0", "cac": "^6.7.14", @@ -9585,7 +9673,7 @@ "tinypool": "^0.4.0", "tinyspy": "^1.0.2", "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.29.7", + "vite-node": "0.29.8", "why-is-node-running": "^2.2.2" }, "bin": { @@ -9602,7 +9690,10 @@ "@vitest/browser": "*", "@vitest/ui": "*", "happy-dom": "*", - "jsdom": "*" + "jsdom": "*", + "playwright": "*", + "safaridriver": "*", + "webdriverio": "*" }, "peerDependenciesMeta": { "@edge-runtime/vm": { @@ -9620,6 +9711,9 @@ "jsdom": { "optional": true }, + "playwright": { + "optional": true + }, "safaridriver": { "optional": true }, @@ -9894,7 +9988,8 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "peer": true }, "node_modules/yaml": { "version": "1.10.2", diff --git a/package.json b/package.json index 3c3ca38c..147ce643 100644 --- a/package.json +++ b/package.json @@ -16,28 +16,17 @@ "build:docs": "npm run build --workspace=package && npm run build:docs-data && npm run build --workspace=website", "benchmark": "npm run build --workspace=package && npm run bench --workspace=benchmark" }, - "browserslist": [ - ">2% and not dead" - ], "devDependencies": { "@svitejs/changesets-changelog-github-compact": "1.1.0", "@changesets/cli": "2.26.1", - "@typescript-eslint/eslint-plugin": "5.56.0", - "@typescript-eslint/parser": "5.56.0", - "eslint": "8.36.0", - "eslint-import-resolver-typescript": "3.5.3", - "eslint-plugin-compat": "4.1.2", - "eslint-plugin-deprecate": "0.7.0", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-sonarjs": "0.19.0", - "eslint-plugin-svelte": "2.23.1", - "eslint-plugin-unicorn": "46.0.0", + "eslint-config-dewald": "1.0.8", + "eslint": "8.37.0", "typedoc": "0.23.28", - "typescript": "5.0.2", - "vitest": "0.29.7", - "@vitest/coverage-c8": "0.29.7", - "@vitest/ui": "0.29.7", + "typescript": "5.0.3", + "vitest": "0.29.8", + "@vitest/coverage-c8": "0.29.8", + "@vitest/ui": "0.29.8", "vite": "4.2.1", "hotscript": "1.0.11" } -} +} \ No newline at end of file diff --git a/package/src/array/difference.ts b/package/src/array/difference.ts index 49e6b391..faaf694e 100644 --- a/package/src/array/difference.ts +++ b/package/src/array/difference.ts @@ -1,7 +1,7 @@ -import type { CompareFunction } from '@helpers/ArrayTypeUtils.js'; -import type { ArrayMinLength } from '@type/ArrayMinLength.js'; +import type { CompareFunction } from "@helpers/ArrayTypeUtils.js"; +import type { ArrayMinLength } from "@type/ArrayMinLength.js"; -import { fastArrayFlat } from '@helpers/fastArrayFlat.js'; +import { fastArrayFlat } from "@helpers/fastArrayFlat.js"; /** * Create a new array with values from the first array that are not present in the other arrays. @@ -32,7 +32,7 @@ import { fastArrayFlat } from '@helpers/fastArrayFlat.js'; export function difference(...arraysOrCompareFn: ArrayMinLength): TElem[]; export function difference>(...arraysOrCompareFn: [...TArrays, CompareFunction]): TArrays[0]; export function difference, TElem>(...arraysOrCompareFn: ArrayMinLength | [...TArrays, CompareFunction]): TArrays[0] { - const compareFnProvided = typeof arraysOrCompareFn.at(-1) === 'function'; + const compareFnProvided = typeof arraysOrCompareFn.at(-1) === "function"; const compareFunction = compareFnProvided && arraysOrCompareFn.pop() as CompareFunction; const arrays = arraysOrCompareFn as TArrays; diff --git a/package/src/array/index.ts b/package/src/array/index.ts index 055636c1..306702f6 100644 --- a/package/src/array/index.ts +++ b/package/src/array/index.ts @@ -1,13 +1,13 @@ -export * from './chunk'; -export * from './count'; -export * from './difference'; -export * from './dropRightWhile'; -export * from './dropWhile'; -export * from './group'; -export * from './intersection'; -export * from './range'; -export * from './shuffle'; -export * from './sort'; -export * from './takeRightWhile'; -export * from './takeWhile'; -export * from './unique'; +export * from "./chunk"; +export * from "./count"; +export * from "./difference"; +export * from "./dropRightWhile"; +export * from "./dropWhile"; +export * from "./group"; +export * from "./intersection"; +export * from "./range"; +export * from "./shuffle"; +export * from "./sort"; +export * from "./takeRightWhile"; +export * from "./takeWhile"; +export * from "./unique"; diff --git a/package/src/array/intersection.ts b/package/src/array/intersection.ts index e531041e..2c4ad1f0 100644 --- a/package/src/array/intersection.ts +++ b/package/src/array/intersection.ts @@ -1,9 +1,9 @@ -import type { CompareFunction } from '@helpers/ArrayTypeUtils.js'; -import type { ArrayMinLength } from '@type/ArrayMinLength.js'; +import type { CompareFunction } from "@helpers/ArrayTypeUtils.js"; +import type { ArrayMinLength } from "@type/ArrayMinLength.js"; -import { fastArrayFlat } from '@helpers/fastArrayFlat.js'; +import { fastArrayFlat } from "@helpers/fastArrayFlat.js"; -import { unique } from './unique.js'; +import { unique } from "./unique.js"; /** * Create an array with unique values that are present in all arrays. @@ -35,7 +35,7 @@ import { unique } from './unique.js'; export function intersection(...arraysOrCompareFn: ArrayMinLength): TElem[]; export function intersection>(...arraysOrCompareFn: [...TArrays, CompareFunction]): TArrays[0]; export function intersection, TElem>(...arraysOrCompareFn: ArrayMinLength | [...TArrays, CompareFunction]): TArrays[0] { - const compareFnProvided = typeof arraysOrCompareFn.at(-1) === 'function'; + const compareFnProvided = typeof arraysOrCompareFn.at(-1) === "function"; const compareFunction = compareFnProvided && arraysOrCompareFn.pop() as CompareFunction; const arrays = arraysOrCompareFn as TArrays; diff --git a/package/src/array/range.ts b/package/src/array/range.ts index b7c902d9..9d9f67c8 100644 --- a/package/src/array/range.ts +++ b/package/src/array/range.ts @@ -20,10 +20,10 @@ */ export function* range(start: number, end: number, step = 1): Generator { if (start > end) - throw new Error('The start of the range must be less than or equal to the end.'); + throw new Error("The start of the range must be less than or equal to the end."); if (step <= 0) - throw new Error('The step must be greater than 0.'); + throw new Error("The step must be greater than 0."); for (let i = start; i <= end; i += step) { yield i; diff --git a/package/src/array/sort.ts b/package/src/array/sort.ts index e0aa8163..8305d3a7 100644 --- a/package/src/array/sort.ts +++ b/package/src/array/sort.ts @@ -21,16 +21,16 @@ * @template TElem The type of the array elements. * @returns Returns a new sorted array. */ -export function sort(array: readonly TElem[], ...orders: { order?: 'asc' | 'desc', by?: (item: TElem) => number | bigint | Date | string }[]): TElem[] { +export function sort(array: readonly TElem[], ...orders: { order?: "asc" | "desc", by?: (item: TElem) => number | bigint | Date | string }[]): TElem[] { return [...array].sort((a, b) => { for (const { order, by } of orders) { const aValue = by ? by(a) : a; const bValue = by ? by(b) : b; if (aValue < bValue) { - return order === 'desc' ? 1 : -1; + return order === "desc" ? 1 : -1; } if (aValue > bValue) { - return order === 'desc' ? -1 : 1; + return order === "desc" ? -1 : 1; } } return 0; diff --git a/package/src/crypto/hash.ts b/package/src/crypto/hash.ts index bed0c1c4..335399ac 100644 --- a/package/src/crypto/hash.ts +++ b/package/src/crypto/hash.ts @@ -1,6 +1,6 @@ -import type { Jsonifiable } from '@type/Jsonifiable.js'; +import type { Jsonifiable } from "@type/Jsonifiable.js"; -type SupportedAlgorithms = 'SHA-256' | 'SHA-384' | 'SHA-512'; +type SupportedAlgorithms = "SHA-256" | "SHA-384" | "SHA-512"; let textEncoder: TextEncoder | undefined; @@ -27,15 +27,15 @@ let textEncoder: TextEncoder | undefined; * @throws {DOMException} If the specified algorithm is not supported by the Web Crypto API. */ -export async function hash(data: Jsonifiable, algorithm: SupportedAlgorithms = 'SHA-256'): Promise { +export async function hash(data: Jsonifiable, algorithm: SupportedAlgorithms = "SHA-256"): Promise { textEncoder ??= new TextEncoder(); - const dataBuffer = typeof data === 'string' + const dataBuffer = typeof data === "string" ? textEncoder.encode(data) : textEncoder.encode(JSON.stringify(data)); const hashBuffer = await crypto.subtle.digest(algorithm, dataBuffer); const hashArray = [...new Uint8Array(hashBuffer)]; - const hexValues = hashArray.map(b => b.toString(16).padStart(2, '0')); - return hexValues.join(''); + const hexValues = hashArray.map(b => b.toString(16).padStart(2, "0")); + return hexValues.join(""); } diff --git a/package/src/crypto/index.ts b/package/src/crypto/index.ts index 4c8fd5ab..076c6ee1 100644 --- a/package/src/crypto/index.ts +++ b/package/src/crypto/index.ts @@ -1,5 +1,5 @@ -export * from './hash'; -export * from './randomElem'; -export * from './randomFloat'; -export * from './randomInt'; -export * from './randomString'; +export * from "./hash"; +export * from "./randomElem"; +export * from "./randomFloat"; +export * from "./randomInt"; +export * from "./randomString"; diff --git a/package/src/crypto/randomElem.ts b/package/src/crypto/randomElem.ts index bd9e56b2..c73a59e1 100644 --- a/package/src/crypto/randomElem.ts +++ b/package/src/crypto/randomElem.ts @@ -1,4 +1,4 @@ -import { randomInt } from './randomInt.js'; +import { randomInt } from "./randomInt.js"; /** * Gets a random element an array. A single element is returned by default. diff --git a/package/src/crypto/randomFloat.ts b/package/src/crypto/randomFloat.ts index 20e7eedc..6d2863f2 100644 --- a/package/src/crypto/randomFloat.ts +++ b/package/src/crypto/randomFloat.ts @@ -18,7 +18,7 @@ const shiftRight52Bits = 2 ** -52; export function randomFloat(min: number, max: number): number { if (min >= max) { - throw new Error('max must be greater than min'); + throw new Error("max must be greater than min"); } const range = max - min; const randomBuffer = new Uint32Array(2); diff --git a/package/src/crypto/randomInt.ts b/package/src/crypto/randomInt.ts index b4564980..d85df323 100644 --- a/package/src/crypto/randomInt.ts +++ b/package/src/crypto/randomInt.ts @@ -16,10 +16,10 @@ export function randomInt(min: number, max: number): number { // Taken from https://stackoverflow.com/a/41452318 if (!Number.isInteger(min) || !Number.isInteger(max)) - throw new TypeError('min and max must be integers'); + throw new TypeError("min and max must be integers"); if (min >= max) - throw new Error('max must be greater than min'); + throw new Error("max must be greater than min"); const range = max - min + 1; const randomBytes = Math.ceil(Math.log2(range) / 8); diff --git a/package/src/crypto/randomString.ts b/package/src/crypto/randomString.ts index b791e483..73387bc0 100644 --- a/package/src/crypto/randomString.ts +++ b/package/src/crypto/randomString.ts @@ -1,6 +1,6 @@ -import { randomInt } from './randomInt.js'; +import { randomInt } from "./randomInt.js"; -const DEFAULT_CHARSET = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; +const DEFAULT_CHARSET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; /** * Generates a random string of the specified length. @@ -20,9 +20,9 @@ const DEFAULT_CHARSET = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012 */ export function randomString(length: number, charSet = DEFAULT_CHARSET): string { - if (charSet.length <= 0) return ''; + if (charSet.length <= 0) return ""; - let result = ''; + let result = ""; for (let index = 0; index < length; index++) { const randomIndex = randomInt(0, charSet.length - 1); result += charSet[randomIndex]; diff --git a/package/src/decorator/decDebounce.ts b/package/src/decorator/decDebounce.ts index b0880022..3ed8d46b 100644 --- a/package/src/decorator/decDebounce.ts +++ b/package/src/decorator/decDebounce.ts @@ -1,5 +1,5 @@ -import { toDecorator } from '@decorator/toDecorator.js'; -import { debounce } from '@function/debounce.js'; +import { toDecorator } from "@decorator/toDecorator.js"; +import { debounce } from "@function/debounce.js"; /** * Debouces the decorated function. Only calling it after a specified amount of time has passed without any new calls. diff --git a/package/src/decorator/decMaxCalls.ts b/package/src/decorator/decMaxCalls.ts index 681acb12..bc5cd2ce 100644 --- a/package/src/decorator/decMaxCalls.ts +++ b/package/src/decorator/decMaxCalls.ts @@ -1,5 +1,5 @@ -import { toDecorator } from '@decorator/toDecorator.js'; -import { maxCalls } from '@function/maxCalls.js'; +import { toDecorator } from "@decorator/toDecorator.js"; +import { maxCalls } from "@function/maxCalls.js"; /** * Only invokes the decorated function as long as it's called `<= n` times. diff --git a/package/src/decorator/decMemoize.ts b/package/src/decorator/decMemoize.ts index f068e429..3e72a455 100644 --- a/package/src/decorator/decMemoize.ts +++ b/package/src/decorator/decMemoize.ts @@ -1,5 +1,5 @@ -import { toDecorator } from '@decorator/toDecorator.js'; -import { memoize } from '@function/memoize.js'; +import { toDecorator } from "@decorator/toDecorator.js"; +import { memoize } from "@function/memoize.js"; /** * Memoizes the decorated function. diff --git a/package/src/decorator/decMinCalls.ts b/package/src/decorator/decMinCalls.ts index 062f4dc5..f9f57199 100644 --- a/package/src/decorator/decMinCalls.ts +++ b/package/src/decorator/decMinCalls.ts @@ -1,5 +1,5 @@ -import { toDecorator } from '@decorator/toDecorator.js'; -import { minCalls } from '@function/minCalls.js'; +import { toDecorator } from "@decorator/toDecorator.js"; +import { minCalls } from "@function/minCalls.js"; /** * Only invokes the decorated function after it's called more than `n` times. diff --git a/package/src/decorator/decThrottle.ts b/package/src/decorator/decThrottle.ts index df4246d0..fb1e98ab 100644 --- a/package/src/decorator/decThrottle.ts +++ b/package/src/decorator/decThrottle.ts @@ -1,5 +1,5 @@ -import { toDecorator } from '@decorator/toDecorator.js'; -import { throttle } from '@function/throttle.js'; +import { toDecorator } from "@decorator/toDecorator.js"; +import { throttle } from "@function/throttle.js"; /** * The decorated function is invoked at most once per every `wait` milliseconds. diff --git a/package/src/decorator/index.ts b/package/src/decorator/index.ts index 9100c8ef..863c97e3 100644 --- a/package/src/decorator/index.ts +++ b/package/src/decorator/index.ts @@ -1,6 +1,6 @@ -export * from './decDebounce'; -export * from './decMaxCalls'; -export * from './decMemoize'; -export * from './decMinCalls'; -export * from './decThrottle'; -export * from './toDecorator'; +export * from "./decDebounce"; +export * from "./decMaxCalls"; +export * from "./decMemoize"; +export * from "./decMinCalls"; +export * from "./decThrottle"; +export * from "./toDecorator"; diff --git a/package/src/decorator/toDecorator.ts b/package/src/decorator/toDecorator.ts index baffa262..9c79158c 100644 --- a/package/src/decorator/toDecorator.ts +++ b/package/src/decorator/toDecorator.ts @@ -1,4 +1,4 @@ -import type { GenericFunction } from '@type/GenericFunction.js'; +import type { GenericFunction } from "@type/GenericFunction.js"; type Tail = T extends [infer _Head, ...infer Tail] ? Tail : never; diff --git a/package/src/function/debounce.ts b/package/src/function/debounce.ts index 25b1d263..eb124b4b 100644 --- a/package/src/function/debounce.ts +++ b/package/src/function/debounce.ts @@ -1,4 +1,4 @@ -import type { GenericFunction } from '@type/GenericFunction.js'; +import type { GenericFunction } from "@type/GenericFunction.js"; /** * Creates a debounced version of a function. Only calling it after a specified amount of time has passed without any new calls. diff --git a/package/src/function/index.ts b/package/src/function/index.ts index 5a4e8a4c..b83c4528 100644 --- a/package/src/function/index.ts +++ b/package/src/function/index.ts @@ -1,6 +1,6 @@ -export * from './debounce'; -export * from './maxCalls'; -export * from './memoize'; -export * from './minCalls'; -export * from './throttle'; -export * from './times'; +export * from "./debounce"; +export * from "./maxCalls"; +export * from "./memoize"; +export * from "./minCalls"; +export * from "./throttle"; +export * from "./times"; diff --git a/package/src/function/maxCalls.ts b/package/src/function/maxCalls.ts index fee1a1e6..1fd52e05 100644 --- a/package/src/function/maxCalls.ts +++ b/package/src/function/maxCalls.ts @@ -1,4 +1,4 @@ -import type { GenericFunction } from '@type/GenericFunction.js'; +import type { GenericFunction } from "@type/GenericFunction.js"; /** * Creates a function that invokes the given function as long as it's called `<= n` times. diff --git a/package/src/function/memoize.ts b/package/src/function/memoize.ts index 0401876e..4b90c189 100644 --- a/package/src/function/memoize.ts +++ b/package/src/function/memoize.ts @@ -1,4 +1,4 @@ -import type { GenericFunction } from '@type/GenericFunction.js'; +import type { GenericFunction } from "@type/GenericFunction.js"; const defaultResolver = (...args: unknown[]) => JSON.stringify(args); diff --git a/package/src/function/minCalls.ts b/package/src/function/minCalls.ts index c6113328..87812171 100644 --- a/package/src/function/minCalls.ts +++ b/package/src/function/minCalls.ts @@ -1,4 +1,4 @@ -import type { GenericFunction } from '@type/GenericFunction.js'; +import type { GenericFunction } from "@type/GenericFunction.js"; /** * Creates a function that invokes the given function once it's called more than `n` times. diff --git a/package/src/function/throttle.ts b/package/src/function/throttle.ts index 61490690..86624c5b 100644 --- a/package/src/function/throttle.ts +++ b/package/src/function/throttle.ts @@ -1,4 +1,4 @@ -import type { GenericFunction } from '@type/GenericFunction.js'; +import type { GenericFunction } from "@type/GenericFunction.js"; /** * Generates a function that invokes the given function at most once per every `wait` milliseconds. diff --git a/package/src/helpers/ArrayTypeUtils.ts b/package/src/helpers/ArrayTypeUtils.ts index 1c77d96a..9db33a0f 100644 --- a/package/src/helpers/ArrayTypeUtils.ts +++ b/package/src/helpers/ArrayTypeUtils.ts @@ -1,4 +1,4 @@ -import type { ArrayMinLength } from '@type/ArrayMinLength.js'; +import type { ArrayMinLength } from "@type/ArrayMinLength.js"; export type CompareFunction> = (a: TArrays[0][number], b: ArrayTail[number][number]) => boolean; export type ArrayTail = TArray extends [unknown, ...infer U] ? U : never; \ No newline at end of file diff --git a/package/src/index.ts b/package/src/index.ts index 79cd6a9c..b2cbb9f7 100644 --- a/package/src/index.ts +++ b/package/src/index.ts @@ -1,10 +1,10 @@ -export * from './array'; -export * from './crypto'; -export * from './decorator'; -export * from './function'; -export * from './number'; -export * from './object'; -export * from './promise'; -export * from './string'; -export * from './type'; -export * from './validate'; +export * from "./array"; +export * from "./crypto"; +export * from "./decorator"; +export * from "./function"; +export * from "./number"; +export * from "./object"; +export * from "./promise"; +export * from "./string"; +export * from "./type"; +export * from "./validate"; diff --git a/package/src/number/average.ts b/package/src/number/average.ts index fea177dd..5fab6f72 100644 --- a/package/src/number/average.ts +++ b/package/src/number/average.ts @@ -1,4 +1,4 @@ -import { sum } from '@number/sum.js'; +import { sum } from "@number/sum.js"; /** * Calculates the average of an array of numbers diff --git a/package/src/number/index.ts b/package/src/number/index.ts index 92884f9f..c25e1152 100644 --- a/package/src/number/index.ts +++ b/package/src/number/index.ts @@ -1,4 +1,4 @@ -export * from './average'; -export * from './median'; -export * from './round'; -export * from './sum'; +export * from "./average"; +export * from "./median"; +export * from "./round"; +export * from "./sum"; diff --git a/package/src/number/sum.ts b/package/src/number/sum.ts index 2a95b45b..7e47ad41 100644 --- a/package/src/number/sum.ts +++ b/package/src/number/sum.ts @@ -1,5 +1,5 @@ -import type { Tuples, Call } from 'hotscript'; +import type { Tuples, Call } from "hotscript"; /** * Calculates the sum of an array of numbers. diff --git a/package/src/object/flatKeys.ts b/package/src/object/flatKeys.ts index 2d802d10..aa826cfa 100644 --- a/package/src/object/flatKeys.ts +++ b/package/src/object/flatKeys.ts @@ -1,7 +1,7 @@ -import type { PlainObject } from '@type/PlainObject.js'; -import type { Call, Objects } from 'hotscript'; +import type { PlainObject } from "@type/PlainObject.js"; +import type { Call, Objects } from "hotscript"; -import { isPlainObject } from '@validate/isPlainObject.js'; +import { isPlainObject } from "@validate/isPlainObject.js"; type StringIfNever = [Type] extends [never] ? string : Type; type Paths = StringIfNever>; diff --git a/package/src/object/index.ts b/package/src/object/index.ts index 681c5250..e095d5e9 100644 --- a/package/src/object/index.ts +++ b/package/src/object/index.ts @@ -1,5 +1,5 @@ -export * from './flatKeys'; -export * from './merge'; -export * from './omit'; -export * from './pick'; -export * from './set'; +export * from "./flatKeys"; +export * from "./merge"; +export * from "./omit"; +export * from "./pick"; +export * from "./set"; diff --git a/package/src/object/merge.ts b/package/src/object/merge.ts index ec893414..28378605 100644 --- a/package/src/object/merge.ts +++ b/package/src/object/merge.ts @@ -1,7 +1,7 @@ -import type { ArrayMinLength } from '@type/ArrayMinLength.js'; -import type { PlainObject } from '@type/PlainObject.js'; +import type { ArrayMinLength } from "@type/ArrayMinLength.js"; +import type { PlainObject } from "@type/PlainObject.js"; -import { isPlainObject } from '@validate/isPlainObject.js'; +import { isPlainObject } from "@validate/isPlainObject.js"; /** * This function combines two or more objects into a single new object. Arrays and other types are overwritten. diff --git a/package/src/object/omit.ts b/package/src/object/omit.ts index 79f3a0a8..4b904c97 100644 --- a/package/src/object/omit.ts +++ b/package/src/object/omit.ts @@ -1,6 +1,6 @@ -import type { PlainObject } from '@type/PlainObject.js'; +import type { PlainObject } from "@type/PlainObject.js"; -import { pick } from './pick.js'; +import { pick } from "./pick.js"; /** * Omit specified keys from an object diff --git a/package/src/object/pick.ts b/package/src/object/pick.ts index a381b829..99329e11 100644 --- a/package/src/object/pick.ts +++ b/package/src/object/pick.ts @@ -1,4 +1,4 @@ -import type { PlainObject } from '@type/PlainObject.js'; +import type { PlainObject } from "@type/PlainObject.js"; /** * Creates an object composed of the picked `object` properties. diff --git a/package/src/object/set.ts b/package/src/object/set.ts index ede554ef..0226d3a0 100644 --- a/package/src/object/set.ts +++ b/package/src/object/set.ts @@ -1,7 +1,7 @@ -import type { PlainObject } from '@type/PlainObject.js'; -import type { Call, Objects } from 'hotscript'; +import type { PlainObject } from "@type/PlainObject.js"; +import type { Call, Objects } from "hotscript"; -import { isPlainObject } from '@validate/isPlainObject.js'; +import { isPlainObject } from "@validate/isPlainObject.js"; const validPathRegex = /^(?:[^.[\]]+(?:\[\d+])*(?:\.|\[\d+]))+(?:[^.[\]]+(?:\[\d+])*)+$/; const pathSplitRegex = /\.|(?=\[)/g; @@ -42,24 +42,24 @@ type UpdateObj = Call, TVal>(obj: TObj, path: TPath, value: TVal): UpdateObj { if (!validPathRegex.test(path)) - throw new Error('Invalid path, look at the examples for the correct format.'); + throw new Error("Invalid path, look at the examples for the correct format."); const pathParts = (path as string).split(pathSplitRegex); let currentObj: PlainObject = obj; for (let index = 0; index < pathParts.length; index++) { - const key = pathParts[index].replace(matchBracketsRegex, ''); + const key = pathParts[index].replace(matchBracketsRegex, ""); if (index === pathParts.length - 1) { currentObj[key] = value; break; } - const nextElemIn = pathParts[index + 1].startsWith('[') ? 'array' : 'object'; + const nextElemIn = pathParts[index + 1].startsWith("[") ? "array" : "object"; if (currentObj[key] === undefined) { - currentObj[key] = nextElemIn === 'array' ? [] : {}; - } else if (nextElemIn === 'array' && !Array.isArray(currentObj[key])) { + currentObj[key] = nextElemIn === "array" ? [] : {}; + } else if (nextElemIn === "array" && !Array.isArray(currentObj[key])) { currentObj[key] = []; - } else if (nextElemIn === 'object' && !isPlainObject(currentObj[key])) { + } else if (nextElemIn === "object" && !isPlainObject(currentObj[key])) { currentObj[key] = {}; } currentObj = currentObj[key] as PlainObject; diff --git a/package/src/promise/index.ts b/package/src/promise/index.ts index 62444369..8b68cb4c 100644 --- a/package/src/promise/index.ts +++ b/package/src/promise/index.ts @@ -1,6 +1,6 @@ -export * from './queue'; -export * from './races'; -export * from './retry'; -export * from './sleep'; -export * from './timeout'; -export * from './tryCatch'; +export * from "./queue"; +export * from "./races"; +export * from "./retry"; +export * from "./sleep"; +export * from "./timeout"; +export * from "./tryCatch"; diff --git a/package/src/promise/queue.ts b/package/src/promise/queue.ts index 87b347fd..6547f2a8 100644 --- a/package/src/promise/queue.ts +++ b/package/src/promise/queue.ts @@ -89,7 +89,7 @@ export class Queue { /** Removes all the tasks from the queue */ clear() { for (const queueElement of this.queue) { - queueElement.reject(new Error('Queue cleared')); + queueElement.reject(new Error("Queue cleared")); } this.queue = []; } diff --git a/package/src/promise/retry.ts b/package/src/promise/retry.ts index ee149f49..947313ab 100644 --- a/package/src/promise/retry.ts +++ b/package/src/promise/retry.ts @@ -1,5 +1,5 @@ /* eslint-disable no-await-in-loop */ -import { sleep } from '@promise/sleep.js'; +import { sleep } from "@promise/sleep.js"; /** * Retry a function until it succeeds or the maximum number of retries is reached. @@ -62,5 +62,5 @@ export async function retry( } /* c8 ignore next 2 */ } - throw new Error('Retry terminated without success, this should never happen'); + throw new Error("Retry terminated without success, this should never happen"); } \ No newline at end of file diff --git a/package/src/string/camelCase.ts b/package/src/string/camelCase.ts index 46f20080..22cade43 100644 --- a/package/src/string/camelCase.ts +++ b/package/src/string/camelCase.ts @@ -1,6 +1,6 @@ -import { splitWords } from '@string/splitWords'; +import { splitWords } from "@string/splitWords"; -import { deburr } from './deburr.js'; +import { deburr } from "./deburr.js"; /** * Converts `string` to camelCase. @@ -20,7 +20,7 @@ export function camelCase(str: string): string { str = deburr(str); const words = splitWords(str); - let camelCase = ''; + let camelCase = ""; for (const [index, word] of words.entries()) { camelCase += index === 0 ? word.toLowerCase() diff --git a/package/src/string/deburr.ts b/package/src/string/deburr.ts index 59d967df..0d5f39fe 100644 --- a/package/src/string/deburr.ts +++ b/package/src/string/deburr.ts @@ -15,5 +15,5 @@ const accentControlRegex = /[\u0300-\u036F]/g; */ export function deburr(str: string): string { - return str.normalize('NFD').replace(accentControlRegex, ''); + return str.normalize("NFD").replace(accentControlRegex, ""); } diff --git a/package/src/string/escapeHtml.ts b/package/src/string/escapeHtml.ts index a50774aa..decb07c7 100644 --- a/package/src/string/escapeHtml.ts +++ b/package/src/string/escapeHtml.ts @@ -1,10 +1,10 @@ const charRegex = /["&'<>]/g; const escapeChars = new Map([ - ['&', '&'], - ['<', '<'], - ['>', '>'], - ['\'', '''], - ['"', '"'] + ["&", "&"], + ["<", "<"], + [">", ">"], + ["'", "'"], + ['"', """] ]); /** diff --git a/package/src/string/escapeRegExp.ts b/package/src/string/escapeRegExp.ts index d352ffc5..0d7c2360 100644 --- a/package/src/string/escapeRegExp.ts +++ b/package/src/string/escapeRegExp.ts @@ -12,5 +12,5 @@ const escapleCharsRegex = /[$()*+.?[\\\]^{|}]/g; */ export function escapeRegExp(str: string): string { - return str.replace(escapleCharsRegex, '\\$&'); + return str.replace(escapleCharsRegex, "\\$&"); } diff --git a/package/src/string/index.ts b/package/src/string/index.ts index e2f58eb4..018f2149 100644 --- a/package/src/string/index.ts +++ b/package/src/string/index.ts @@ -1,11 +1,11 @@ -export * from './camelCase'; -export * from './capitalize'; -export * from './deburr'; -export * from './escapeHtml'; -export * from './escapeRegExp'; -export * from './kebabCase'; -export * from './pascalCase'; -export * from './snakeCase'; -export * from './splitWords'; -export * from './titleCase'; -export * from './unescapeHtml'; +export * from "./camelCase"; +export * from "./capitalize"; +export * from "./deburr"; +export * from "./escapeHtml"; +export * from "./escapeRegExp"; +export * from "./kebabCase"; +export * from "./pascalCase"; +export * from "./snakeCase"; +export * from "./splitWords"; +export * from "./titleCase"; +export * from "./unescapeHtml"; diff --git a/package/src/string/kebabCase.ts b/package/src/string/kebabCase.ts index 3e3145f8..f4ab3d29 100644 --- a/package/src/string/kebabCase.ts +++ b/package/src/string/kebabCase.ts @@ -1,6 +1,6 @@ -import { splitWords } from '@string/splitWords'; +import { splitWords } from "@string/splitWords"; -import { deburr } from './deburr.js'; +import { deburr } from "./deburr.js"; /** * Converts a string to kebab-case. @@ -20,9 +20,9 @@ import { deburr } from './deburr.js'; export function kebabCase(str: string): string { str = deburr(str); const words = splitWords(str); - let kebabCase = ''; + let kebabCase = ""; for (const word of words) { - kebabCase += word.toLowerCase() + '-'; + kebabCase += word.toLowerCase() + "-"; } return kebabCase.slice(0, -1); } diff --git a/package/src/string/pascalCase.ts b/package/src/string/pascalCase.ts index 2a604d73..a084e872 100644 --- a/package/src/string/pascalCase.ts +++ b/package/src/string/pascalCase.ts @@ -1,6 +1,6 @@ -import { splitWords } from '@string/splitWords'; +import { splitWords } from "@string/splitWords"; -import { deburr } from './deburr.js'; +import { deburr } from "./deburr.js"; /** @@ -21,7 +21,7 @@ import { deburr } from './deburr.js'; export function pascalCase(str: string): string { str = deburr(str); const words = splitWords(str); - let pascalCase = ''; + let pascalCase = ""; for (const word of words) { pascalCase += word.charAt(0).toUpperCase() + word.slice(1); } diff --git a/package/src/string/snakeCase.ts b/package/src/string/snakeCase.ts index 65735f88..0de350c5 100644 --- a/package/src/string/snakeCase.ts +++ b/package/src/string/snakeCase.ts @@ -1,6 +1,6 @@ -import { splitWords } from '@string/splitWords'; +import { splitWords } from "@string/splitWords"; -import { deburr } from './deburr.js'; +import { deburr } from "./deburr.js"; /** * Converts a string to snake_case. @@ -22,10 +22,10 @@ import { deburr } from './deburr.js'; export function snakeCase(str: string): string { str = deburr(str); const words = splitWords(str); - let snakeCase = ''; + let snakeCase = ""; for (const word of words) { if (snakeCase.length > 0) { - snakeCase += '_'; + snakeCase += "_"; } snakeCase += word.toLowerCase(); } diff --git a/package/src/string/splitWords.ts b/package/src/string/splitWords.ts index b9c55efc..dc29d146 100644 --- a/package/src/string/splitWords.ts +++ b/package/src/string/splitWords.ts @@ -1,12 +1,12 @@ // Split non-alphanumeric characters with spaces and deal with camel/PascalCase const splitWordsRegex = new RegExp( - '[^\\dA-Za-z]' + // match any character that is not a letter or a digit - '|' + // or - '(?<=[a-z])' + // lookbehind for a lowercase letter - '(?=[A-Z])' + // lookahead for an uppercase letter - '|' + // or - '(?<=[A-Z])' + // lookbehind for an uppercase letter - '(?=[A-Z][a-z])' // lookahead for an uppercase letter followed by a lowercase letter + "[^\\dA-Za-z]" + // match any character that is not a letter or a digit + "|" + // or + "(?<=[a-z])" + // lookbehind for a lowercase letter + "(?=[A-Z])" + // lookahead for an uppercase letter + "|" + // or + "(?<=[A-Z])" + // lookbehind for an uppercase letter + "(?=[A-Z][a-z])" // lookahead for an uppercase letter followed by a lowercase letter ); /** diff --git a/package/src/string/titleCase.ts b/package/src/string/titleCase.ts index 267e1989..941b98a8 100644 --- a/package/src/string/titleCase.ts +++ b/package/src/string/titleCase.ts @@ -1,6 +1,6 @@ -import { splitWords } from '@string/splitWords'; +import { splitWords } from "@string/splitWords"; -import { deburr } from './deburr.js'; +import { deburr } from "./deburr.js"; /** * Converts a string to Title Case. @@ -21,9 +21,9 @@ import { deburr } from './deburr.js'; export function titleCase(str: string): string { str = deburr(str); const words = splitWords(str); - let titleCase = ''; + let titleCase = ""; for (const word of words) { - titleCase += word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + ' '; + titleCase += word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + " "; } return titleCase.trimEnd(); } diff --git a/package/src/string/unescapeHtml.ts b/package/src/string/unescapeHtml.ts index 12987b7d..93301ce4 100644 --- a/package/src/string/unescapeHtml.ts +++ b/package/src/string/unescapeHtml.ts @@ -1,10 +1,10 @@ const htmlEntitiesRegex = /&(?:amp|lt|gt|quot|#39);/g; const entityMap = new Map([ - ['&', '&'], - ['<', '<'], - ['>', '>'], - ['"', '"'], - [''', '\''] + ["&", "&"], + ["<", "<"], + [">", ">"], + [""", '"'], + ["'", "'"] ]); /** diff --git a/package/src/type/ArrayMinLength.ts b/package/src/type/ArrayMinLength.ts index 98a063a5..e66cfbfd 100644 --- a/package/src/type/ArrayMinLength.ts +++ b/package/src/type/ArrayMinLength.ts @@ -19,6 +19,6 @@ type BuildArrayMinLength< TElem, TMinLength extends number, Current extends TElem[] -> = Current['length'] extends TMinLength +> = Current["length"] extends TMinLength ? [...Current, ...TElem[]] : BuildArrayMinLength; \ No newline at end of file diff --git a/package/src/type/index.ts b/package/src/type/index.ts index d4ba0d44..5e25e23e 100644 --- a/package/src/type/index.ts +++ b/package/src/type/index.ts @@ -1,4 +1,4 @@ -export * from './ArrayMinLength'; -export * from './GenericFunction'; -export * from './Jsonifiable'; -export * from './PlainObject'; +export * from "./ArrayMinLength"; +export * from "./GenericFunction"; +export * from "./Jsonifiable"; +export * from "./PlainObject"; diff --git a/package/src/validate/index.ts b/package/src/validate/index.ts index adeffee2..e87dd8f5 100644 --- a/package/src/validate/index.ts +++ b/package/src/validate/index.ts @@ -1,4 +1,4 @@ -export * from './isEmpty'; -export * from './isEqual'; -export * from './isPlainObject'; -export * from './isUrl'; +export * from "./isEmpty"; +export * from "./isEqual"; +export * from "./isPlainObject"; +export * from "./isUrl"; diff --git a/package/src/validate/isEmpty.ts b/package/src/validate/isEmpty.ts index bcdd690e..5077594d 100644 --- a/package/src/validate/isEmpty.ts +++ b/package/src/validate/isEmpty.ts @@ -28,7 +28,7 @@ export function isEmpty(value: string | object | null | undefined): boolean { return true; } - if (typeof value === 'string' || Array.isArray(value)) { + if (typeof value === "string" || Array.isArray(value)) { return value.length === 0; } @@ -36,7 +36,7 @@ export function isEmpty(value: string | object | null | undefined): boolean { return value.size === 0; } - if (typeof value === 'object') { + if (typeof value === "object") { return Object.keys(value).length === 0; } diff --git a/package/src/validate/isEqual.ts b/package/src/validate/isEqual.ts index 9ea5a78e..c06dff68 100644 --- a/package/src/validate/isEqual.ts +++ b/package/src/validate/isEqual.ts @@ -1,7 +1,7 @@ /* eslint-disable complexity */ -import type { PlainObject } from '@type/PlainObject.js'; +import type { PlainObject } from "@type/PlainObject.js"; -import { isPlainObject } from './isPlainObject.js'; +import { isPlainObject } from "./isPlainObject.js"; /** * Performs a deep comparison between two values to determine if they are diff --git a/package/src/validate/isPlainObject.ts b/package/src/validate/isPlainObject.ts index 16885971..cb69d02c 100644 --- a/package/src/validate/isPlainObject.ts +++ b/package/src/validate/isPlainObject.ts @@ -1,4 +1,4 @@ -import type { PlainObject } from '@type/PlainObject.js'; +import type { PlainObject } from "@type/PlainObject.js"; /** * Checks if the value is a plain object. diff --git a/package/test/array/chunk.test.ts b/package/test/array/chunk.test.ts index 75b45a87..1a068337 100644 --- a/package/test/array/chunk.test.ts +++ b/package/test/array/chunk.test.ts @@ -1,27 +1,27 @@ -import { describe, expect, it } from 'vitest'; +import { describe, expect, it } from "vitest"; -import { chunk } from '@array/chunk'; +import { chunk } from "@array/chunk"; -describe('Chunk', () => { +describe("Chunk", () => { const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - it('chunk an array', () => { + it("chunk an array", () => { expect(chunk(array, 2)).toEqual([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]); }); - it('return the last chunk as remaining elements', () => { + it("return the last chunk as remaining elements", () => { expect(chunk(array, 3)).toEqual([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]]); }); - it('coerce `size` to an integer', () => { + it("coerce `size` to an integer", () => { expect(chunk(array, array.length / 4)).toEqual([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]); }); - it('empty array on negative size', () => { + it("empty array on negative size", () => { expect(chunk(array, -1)).toEqual([]); }); - it('empty array', () => { + it("empty array", () => { expect(chunk([], 2)).toEqual([]); }); }); diff --git a/package/test/array/count.test.ts b/package/test/array/count.test.ts index d6ee9c91..f85138b5 100644 --- a/package/test/array/count.test.ts +++ b/package/test/array/count.test.ts @@ -1,24 +1,24 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect } from "vitest"; -import { count } from '@array/count'; +import { count } from "@array/count"; -describe('countBy function', () => { - test('countBy', () => { +describe("countBy function", () => { + test("countBy", () => { const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const even = (value: number) => (value % 2 === 0).toString(); const result = count(array, even); - expect(result).toEqual({ 'true': 5, 'false': 5 }); + expect(result).toEqual({ "true": 5, "false": 5 }); }); - test('countBy with object', () => { + test("countBy with object", () => { const array = [ - { 'user': 'barney', 'category': 1 }, - { 'user': 'thilo', 'category': 2 }, - { 'user': 'max', 'category': 2 }, - { 'user': 'lena', 'category': 3 } + { "user": "barney", "category": 1 }, + { "user": "thilo", "category": 2 }, + { "user": "max", "category": 2 }, + { "user": "lena", "category": 3 } ]; const result = count(array, (value) => value.category); - expect(result).toEqual({ '1': 1, '2': 2, '3': 1 }); + expect(result).toEqual({ "1": 1, "2": 2, "3": 1 }); }); }); diff --git a/package/test/array/difference.test.ts b/package/test/array/difference.test.ts index d8de4c9a..61f1f1d1 100644 --- a/package/test/array/difference.test.ts +++ b/package/test/array/difference.test.ts @@ -1,20 +1,20 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { difference } from '@array/difference'; +import { difference } from "@array/difference"; -describe('difference', () => { - test('return the difference between two arrays', () => { +describe("difference", () => { + test("return the difference between two arrays", () => { const array1 = [1, undefined, null, NaN, 3, 4, 5]; const array2 = [2, 4, undefined, NaN, null, 8]; const result = difference(array1, array2); expect(result).toEqual([1, 3, 5]); }); - test('return match based on input function', () => { + test("return match based on input function", () => { expect(difference([2.1, 1.2], [2.3, 3.4], [99], (a, b) => Math.floor(a) === Math.floor(b))).toEqual([1.2]); }); - test('return an array containing the elements that are present in the first array but not in the other arrays', () => { + test("return an array containing the elements that are present in the first array but not in the other arrays", () => { const array1 = [1, 2, 3, 4]; const array2 = [2, 3, 5, 6]; const array3 = [3, 4, 5, 6]; @@ -23,7 +23,7 @@ describe('difference', () => { expect(diff).toEqual([1]); }); - test('return an empty array if no elements are present in the first array but not in the other arrays', () => { + test("return an empty array if no elements are present in the first array but not in the other arrays", () => { const array1 = [1, 2, 3, 4]; const array2 = [1, 2]; const array3 = [3, 4]; @@ -32,7 +32,7 @@ describe('difference', () => { expect(diff).toEqual([]); }); - test('return the first array if no elements are present in the other arrays', () => { + test("return the first array if no elements are present in the other arrays", () => { const array1 = [1, 2, 3, 4]; const array2: number[] = []; @@ -40,7 +40,7 @@ describe('difference', () => { expect(diff).toEqual(array1); }); - test('can deal with different types', () => { + test("can deal with different types", () => { const diff = difference([{ id: 1 }, { id: 2 }], [1], (a, b) => a.id === b); expect(diff).toEqual([{ id: 2 }]); }); diff --git a/package/test/array/dropMethods.test.ts b/package/test/array/dropMethods.test.ts index f179fe3b..85bf5d4d 100644 --- a/package/test/array/dropMethods.test.ts +++ b/package/test/array/dropMethods.test.ts @@ -1,30 +1,30 @@ -import { it, expect, describe } from 'vitest'; +import { it, expect, describe } from "vitest"; -import { dropRightWhile } from '@array/dropRightWhile'; -import { dropWhile } from '@array/dropWhile'; +import { dropRightWhile } from "@array/dropRightWhile"; +import { dropWhile } from "@array/dropWhile"; const array = [2, 4, 5, 6]; -describe('dropWhile', () => { - it('removes elements from the start of the array until the predicate returns false', () => { +describe("dropWhile", () => { + it("removes elements from the start of the array until the predicate returns false", () => { expect(dropWhile(array, x => x % 2 === 0)).toEqual([5, 6]); }); - it('returns an empty array if the predicate always returns true', () => { + it("returns an empty array if the predicate always returns true", () => { expect(dropWhile(array, () => true)).toEqual([]); }); - it('returns the original array if the predicate always returns false', () => { + it("returns the original array if the predicate always returns false", () => { expect(dropWhile(array, () => false)).toEqual(array); }); - it('returns an empty array if the input array is empty', () => { + it("returns an empty array if the input array is empty", () => { expect(dropWhile([], () => true)).toEqual([]); }); }); -describe('dropRightWhile', () => { - it('drop elements while `predicate` returns truthy', () => { +describe("dropRightWhile", () => { + it("drop elements while `predicate` returns truthy", () => { expect(dropRightWhile(array, n => n > 4)).toEqual([2, 4]); }); }); diff --git a/package/test/array/group.test.ts b/package/test/array/group.test.ts index 03f942b3..f0b9048a 100644 --- a/package/test/array/group.test.ts +++ b/package/test/array/group.test.ts @@ -1,30 +1,30 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect } from "vitest"; -import { group } from '@array/group'; +import { group } from "@array/group"; -describe('groupBy', () => { - test('groups elements by evenness', () => { +describe("groupBy", () => { + test("groups elements by evenness", () => { const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const even = (value: number) => (value % 2 === 0).toString(); const result = group(array, even); - expect(result).toEqual({ 'true': [2, 4, 6, 8, 10], 'false': [1, 3, 5, 7, 9] }); + expect(result).toEqual({ "true": [2, 4, 6, 8, 10], "false": [1, 3, 5, 7, 9] }); }); - test('group an array by a property', () => { + test("group an array by a property", () => { const array = [ - { name: 'Alice', age: 30 }, - { name: 'Bob', age: 35 }, - { name: 'Charlie', age: 30 }, - { name: 'Dave', age: 40 }, - { name: 'Eve', age: 35 } + { name: "Alice", age: 30 }, + { name: "Bob", age: 35 }, + { name: "Charlie", age: 30 }, + { name: "Dave", age: 40 }, + { name: "Eve", age: 35 } ]; const result = group(array, element => element.age); expect(result).toEqual({ - 30: [{ name: 'Alice', age: 30 }, { name: 'Charlie', age: 30 }], - 35: [{ name: 'Bob', age: 35 }, { name: 'Eve', age: 35 }], - 40: [{ name: 'Dave', age: 40 }] + 30: [{ name: "Alice", age: 30 }, { name: "Charlie", age: 30 }], + 35: [{ name: "Bob", age: 35 }, { name: "Eve", age: 35 }], + 40: [{ name: "Dave", age: 40 }] }); }); }); diff --git a/package/test/array/intersection.test.ts b/package/test/array/intersection.test.ts index 4cc5625f..f7147b8f 100644 --- a/package/test/array/intersection.test.ts +++ b/package/test/array/intersection.test.ts @@ -1,9 +1,9 @@ -import { expect, test, describe } from 'vitest'; +import { expect, test, describe } from "vitest"; -import { intersection } from '@array/intersection'; +import { intersection } from "@array/intersection"; -describe('intersection', () => { - test('returns the correct intersections', () => { +describe("intersection", () => { + test("returns the correct intersections", () => { const arr1 = [1, 2, 3, 4, 5]; const arr2 = [3, 4, 5, 6, 7]; @@ -11,7 +11,7 @@ describe('intersection', () => { expect(result).toEqual([3, 4, 5]); }); - test('returns the correct intersections select special elements', () => { + test("returns the correct intersections select special elements", () => { const arr1 = [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }]; const arr2 = [{ id: 3 }, { id: 4 }, { id: 5 }, { id: 6 }, { id: 7 }]; @@ -19,7 +19,7 @@ describe('intersection', () => { expect(result).toEqual([{ id: 3 }, { id: 4 }, { id: 5 }]); }); - test('returns the correct intersections with comporator', () => { + test("returns the correct intersections with comporator", () => { const arr1 = [1, 2, 3, 4, 5]; const arr2 = [3, 4, 5, 6, 7]; @@ -27,7 +27,7 @@ describe('intersection', () => { expect(result).toEqual([4]); }); - test('returns unique values', () => { + test("returns unique values", () => { const arr1 = [1, 2, 3, 3, 4, 5]; const arr2 = [3, 4, 5, 6, 7]; const arr3 = [3, 4, 5, 6, 7]; @@ -36,7 +36,7 @@ describe('intersection', () => { expect(result).toEqual([3, 4, 5]); }); - test('handles 1 missing array', () => { + test("handles 1 missing array", () => { const arr1 = [1, 2, 3, 4, 5]; // @ts-expect-error - one array is missing @@ -44,7 +44,7 @@ describe('intersection', () => { expect(result).toEqual([]); }); - test('can deal with different types', () => { + test("can deal with different types", () => { const result = intersection([{ id: 1 }, { id: 2 }], [1], (a, b) => a.id === b); expect(result).toEqual([{ id: 1 }]); }); diff --git a/package/test/array/range.test.ts b/package/test/array/range.test.ts index eff50264..811242f3 100644 --- a/package/test/array/range.test.ts +++ b/package/test/array/range.test.ts @@ -1,26 +1,26 @@ -import { expect, test, describe } from 'vitest'; +import { expect, test, describe } from "vitest"; -import { range } from '@array/range.js'; +import { range } from "@array/range.js"; -describe('range', () => { - test('generate a sequence of numbers between start and end, inclusive, with increments of step', () => { +describe("range", () => { + test("generate a sequence of numbers between start and end, inclusive, with increments of step", () => { const result = [...range(1, 5)]; expect(result).toEqual([1, 2, 3, 4, 5]); }); - test('generate an array of even numbers between 0 and 10', () => { + test("generate an array of even numbers between 0 and 10", () => { const result = [...range(0, 10, 2)]; expect(result).toEqual([0, 2, 4, 6, 8, 10]); }); - test('throw an error if the start is greater than the end', () => { + test("throw an error if the start is greater than the end", () => { expect(() => [...range(5, 1)]).toThrowError(); }); - test('throw an error if the step is 0 or negative', () => { + test("throw an error if the step is 0 or negative", () => { expect(() => [...range(1, 5, 0)]).toThrowError(); expect(() => [...range(1, 5, -1)]).toThrowError(); }); diff --git a/package/test/array/shuffle.test.ts b/package/test/array/shuffle.test.ts index 729e9861..0f92aa94 100644 --- a/package/test/array/shuffle.test.ts +++ b/package/test/array/shuffle.test.ts @@ -1,17 +1,17 @@ -import { test, describe, expect } from 'vitest'; +import { test, describe, expect } from "vitest"; -import { shuffle } from '@array/shuffle'; +import { shuffle } from "@array/shuffle"; -describe('shuffle', () => { +describe("shuffle", () => { const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; - test('shuffle the elements of the array', () => { + test("shuffle the elements of the array", () => { const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; const shuffledArray = shuffle(array); expect(shuffledArray).not.toEqual(array); }); - test('not modify the original array', () => { + test("not modify the original array", () => { shuffle(array); expect(array).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); }); diff --git a/package/test/array/sort.test.ts b/package/test/array/sort.test.ts index b88bc74b..7341a330 100644 --- a/package/test/array/sort.test.ts +++ b/package/test/array/sort.test.ts @@ -1,36 +1,36 @@ -import { test, describe, expect } from 'vitest'; +import { test, describe, expect } from "vitest"; -import { sort } from '@array/sort'; +import { sort } from "@array/sort"; -describe('sort', () => { - test('sort the array in ascending order based on the iteratee function', () => { +describe("sort", () => { + test("sort the array in ascending order based on the iteratee function", () => { const numbers = [3, 1, 2]; - const sortedNumbers = sort(numbers, { order: 'asc' }); + const sortedNumbers = sort(numbers, { order: "asc" }); expect(sortedNumbers).toEqual([1, 2, 3]); }); - test('return the original array if it is already sorted', () => { + test("return the original array if it is already sorted", () => { const numbers = [1, 2, 3]; - const sortedNumbers = sort(numbers, { order: 'asc' }); + const sortedNumbers = sort(numbers, { order: "asc" }); expect(sortedNumbers).toEqual(numbers); }); - test('work with arrays of objects', () => { + test("work with arrays of objects", () => { const users = [ - { name: 'Alice', age: 30 }, - { name: 'Bob', age: 25 }, - { name: 'Eve', age: 35 } + { name: "Alice", age: 30 }, + { name: "Bob", age: 25 }, + { name: "Eve", age: 35 } ]; - const sortedUsers = sort(users, { order: 'desc', by: user => user.age }); + const sortedUsers = sort(users, { order: "desc", by: user => user.age }); expect(sortedUsers).toEqual([ - { name: 'Eve', age: 35 }, - { name: 'Alice', age: 30 }, - { name: 'Bob', age: 25 } + { name: "Eve", age: 35 }, + { name: "Alice", age: 30 }, + { name: "Bob", age: 25 } ]); }); - test('sort the array in descending order', () => { - const result = sort([1, 1, 1, 2, 3], { order: 'desc' }); + test("sort the array in descending order", () => { + const result = sort([1, 1, 1, 2, 3], { order: "desc" }); expect(result).toEqual([3, 2, 1, 1, 1]); }); }); diff --git a/package/test/array/takeMethods.test.ts b/package/test/array/takeMethods.test.ts index 24ff589f..49023c35 100644 --- a/package/test/array/takeMethods.test.ts +++ b/package/test/array/takeMethods.test.ts @@ -1,40 +1,40 @@ -import { test, expect, describe } from 'vitest'; +import { test, expect, describe } from "vitest"; -import { takeRightWhile } from '@array/takeRightWhile'; -import { takeWhile } from '@array/takeWhile'; +import { takeRightWhile } from "@array/takeRightWhile"; +import { takeWhile } from "@array/takeWhile"; -describe('takeWhile', () => { +describe("takeWhile", () => { const numbers = [2, 4, 5, 6, 7, 8, 9, 10]; - test('return the elements from the input array until the predicate returns false', () => { + test("return the elements from the input array until the predicate returns false", () => { const evenNumbers = takeWhile(numbers, (n) => n % 2 === 0); expect(evenNumbers).toEqual([2, 4]); }); - test('return an empty array if the predicate always returns false', () => { + test("return an empty array if the predicate always returns false", () => { const evenNumbers = takeWhile(numbers, (n) => n > 10); expect(evenNumbers).toEqual([]); }); - test('deal with different types', () => { - const mixed = [1, 2, 3, '4', 5, '6', 7, '8', 9, '10', [], {}, undefined]; - const evenNumbers = takeWhile(mixed, (n) => typeof n === 'number'); + test("deal with different types", () => { + const mixed = [1, 2, 3, "4", 5, "6", 7, "8", 9, "10", [], {}, undefined]; + const evenNumbers = takeWhile(mixed, (n) => typeof n === "number"); expect(evenNumbers).toEqual([1, 2, 3]); }); }); -describe('takeRightWhile', () => { +describe("takeRightWhile", () => { const numbers = [2, 3, 5, 7, 11, 14, 17, 19, 23, 29]; - test('return a new array with the last elements that satisfy the condition specified by the predicate function', () => { + test("return a new array with the last elements that satisfy the condition specified by the predicate function", () => { const result = takeRightWhile(numbers, n => n % 2 === 1); expect(result).toEqual([17, 19, 23, 29]); }); - test('return an empty array if no elements satisfy the condition', () => { + test("return an empty array if no elements satisfy the condition", () => { const result = takeRightWhile(numbers, (n: number) => n % 100 === 1); expect(result).toEqual([]); }); - test('return the original array if all elements satisfy the condition', () => { + test("return the original array if all elements satisfy the condition", () => { const result = takeRightWhile(numbers, () => true); expect(result).toEqual(numbers); }); diff --git a/package/test/array/unique.test.ts b/package/test/array/unique.test.ts index 26d2c6b0..476dce58 100644 --- a/package/test/array/unique.test.ts +++ b/package/test/array/unique.test.ts @@ -1,29 +1,29 @@ -import { test, expect, describe } from 'vitest'; +import { test, expect, describe } from "vitest"; -import { unique } from '@array/unique'; -import { isEqual } from '@validate/isEqual.js'; +import { unique } from "@array/unique"; +import { isEqual } from "@validate/isEqual.js"; -describe('unique', () => { - test('return an array with only unique values', () => { +describe("unique", () => { + test("return an array with only unique values", () => { const input = [1, 2, 3, 3, 4, 5, 5, 6]; const expectedOutput = [1, 2, 3, 4, 5, 6]; expect(unique(input)).toEqual(expectedOutput); }); - test('handle objects and arrays correctly', () => { + test("handle objects and arrays correctly", () => { const input = [{ a: 1 }, { a: 2 }, { a: 1 }, [1, 2], [1, 2], [1, 2, 3]]; const expectedOutput = [{ a: 1 }, { a: 2 }, [1, 2], [1, 2, 3]]; expect(unique(input, isEqual)).toEqual(expectedOutput); }); - test('hande compareFN', () => { + test("hande compareFN", () => { expect(unique([2, 1, 2])).toEqual([2, 1]); const users = [ - { id: 1, name: 'a' }, - { id: 1, name: 'c' } + { id: 1, name: "a" }, + { id: 1, name: "c" } ]; - expect(unique(users, (a, b) => a.id === b.id)).toEqual([{ id: 1, name: 'a' }]); + expect(unique(users, (a, b) => a.id === b.id)).toEqual([{ id: 1, name: "a" }]); }); }); diff --git a/package/test/crypto/hash.test.ts b/package/test/crypto/hash.test.ts index 54490e39..17ad3282 100644 --- a/package/test/crypto/hash.test.ts +++ b/package/test/crypto/hash.test.ts @@ -1,16 +1,16 @@ -import { test, describe, expect } from 'vitest'; +import { test, describe, expect } from "vitest"; -import { hash } from '@crypto/hash.js'; +import { hash } from "@crypto/hash.js"; -describe('hash', () => { - test('generate a hash from a string using the default algorithm (SHA-256)', async () => { - const hashValue = await hash('hello world'); - expect(hashValue).toEqual('b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'); +describe("hash", () => { + test("generate a hash from a string using the default algorithm (SHA-256)", async () => { + const hashValue = await hash("hello world"); + expect(hashValue).toEqual("b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"); }); - test('generate a hash from an object using the SHA-512 algorithm', async () => { - const data = { foo: 'bar', baz: 123 }; - const hashValue = await hash(data, 'SHA-512'); - expect(hashValue).toEqual('d8f3c752c6820e580977099368083f4266b569660558280f65494e39fe022e94ddf6f73037f9f83e67c868796c1c4a508d8d85952d04ccc7105fdbfda526e287'); + test("generate a hash from an object using the SHA-512 algorithm", async () => { + const data = { foo: "bar", baz: 123 }; + const hashValue = await hash(data, "SHA-512"); + expect(hashValue).toEqual("d8f3c752c6820e580977099368083f4266b569660558280f65494e39fe022e94ddf6f73037f9f83e67c868796c1c4a508d8d85952d04ccc7105fdbfda526e287"); }); }); \ No newline at end of file diff --git a/package/test/crypto/randomElem.test.ts b/package/test/crypto/randomElem.test.ts index 7d1de3c2..7f5380f7 100644 --- a/package/test/crypto/randomElem.test.ts +++ b/package/test/crypto/randomElem.test.ts @@ -1,26 +1,26 @@ -import { test, describe, expect } from 'vitest'; +import { test, describe, expect } from "vitest"; -import { randomElem } from '@crypto/randomElem'; +import { randomElem } from "@crypto/randomElem"; -describe('sample', () => { - test('sample function returns a random value from an array', () => { +describe("sample", () => { + test("sample function returns a random value from an array", () => { const collection = [1, 2, 3, 4, 5]; const result = randomElem(collection); expect(collection).toContain(result); }); - test('sample function returns undefined for an empty collection', () => { + test("sample function returns undefined for an empty collection", () => { const collection = [] as unknown[]; const result = randomElem(collection); expect(result).toBeUndefined(); }); - test('return an empty array if the input array is empty', () => { + test("return an empty array if the input array is empty", () => { const result = randomElem([], 3); expect(result).toEqual([]); }); - test('return a random subset of the input array', () => { + test("return a random subset of the input array", () => { const array = [1, 2, 3, 4, 5]; const result = randomElem([1, 2, 3, 4, 5], 3); expect(expect.arrayContaining(result)).toEqual(array); diff --git a/package/test/crypto/randomFloat.test.ts b/package/test/crypto/randomFloat.test.ts index de01c8d2..d06e0448 100644 --- a/package/test/crypto/randomFloat.test.ts +++ b/package/test/crypto/randomFloat.test.ts @@ -1,13 +1,13 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { randomFloat } from '@crypto/randomFloat.js'; +import { randomFloat } from "@crypto/randomFloat.js"; -describe('randomFloat', () => { - test('throw an error if min is greater than max', () => { +describe("randomFloat", () => { + test("throw an error if min is greater than max", () => { expect(() => randomFloat(10, 1)).toThrowError(); }); - test('return a number between min and max, including min and max', () => { + test("return a number between min and max, including min and max", () => { const min = 1; const max = 10; @@ -18,7 +18,7 @@ describe('randomFloat', () => { } }); - test('return a float', () => { + test("return a float", () => { const min = 1.1; const max = 10.1; @@ -30,7 +30,7 @@ describe('randomFloat', () => { } }); - test('can return the upper and lower bounds', () => { + test("can return the upper and lower bounds", () => { const min = 0; const max = Number.MIN_VALUE; @@ -44,7 +44,7 @@ describe('randomFloat', () => { expect(results).toContain(max); }); - test('average of 100000 random numbers should be close to the middle', () => { + test("average of 100000 random numbers should be close to the middle", () => { const min = 0; const max = 1; const iterations = 100000; diff --git a/package/test/crypto/randomInt.test.ts b/package/test/crypto/randomInt.test.ts index 8b7b6094..7c8e3faf 100644 --- a/package/test/crypto/randomInt.test.ts +++ b/package/test/crypto/randomInt.test.ts @@ -1,10 +1,10 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { randomInt } from '@crypto/randomInt.js'; +import { randomInt } from "@crypto/randomInt.js"; -describe('randomInt', () => { - test('return a number between min and max, including min and max', () => { +describe("randomInt", () => { + test("return a number between min and max, including min and max", () => { const min = 1; const max = 10; @@ -12,7 +12,7 @@ describe('randomInt', () => { expect(randomInt(min, max)).toBeLessThanOrEqual(max); }); - test('should return every number in between', () => { + test("should return every number in between", () => { const min = 1; const max = 5; const numbers = new Set(); @@ -25,18 +25,18 @@ describe('randomInt', () => { expect(numbers.has(max)).toBeTruthy(); }, { retry: 3 }); - test('return a different number each time', () => { + test("return a different number each time", () => { const min = 1; const max = 20; expect(randomInt(min, max)).not.toEqual(randomInt(min, max)); }, { retry: 3 }); - test('throw an error if min is greater than max', () => { + test("throw an error if min is greater than max", () => { expect(() => randomInt(10, 1)).toThrowError(); }); - test('average of 1000000 random numbers should be close to the middle', () => { + test("average of 1000000 random numbers should be close to the middle", () => { const min = 0; const max = 10; const iterations = 10000; @@ -52,11 +52,11 @@ describe('randomInt', () => { expect(average).toBeLessThanOrEqual(5 + 0.1); }, { retry: 3 }); - test('throw an error if min is not an integer', () => { + test("throw an error if min is not an integer", () => { expect(() => randomInt(1.1, 10)).toThrowError(); }); - test('throw an error if max is not an integer', () => { + test("throw an error if max is not an integer", () => { expect(() => randomInt(1, 10.1)).toThrowError(); }); }); \ No newline at end of file diff --git a/package/test/crypto/randomString.test.ts b/package/test/crypto/randomString.test.ts index ed8af63f..38e4fe94 100644 --- a/package/test/crypto/randomString.test.ts +++ b/package/test/crypto/randomString.test.ts @@ -1,26 +1,26 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { randomString } from '@crypto/randomString'; +import { randomString } from "@crypto/randomString"; -describe('generateRandomString', () => { - test('generate a random string of the specified length', () => { +describe("generateRandomString", () => { + test("generate a random string of the specified length", () => { expect(randomString(8)).toHaveLength(8); }); - test('use the provided charSet when generating the string', () => { - const charSet = 'abc'; + test("use the provided charSet when generating the string", () => { + const charSet = "abc"; expect(randomString(16, charSet)).toMatch(/^[a-c]+$/); }); - test('use the default charset when no charset is provided', () => { + test("use the default charset when no charset is provided", () => { expect(randomString(16)).toMatch(/^[\dA-Za-z]+$/); }); - test('return an empty string when the length is 0', () => { - expect(randomString(0)).toEqual(''); + test("return an empty string when the length is 0", () => { + expect(randomString(0)).toEqual(""); }); - test('return an empty string when the charset is empty', () => { - expect(randomString(16, '')).toEqual(''); + test("return an empty string when the charset is empty", () => { + expect(randomString(16, "")).toEqual(""); }); }); \ No newline at end of file diff --git a/package/test/decorator/toDecorator.test.ts b/package/test/decorator/toDecorator.test.ts index b7022da4..bfb67f08 100644 --- a/package/test/decorator/toDecorator.test.ts +++ b/package/test/decorator/toDecorator.test.ts @@ -1,9 +1,9 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { toDecorator } from '@decorator/toDecorator.js'; +import { toDecorator } from "@decorator/toDecorator.js"; -describe('toDecorator', () => { - test('decorator', () => { +describe("toDecorator", () => { + test("decorator", () => { function addToReturn(func: (...args: unknown[]) => number, number: number) { return function (this: unknown) { const orginalReturn = func.apply(this); @@ -14,7 +14,7 @@ describe('toDecorator', () => { const adder = toDecorator(addToReturn); class TestClass { - private count = '5'; + private count = "5"; @adder(6) testMethod() { diff --git a/package/test/function/debounce.test.ts b/package/test/function/debounce.test.ts index 2729aea8..d187096d 100644 --- a/package/test/function/debounce.test.ts +++ b/package/test/function/debounce.test.ts @@ -1,9 +1,9 @@ -import { afterEach, beforeAll, describe, expect, test, vi } from 'vitest'; +import { afterEach, beforeAll, describe, expect, test, vi } from "vitest"; -import { decDebounce } from '@decorator/decDebounce.js'; -import { debounce } from '@function/debounce'; +import { decDebounce } from "@decorator/decDebounce.js"; +import { debounce } from "@function/debounce"; -describe('debounce', () => { +describe("debounce", () => { const testFn = vi.fn((x: number) => x * 2); beforeAll(() => { @@ -14,7 +14,7 @@ describe('debounce', () => { testFn.mockClear(); }); - test('only calls the function once', () => { + test("only calls the function once", () => { const debounced = debounce(testFn, 100); debounced(1); @@ -30,7 +30,7 @@ describe('debounce', () => { expect(testFn).toHaveBeenCalledOnce(); }); - test('calls the function again after the wait period', () => { + test("calls the function again after the wait period", () => { const debounced = debounce(testFn, 100); debounced(1); @@ -46,7 +46,7 @@ describe('debounce', () => { expect(testFn).toHaveBeenCalledTimes(1); }); - test('decorator', () => { + test("decorator", () => { class TestClass { @decDebounce(100) testMethod(x: number) { @@ -61,7 +61,7 @@ describe('debounce', () => { expect(testFn).toHaveBeenCalledOnce(); }); - test('cancel', () => { + test("cancel", () => { const debounced = debounce(testFn, 100); debounced(1); @@ -70,7 +70,7 @@ describe('debounce', () => { expect(testFn).not.toHaveBeenCalled(); }); - test('flush', () => { + test("flush", () => { const debounced = debounce(testFn, 100); debounced(1); diff --git a/package/test/function/maxCalls.test.ts b/package/test/function/maxCalls.test.ts index fc1157c4..6dfc19ad 100644 --- a/package/test/function/maxCalls.test.ts +++ b/package/test/function/maxCalls.test.ts @@ -1,10 +1,10 @@ -import { describe, expect, test, vi } from 'vitest'; +import { describe, expect, test, vi } from "vitest"; -import { decMaxCalls } from '@decorator/decMaxCalls.js'; -import { maxCalls } from '@function/maxCalls'; +import { decMaxCalls } from "@decorator/decMaxCalls.js"; +import { maxCalls } from "@function/maxCalls"; -describe('maxCalls', () => { - test('only calls 3 times', () => { +describe("maxCalls", () => { + test("only calls 3 times", () => { const testFn = vi.fn(); const beforeFn = maxCalls(testFn, 3); @@ -18,7 +18,7 @@ describe('maxCalls', () => { expect(testFn).toHaveBeenCalledTimes(3); }); - test('decorator', () => { + test("decorator", () => { class TestClass { private count = 0; @decMaxCalls(2) diff --git a/package/test/function/memoize.test.ts b/package/test/function/memoize.test.ts index 7ccb5cc6..df6e99b6 100644 --- a/package/test/function/memoize.test.ts +++ b/package/test/function/memoize.test.ts @@ -1,9 +1,9 @@ -import { test, describe, expect, vi, beforeEach } from 'vitest'; +import { test, describe, expect, vi, beforeEach } from "vitest"; -import { decMemoize } from '@decorator/decMemoize.js'; -import { memoize } from '@function/memoize'; +import { decMemoize } from "@decorator/decMemoize.js"; +import { memoize } from "@function/memoize"; -describe('memoize', () => { +describe("memoize", () => { const testFn = vi.fn((a: number, b: number) => a + b); beforeEach(() => { @@ -11,7 +11,7 @@ describe('memoize', () => { }); - test('memoize a function', () => { + test("memoize a function", () => { const memoizedFunc = memoize(testFn); expect(memoizedFunc(1, 2)).to.equal(3); @@ -19,7 +19,7 @@ describe('memoize', () => { expect(testFn).toHaveBeenCalledOnce(); }); - test('return different results for different arguments', () => { + test("return different results for different arguments", () => { const memoizedFunc = memoize(testFn); expect(memoizedFunc(1, 2)).to.equal(3); @@ -27,12 +27,12 @@ describe('memoize', () => { expect(testFn).toHaveBeenCalledTimes(2); }); - test('expose a cache property', () => { + test("expose a cache property", () => { const memoizedFunc = memoize(testFn); expect(memoizedFunc.cache).to.be.an.instanceof(Map); }); - test('use a custom resolver', () => { + test("use a custom resolver", () => { const memoizedFunc = memoize(testFn, { resolver: (a: number, b: number) => (a + b).toString() }); expect(memoizedFunc(1, 2)).to.equal(3); @@ -40,7 +40,7 @@ describe('memoize', () => { expect(testFn).toHaveBeenCalledOnce(); }); - test('use a custom ttl', () => { + test("use a custom ttl", () => { vi.useFakeTimers(); const memoizedFunc = memoize(testFn, { ttl: 1000 }); @@ -57,7 +57,7 @@ describe('memoize', () => { expect(testFn).toHaveBeenCalledTimes(2); }); - test('decorator', () => { + test("decorator", () => { class TestClass { @decMemoize({ ttl: 1000 }) testMethod(a: number, b: number) { diff --git a/package/test/function/minCalls.test.ts b/package/test/function/minCalls.test.ts index ee078881..1028bde6 100644 --- a/package/test/function/minCalls.test.ts +++ b/package/test/function/minCalls.test.ts @@ -1,10 +1,10 @@ -import { describe, test, vi, expect } from 'vitest'; +import { describe, test, vi, expect } from "vitest"; -import { decMinCalls } from '@decorator/decMinCalls.js'; -import { minCalls } from '@function/minCalls'; +import { decMinCalls } from "@decorator/decMinCalls.js"; +import { minCalls } from "@function/minCalls"; -describe('after', () => { - test('after function works correctly', () => { +describe("after", () => { + test("after function works correctly", () => { const testFn = vi.fn(); const afterFn = minCalls(testFn, 2); @@ -18,7 +18,7 @@ describe('after', () => { expect(testFn).toHaveBeenCalledTimes(2); }); - test('decorator', () => { + test("decorator", () => { class TestClass { @decMinCalls(2) testMethod() { diff --git a/package/test/function/throttle.test.ts b/package/test/function/throttle.test.ts index a83e27a3..d82753e1 100644 --- a/package/test/function/throttle.test.ts +++ b/package/test/function/throttle.test.ts @@ -1,9 +1,9 @@ -import { beforeAll, beforeEach, describe, expect, test, vi } from 'vitest'; +import { beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; -import { decThrottle } from '@decorator/decThrottle.js'; -import { throttle } from '@function/throttle'; +import { decThrottle } from "@decorator/decThrottle.js"; +import { throttle } from "@function/throttle"; -describe('throttle', () => { +describe("throttle", () => { const callback = vi.fn(); beforeAll(() => { @@ -15,7 +15,7 @@ describe('throttle', () => { }); - test('only calls the function once', () => { + test("only calls the function once", () => { const throttled = throttle(callback, 100); @@ -34,7 +34,7 @@ describe('throttle', () => { expect(callback).toHaveBeenCalledTimes(2); }); - test('decorator', () => { + test("decorator", () => { class TestClass { @decThrottle(100) testMethod() { diff --git a/package/test/function/times.test.ts b/package/test/function/times.test.ts index f2f088fa..e5f48585 100644 --- a/package/test/function/times.test.ts +++ b/package/test/function/times.test.ts @@ -1,25 +1,25 @@ -import { describe, test, expect, vi, afterEach } from 'vitest'; +import { describe, test, expect, vi, afterEach } from "vitest"; -import { times } from '@function/times.js'; +import { times } from "@function/times.js"; -describe('times', () => { +describe("times", () => { const testFN = vi.fn((index: number) => index); afterEach(() => { testFN.mockClear(); }); - test('call the provided function the correct number of times', () => { + test("call the provided function the correct number of times", () => { times(testFN, 5); expect(testFN).toHaveBeenCalledTimes(5); }); - test('pass the correct index to the provided function', () => { + test("pass the correct index to the provided function", () => { const result = times(testFN, 5); expect(result).toEqual([0, 1, 2, 3, 4]); }); - test('handle a negative value for the first argument', () => { + test("handle a negative value for the first argument", () => { const result = times(testFN, -1); expect(result).toEqual([]); }); diff --git a/package/test/number/average.test.ts b/package/test/number/average.test.ts index 498a0bda..9acf78c0 100644 --- a/package/test/number/average.test.ts +++ b/package/test/number/average.test.ts @@ -1,29 +1,29 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { average } from '@number/average.js'; +import { average } from "@number/average.js"; -describe('average', () => { - test('return NaN when the input array is empty', () => { +describe("average", () => { + test("return NaN when the input array is empty", () => { expect(average([])).toBeNaN(); }); - test('return the average of an array of numbers', () => { + test("return the average of an array of numbers", () => { expect(average([1, 2, 3, 4, 5])).toBe(3); }); - test('return the average of a single number', () => { + test("return the average of a single number", () => { expect(average([5])).toBe(5); }); - test('return the average of a negative number', () => { + test("return the average of a negative number", () => { expect(average([-2])).toBe(-2); }); - test('return the average of a decimal number', () => { + test("return the average of a decimal number", () => { expect(average([3.14])).toBeCloseTo(3.14); }); - test('return the average of multiple decimal numbers', () => { + test("return the average of multiple decimal numbers", () => { expect(average([1.2, 3.4, 5.6])).toBeCloseTo(3.4); }); }); \ No newline at end of file diff --git a/package/test/number/median.test.ts b/package/test/number/median.test.ts index 90113a95..5337d779 100644 --- a/package/test/number/median.test.ts +++ b/package/test/number/median.test.ts @@ -1,29 +1,29 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { median } from '@number/median.js'; +import { median } from "@number/median.js"; -describe('median', () => { - test('return the median of an odd length array', () => { +describe("median", () => { + test("return the median of an odd length array", () => { expect(median([1, 2, 3, 4, 5])).toBe(3); }); - test('return the median of an even length array', () => { + test("return the median of an even length array", () => { expect(median([1, 2, 3, 4, 5, 6])).toBe(3.5); }); - test('return the median of a single element array', () => { + test("return the median of a single element array", () => { expect(median([1])).toBe(1); }); - test('return the median of a negative number array', () => { + test("return the median of a negative number array", () => { expect(median([-2, -4, -6])).toBe(-4); }); - test('return the median of a float number array', () => { + test("return the median of a float number array", () => { expect(median([2.5, 3.5, 4.5])).toBe(3.5); }); - test('throw an error when input is empty array', () => { + test("throw an error when input is empty array", () => { expect( median([])).toBe(NaN); }); }); \ No newline at end of file diff --git a/package/test/number/round.test.ts b/package/test/number/round.test.ts index 13714098..5e26858b 100644 --- a/package/test/number/round.test.ts +++ b/package/test/number/round.test.ts @@ -1,9 +1,9 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { round } from '@number/round.js'; +import { round } from "@number/round.js"; -describe('round', () => { - test('round a number to the given precision', () => { +describe("round", () => { + test("round a number to the given precision", () => { expect(round(1.23456, 2)).toBe(1.23); expect(round(1.235, 1)).toBe(1.2); expect(round(1234.56)).toBe(1234.56); diff --git a/package/test/number/sum.test.ts b/package/test/number/sum.test.ts index 14dbe63a..10282a8e 100644 --- a/package/test/number/sum.test.ts +++ b/package/test/number/sum.test.ts @@ -1,25 +1,25 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { sum } from '@number/sum.js'; +import { sum } from "@number/sum.js"; -describe('sum', () => { - test('calculate the sum of an array of numbers', () => { +describe("sum", () => { + test("calculate the sum of an array of numbers", () => { expect(sum([1, 2, 3, 4, 5])).toEqual(15); }); - test('return the value of a single-element array', () => { + test("return the value of a single-element array", () => { expect(sum([42])).toEqual(42); }); - test('handle negative numbers correctly', () => { + test("handle negative numbers correctly", () => { expect(sum([1, -2, 3])).toEqual(2); }); - test('handle floating point numbers correctly', () => { + test("handle floating point numbers correctly", () => { expect(sum([1.5, 2.5, 3.5])).toEqual(7.5); }); - test('is nan when input is an empty array', () => { + test("is nan when input is an empty array", () => { expect(sum([])).toBe(NaN); }); }); \ No newline at end of file diff --git a/package/test/object/flatKeys.test.ts b/package/test/object/flatKeys.test.ts index d52c9008..946f49f7 100644 --- a/package/test/object/flatKeys.test.ts +++ b/package/test/object/flatKeys.test.ts @@ -1,36 +1,36 @@ -import type { PlainObject } from '@type/PlainObject.js'; +import type { PlainObject } from "@type/PlainObject.js"; -import { describe, test, expect, expectTypeOf } from 'vitest'; +import { describe, test, expect, expectTypeOf } from "vitest"; -import { flatKeys } from '@object/flatKeys.js'; +import { flatKeys } from "@object/flatKeys.js"; -describe('flatKeys', () => { - test('correct flattened keys', () => { +describe("flatKeys", () => { + test("correct flattened keys", () => { const obj = { a: 1, b: { c: 2, d: { e: 3 } } }; const flat = flatKeys(obj); const flatGeneric = flatKeys(obj as PlainObject); - expectTypeOf(flat).toEqualTypeOf>(); + expectTypeOf(flat).toEqualTypeOf>(); expectTypeOf(flatGeneric).toEqualTypeOf>(); - expect(flatKeys(obj)).toEqual({ a: 1, 'b.c': 2, 'b.d.e': 3 }); + expect(flatKeys(obj)).toEqual({ a: 1, "b.c": 2, "b.d.e": 3 }); }); - test('correct flattened keys with arrays', () => { + test("correct flattened keys with arrays", () => { const obj = { a: 1, b: { c: 2, d: [{ e: 3 }, { e: 4, f: { g: 5 } }] } }; const flat = flatKeys(obj); - expectTypeOf(flat).toEqualTypeOf>(); - expect(flat).toEqual({ a: 1, 'b.c': 2, 'b.d[0].e': 3, 'b.d[1].e': 4, 'b.d[1].f.g': 5 }); + expectTypeOf(flat).toEqualTypeOf>(); + expect(flat).toEqual({ a: 1, "b.c": 2, "b.d[0].e": 3, "b.d[1].e": 4, "b.d[1].f.g": 5 }); }); - test('nested arrays', () => { + test("nested arrays", () => { const obj = { a: [[1, 2], [3, 4]] }; - expect(flatKeys(obj)).toEqual({ 'a[0][0]': 1, 'a[0][1]': 2, 'a[1][0]': 3, 'a[1][1]': 4 }); + expect(flatKeys(obj)).toEqual({ "a[0][0]": 1, "a[0][1]": 2, "a[1][0]": 3, "a[1][1]": 4 }); }); - test('simple array', () => { + test("simple array", () => { const obj = { a: [1, 2, 3, 4] }; - expect(flatKeys(obj)).toEqual({ 'a[0]': 1, 'a[1]': 2, 'a[2]': 3, 'a[3]': 4 }); + expect(flatKeys(obj)).toEqual({ "a[0]": 1, "a[1]": 2, "a[2]": 3, "a[3]": 4 }); }); }); diff --git a/package/test/object/merge.test.ts b/package/test/object/merge.test.ts index 5f73b60e..34af70a3 100644 --- a/package/test/object/merge.test.ts +++ b/package/test/object/merge.test.ts @@ -1,10 +1,10 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect } from "vitest"; -import { merge } from '@object/merge.js'; +import { merge } from "@object/merge.js"; -describe('merge', () => { - test('merge two or more objects', () => { +describe("merge", () => { + test("merge two or more objects", () => { const obj1 = { a: 1 }; const obj2 = { b: 2 }; const obj3 = { c: 3 }; @@ -17,19 +17,19 @@ describe('merge', () => { expect(merge(nestedObj1, nestedObj2)).toEqual({ a: { b: 1, c: 2 } }); }); - test('overwrites non objects', () => { + test("overwrites non objects", () => { const obj1 = { a: 1 }; const obj2 = { a: { b: 1 } }; expect(merge(obj1, obj2)).toEqual({ a: { b: 1 } }); const mixedTypes1 = { a: 1 }; - const mixedTypes2 = { a:'Yes' }; + const mixedTypes2 = { a:"Yes" }; - expect(merge(mixedTypes1, mixedTypes2)).toEqual({ a:'Yes' }); + expect(merge(mixedTypes1, mixedTypes2)).toEqual({ a:"Yes" }); }); - test('do not merge arrays', () => { + test("do not merge arrays", () => { const array1 = { a:[1, 2] }; const array2 = { a:[3, 4] }; diff --git a/package/test/object/omit.test.ts b/package/test/object/omit.test.ts index 14462a97..9262dc03 100644 --- a/package/test/object/omit.test.ts +++ b/package/test/object/omit.test.ts @@ -1,23 +1,23 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect } from "vitest"; -import { omit } from '@object/omit.js'; +import { omit } from "@object/omit.js"; -describe('omit', () => { - test('omit the specified keys from an object', () => { +describe("omit", () => { + test("omit the specified keys from an object", () => { const obj = { a: 1, b: 2, c: 3 }; - expect(omit(obj, ['a', 'c'])).toEqual({ b: 2 }); + expect(omit(obj, ["a", "c"])).toEqual({ b: 2 }); }); - test('not mutate the original object', () => { + test("not mutate the original object", () => { const obj = { a: 1, b: 2, c: 3 }; - expect(omit(obj, ['a', 'c'])).not.toBe(obj); + expect(omit(obj, ["a", "c"])).not.toBe(obj); }); - test('return an empty object if all keys are omitted', () => { + test("return an empty object if all keys are omitted", () => { const obj = { a: 1, b: 2, c: 3 }; - expect(omit(obj, ['a', 'b', 'c'])).toEqual({}); + expect(omit(obj, ["a", "b", "c"])).toEqual({}); }); }); \ No newline at end of file diff --git a/package/test/object/pick.test.ts b/package/test/object/pick.test.ts index 5c013e95..c736377f 100644 --- a/package/test/object/pick.test.ts +++ b/package/test/object/pick.test.ts @@ -1,25 +1,25 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect } from "vitest"; -import { pick } from '@object/pick.js'; +import { pick } from "@object/pick.js"; -describe('pick', () => { - test('pick the specified keys from an object', () => { +describe("pick", () => { + test("pick the specified keys from an object", () => { const object = { a: 1, b: 2, c: 3 }; - expect(pick(object, ['a', 'c'])).toEqual({ a: 1, c: 3 }); + expect(pick(object, ["a", "c"])).toEqual({ a: 1, c: 3 }); }); - test('return an empty object when no keys are specified', () => { + test("return an empty object when no keys are specified", () => { const object = { a: 1, b: 2, c: 3 }; expect(pick(object, [])).toEqual({}); }); - test('ignores non-existent keys', () => { + test("ignores non-existent keys", () => { const object = { a: 1, b: 2, c: 3 }; // @ts-expect-error - d does not exist on object - expect(pick(object, ['a', 'd'])).toEqual({ a: 1 }); + expect(pick(object, ["a", "d"])).toEqual({ a: 1 }); }); }); \ No newline at end of file diff --git a/package/test/object/set.test.ts b/package/test/object/set.test.ts index 9e9776ef..22168424 100644 --- a/package/test/object/set.test.ts +++ b/package/test/object/set.test.ts @@ -1,44 +1,44 @@ -import { describe, test, expect, expectTypeOf } from 'vitest'; +import { describe, test, expect, expectTypeOf } from "vitest"; -import { set } from '@object/set.js'; +import { set } from "@object/set.js"; -describe('set', () => { - test('set a value', () => { +describe("set", () => { + test("set a value", () => { const obj = { a: { b: 2 } }; - const updatedObj = set(obj, 'a.c', 1); + const updatedObj = set(obj, "a.c", 1); expectTypeOf(updatedObj).toEqualTypeOf<{ a: { b: number; c: number } }>(); expect(obj).toEqual({ a: { b: 2, c: 1 } }); }); - test('set a value with array path', () => { + test("set a value with array path", () => { const obj = { a: { b: 2, c: [1, 2] } }; - set(obj, 'a.c[2]', 1); + set(obj, "a.c[2]", 1); expect(obj).toEqual({ a: { b: 2, c: [1, 2, 1] } }); - set(obj, 'a.d[0].c', 3); + set(obj, "a.d[0].c", 3); expect(obj).toEqual({ a: { b: 2, c: [1, 2, 1], d: [{ c: 3 }] } }); - set(obj, 'a[0].c', 3); + set(obj, "a[0].c", 3); expect(obj).toEqual({ a: [{ c: 3 }] }); }); - test('recognise number key', () => { + test("recognise number key", () => { const obj = { a: 1 }; - const updatedObj = set(obj, 'a[0]', 4); + const updatedObj = set(obj, "a[0]", 4); expectTypeOf(updatedObj).toEqualTypeOf<{ a: number[] }>(); expect(obj).toEqual({ a: { e0: [1] } }); }); - test('throw error on incorrect path format', () => { + test("throw error on incorrect path format", () => { const obj = { a: { b: 2 } }; - expect(() => set(obj, 'a.c[1', 1)).toThrow(); - expect(() => set(obj, 'a.c.', 1)).toThrow(); + expect(() => set(obj, "a.c[1", 1)).toThrow(); + expect(() => set(obj, "a.c.", 1)).toThrow(); }); - test('allow _ and $ in path', () => { + test("allow _ and $ in path", () => { const obj = { a: { b: 2 } }; - expect(() => set(obj, 'a.c_1', 1)).not.toThrow(); - expect(() => set(obj, 'a.c-$1', 1)).not.toThrow(); + expect(() => set(obj, "a.c_1", 1)).not.toThrow(); + expect(() => set(obj, "a.c-$1", 1)).not.toThrow(); }); }); \ No newline at end of file diff --git a/package/test/promise/queue.test.ts b/package/test/promise/queue.test.ts index 7b823627..d3a50d34 100644 --- a/package/test/promise/queue.test.ts +++ b/package/test/promise/queue.test.ts @@ -1,12 +1,12 @@ -import type { Mock } from 'vitest'; +import type { Mock } from "vitest"; -import { describe, test, expect, beforeEach, vi } from 'vitest'; +import { describe, test, expect, beforeEach, vi } from "vitest"; -import { Queue } from '@promise/queue.js'; -import { sleep } from '@promise/sleep.js'; +import { Queue } from "@promise/queue.js"; +import { sleep } from "@promise/sleep.js"; -describe('Queue', () => { +describe("Queue", () => { let queue: Queue; const createAsync = (mockFn: Mock<[], string>) => async () => { @@ -14,9 +14,9 @@ describe('Queue', () => { return mockFn(); }; - const callbackMock = vi.fn(() => 'resolved1'); - const callbackMock2 = vi.fn(() => 'resolved2'); - const callbackMock3 = vi.fn(() => 'resolved3'); + const callbackMock = vi.fn(() => "resolved1"); + const callbackMock2 = vi.fn(() => "resolved2"); + const callbackMock3 = vi.fn(() => "resolved3"); beforeEach(() => { queue = new Queue(2); @@ -25,13 +25,13 @@ describe('Queue', () => { callbackMock3.mockClear(); }); - test('add a promise to the queue', async () => { + test("add a promise to the queue", async () => { const result = await queue.add(createAsync(callbackMock)); expect(callbackMock).toHaveBeenCalledOnce(); - expect(result).toBe('resolved1'); + expect(result).toBe("resolved1"); }); - test('add an array of asyncs to the queue', async () => { + test("add an array of asyncs to the queue", async () => { const results = queue.add([createAsync(callbackMock), createAsync(callbackMock2)]); await sleep(10); @@ -41,9 +41,9 @@ describe('Queue', () => { await sleep(10); expect(callbackMock).toHaveBeenCalledOnce(); expect(callbackMock2).toHaveBeenCalledOnce(); - expect(await results).toEqual(['resolved1', 'resolved2']); + expect(await results).toEqual(["resolved1", "resolved2"]); }); - test('pause the execution of the promises in the queue', async () => { + test("pause the execution of the promises in the queue", async () => { queue.pause(); void queue.add(createAsync(callbackMock)); await sleep(20); @@ -53,7 +53,7 @@ describe('Queue', () => { await sleep(20); expect(callbackMock).toHaveBeenCalled(); }); - test('clear the queue', async () => { + test("clear the queue", async () => { queue.pause(); // eslint-disable-next-line @typescript-eslint/no-empty-function queue.add([createAsync(callbackMock), createAsync(callbackMock2)]).catch(() => {}); @@ -64,7 +64,7 @@ describe('Queue', () => { expect(callbackMock2).not.toHaveBeenCalled(); }); - test('return the number of promises in the queue', () => { + test("return the number of promises in the queue", () => { queue.pause(); expect(queue.getQueue().length).toBe(0); void queue.add(createAsync(callbackMock)); @@ -73,7 +73,7 @@ describe('Queue', () => { expect(queue.getQueue().length).toBe(2); }); - test('do not run more then the specified number of tasks', async () => { + test("do not run more then the specified number of tasks", async () => { void queue.add(createAsync(callbackMock)); void queue.add(createAsync(callbackMock2)); void queue.add(createAsync(callbackMock3)); @@ -88,9 +88,9 @@ describe('Queue', () => { expect(callbackMock3).toHaveBeenCalledOnce(); }); - test('handle rejected promises', async () => { - const callbackMock4 = vi.fn(() => Promise.reject('rejected')); - await expect(queue.add(callbackMock4)).rejects.toBe('rejected'); + test("handle rejected promises", async () => { + const callbackMock4 = vi.fn(() => Promise.reject("rejected")); + await expect(queue.add(callbackMock4)).rejects.toBe("rejected"); expect(callbackMock4).toHaveBeenCalledOnce(); }); }); \ No newline at end of file diff --git a/package/test/promise/races.test.ts b/package/test/promise/races.test.ts index caf1b026..4c7b5d2f 100644 --- a/package/test/promise/races.test.ts +++ b/package/test/promise/races.test.ts @@ -1,28 +1,28 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect } from "vitest"; -import { races } from '@promise/races.js'; +import { races } from "@promise/races.js"; -describe('describe', () => { +describe("describe", () => { const delayedPromise = (delay: number) => new Promise((resolve) => { setTimeout(() => { resolve(delay); }, delay); }); - test('resolve the first 2 promises', async () => { + test("resolve the first 2 promises", async () => { const result = await races(2, delayedPromise(20), delayedPromise(40), delayedPromise(60)); expect(result).toEqual([20, 40]); }); - test('handle higher waitFor then promises', async () => { + test("handle higher waitFor then promises", async () => { const result = await races(2, delayedPromise(20)); expect(result).toEqual([20]); }); - test('rejected promise', async () => { + test("rejected promise", async () => { const rejectedPromise = new Promise((resolve, reject) => { - setTimeout(() => reject('rejected'), 20); + setTimeout(() => reject("rejected"), 20); }); - await expect(races(2, delayedPromise(20), rejectedPromise, delayedPromise(60))).rejects.toBe('rejected'); + await expect(races(2, delayedPromise(20), rejectedPromise, delayedPromise(60))).rejects.toBe("rejected"); }); }); \ No newline at end of file diff --git a/package/test/promise/retry.test.ts b/package/test/promise/retry.test.ts index 45bb883f..461592d3 100644 --- a/package/test/promise/retry.test.ts +++ b/package/test/promise/retry.test.ts @@ -1,55 +1,55 @@ -import { describe, test, expect, vi } from 'vitest'; +import { describe, test, expect, vi } from "vitest"; -import { retry } from '@promise/retry.js'; +import { retry } from "@promise/retry.js"; -describe('retry', () => { +describe("retry", () => { - test('retry until successful', async () => { + test("retry until successful", async () => { const mockFn = vi.fn() - .mockRejectedValueOnce(new Error('error 1')) - .mockResolvedValueOnce('success'); + .mockRejectedValueOnce(new Error("error 1")) + .mockResolvedValueOnce("success"); const result = await retry(mockFn); expect(mockFn).toHaveBeenCalledTimes(2); - expect(result).toEqual('success'); + expect(result).toEqual("success"); }); - test('retry with custom backoff function', async () => { + test("retry with custom backoff function", async () => { const mockFn = vi.fn() - .mockRejectedValueOnce(new Error('error 1')) - .mockRejectedValueOnce(new Error('error 2')) - .mockResolvedValueOnce('success'); + .mockRejectedValueOnce(new Error("error 1")) + .mockRejectedValueOnce(new Error("error 2")) + .mockResolvedValueOnce("success"); const backoff = vi.fn().mockImplementation(retries => retries * 10); const result = await retry(mockFn, { maxRetries: 2, backoff }); - expect(result).toEqual('success'); + expect(result).toEqual("success"); expect(mockFn).toHaveBeenCalledTimes(3); expect(backoff).toHaveBeenNthCalledWith(1, 1); expect(backoff).toHaveBeenNthCalledWith(2, 2); }); - test('stop retrying after reaching max retries', async () => { - const mockFailFn = vi.fn().mockRejectedValue(new Error('error')); - await expect(retry(mockFailFn, { maxRetries: 1, backoff: () => 10 })).rejects.toThrow('error'); + test("stop retrying after reaching max retries", async () => { + const mockFailFn = vi.fn().mockRejectedValue(new Error("error")); + await expect(retry(mockFailFn, { maxRetries: 1, backoff: () => 10 })).rejects.toThrow("error"); expect(mockFailFn).toHaveBeenCalledTimes(2); }); - test('call onRetry callback when retrying', async () => { + test("call onRetry callback when retrying", async () => { const mockFn = vi.fn() - .mockRejectedValueOnce(new Error('error 1')) - .mockRejectedValueOnce(new Error('error 2')) - .mockResolvedValueOnce('success'); + .mockRejectedValueOnce(new Error("error 1")) + .mockRejectedValueOnce(new Error("error 2")) + .mockResolvedValueOnce("success"); const onRetry = vi.fn(); const result = await retry(mockFn, { maxRetries: 2, onRetry, backoff: () => 10 }); - expect(result).toEqual('success'); + expect(result).toEqual("success"); expect(mockFn).toHaveBeenCalledTimes(3); expect(onRetry).toHaveBeenNthCalledWith(1, expect.any(Error), 1); expect(onRetry).toHaveBeenNthCalledWith(2, expect.any(Error), 2); diff --git a/package/test/promise/sleep.test.ts b/package/test/promise/sleep.test.ts index 2a1873e3..64dd3364 100644 --- a/package/test/promise/sleep.test.ts +++ b/package/test/promise/sleep.test.ts @@ -1,9 +1,9 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect } from "vitest"; -import { sleep } from '@promise/sleep.js'; +import { sleep } from "@promise/sleep.js"; -describe('sleep', () => { - test('resolve after the specified time', async () => { +describe("sleep", () => { + test("resolve after the specified time", async () => { const startTime = Date.now(); await sleep(100); // 99 because setTimeout is not 100% accurate diff --git a/package/test/promise/timeout.test.ts b/package/test/promise/timeout.test.ts index c84b5a4c..a1dc1316 100644 --- a/package/test/promise/timeout.test.ts +++ b/package/test/promise/timeout.test.ts @@ -1,31 +1,31 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect } from "vitest"; -import { sleep } from '@promise/sleep.js'; -import { timeout } from '@promise/timeout.js'; +import { sleep } from "@promise/sleep.js"; +import { timeout } from "@promise/timeout.js"; -describe('timeout', () => { - test('timeout', async () => { +describe("timeout", () => { + test("timeout", async () => { const result = await timeout(sleep(20), 50); expect(result).toBeUndefined(); }); - test('timeout with rejected promise', async () => { + test("timeout with rejected promise", async () => { try { await timeout(sleep(100), 50); } catch (error) { const err = error as Error; - expect(err.message).toBe('Promise timed out after 50ms'); + expect(err.message).toBe("Promise timed out after 50ms"); } }); - test('rejected promise', async () => { + test("rejected promise", async () => { try { - await timeout(Promise.reject('rejected'), 50); + await timeout(Promise.reject("rejected"), 50); } catch (error) { const err = error as Error; - expect(err).toBe('rejected'); + expect(err).toBe("rejected"); } }); }); \ No newline at end of file diff --git a/package/test/promise/tryCatch.test.ts b/package/test/promise/tryCatch.test.ts index e94b06af..e2d56c70 100644 --- a/package/test/promise/tryCatch.test.ts +++ b/package/test/promise/tryCatch.test.ts @@ -1,10 +1,10 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { tryCatch } from '@promise/tryCatch'; +import { tryCatch } from "@promise/tryCatch"; -describe('tryCatch', () => { - test('resolve to an array with the result and null error if the promise resolves', async () => { - const result = 'Hello, world!'; +describe("tryCatch", () => { + test("resolve to an array with the result and null error if the promise resolves", async () => { + const result = "Hello, world!"; const promise = Promise.resolve(result); const [data, error] = await tryCatch(promise); @@ -13,8 +13,8 @@ describe('tryCatch', () => { expect(error).toBeUndefined(); }); - test('resolve to an array with undefined result and an error object if the promise rejects', async () => { - const error = new Error('Oops!'); + test("resolve to an array with undefined result and an error object if the promise rejects", async () => { + const error = new Error("Oops!"); const promise = Promise.reject(error); const [data, actualError] = await tryCatch(promise); @@ -24,7 +24,7 @@ describe('tryCatch', () => { expect(actualError?.message).toEqual(error.message); }); - test('re-throw non-Error exceptions', async () => { + test("re-throw non-Error exceptions", async () => { const promise = Promise.reject(123); await expect(tryCatch(promise)).rejects.toBe(123); diff --git a/package/test/string/camelCase.test.ts b/package/test/string/camelCase.test.ts index 83fa1459..457bcaec 100644 --- a/package/test/string/camelCase.test.ts +++ b/package/test/string/camelCase.test.ts @@ -1,13 +1,13 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { camelCase } from '@string/camelCase'; +import { camelCase } from "@string/camelCase"; -describe('camelCase', () => { - test('convert a string to camel case', () => { - expect(camelCase('Foo Bar')).toBe('fooBar'); - expect(camelCase('fooBar')).toBe('fooBar'); - expect(camelCase('FooBar')).toBe('fooBar'); - expect(camelCase('--foo-bar--')).toBe('fooBar'); - expect(camelCase('__FOO_BAR__')).toBe('fooBar'); +describe("camelCase", () => { + test("convert a string to camel case", () => { + expect(camelCase("Foo Bar")).toBe("fooBar"); + expect(camelCase("fooBar")).toBe("fooBar"); + expect(camelCase("FooBar")).toBe("fooBar"); + expect(camelCase("--foo-bar--")).toBe("fooBar"); + expect(camelCase("__FOO_BAR__")).toBe("fooBar"); }); }); diff --git a/package/test/string/capitalize.test.ts b/package/test/string/capitalize.test.ts index 66b29c2f..5eb0affc 100644 --- a/package/test/string/capitalize.test.ts +++ b/package/test/string/capitalize.test.ts @@ -1,17 +1,17 @@ -import { expect, test, describe } from 'vitest'; +import { expect, test, describe } from "vitest"; -import { capitalize } from '@string/capitalize'; +import { capitalize } from "@string/capitalize"; -describe('capitalize', () => { - test('capitalizes the first letter of a string', () => { - expect(capitalize('hello world')).toBe('Hello world'); +describe("capitalize", () => { + test("capitalizes the first letter of a string", () => { + expect(capitalize("hello world")).toBe("Hello world"); }); - test('returns an empty string for an empty input', () => { - expect(capitalize('')).toBe(''); + test("returns an empty string for an empty input", () => { + expect(capitalize("")).toBe(""); }); - test('deal with 1 letter', () => { - expect(capitalize('a')).toBe('A'); + test("deal with 1 letter", () => { + expect(capitalize("a")).toBe("A"); }); }); diff --git a/package/test/string/deburr.test.ts b/package/test/string/deburr.test.ts index 871a1e2c..961c3a5f 100644 --- a/package/test/string/deburr.test.ts +++ b/package/test/string/deburr.test.ts @@ -1,16 +1,16 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { deburr } from '@string/deburr'; +import { deburr } from "@string/deburr"; -describe('deburr', () => { - test('removes diacritics from a string', () => { - expect(deburr('Mëtàl Hëàd')).toEqual('Metal Head'); - expect(deburr('Pokémón')).toEqual('Pokemon'); - expect(deburr('résumé')).toEqual('resume'); +describe("deburr", () => { + test("removes diacritics from a string", () => { + expect(deburr("Mëtàl Hëàd")).toEqual("Metal Head"); + expect(deburr("Pokémón")).toEqual("Pokemon"); + expect(deburr("résumé")).toEqual("resume"); }); - test('returns the input string if it has no diacritics', () => { - expect(deburr('hello')).toEqual('hello'); - expect(deburr('world')).toEqual('world'); + test("returns the input string if it has no diacritics", () => { + expect(deburr("hello")).toEqual("hello"); + expect(deburr("world")).toEqual("world"); }); }); diff --git a/package/test/string/escapeHtml.test.ts b/package/test/string/escapeHtml.test.ts index 402f1055..233e1601 100644 --- a/package/test/string/escapeHtml.test.ts +++ b/package/test/string/escapeHtml.test.ts @@ -1,16 +1,16 @@ -import { expect, test, describe } from 'vitest'; +import { expect, test, describe } from "vitest"; -import { escapeHtml } from '@string/escapeHtml'; +import { escapeHtml } from "@string/escapeHtml"; -describe('escapeToHTML', () => { - test('escape special characters to HTML entities', () => { - const str = '

Hello, World!

'; +describe("escapeToHTML", () => { + test("escape special characters to HTML entities", () => { + const str = "

Hello, World!

"; const html = escapeHtml(str); - expect(html).toBe('<p>Hello, World!</p>'); + expect(html).toBe("<p>Hello, World!</p>"); }); - test('return the original string if it does not contain special characters', () => { - const str = 'Hello, World!'; + test("return the original string if it does not contain special characters", () => { + const str = "Hello, World!"; const html = escapeHtml(str); expect(html).toBe(str); }); diff --git a/package/test/string/escapeRegExp.test.ts b/package/test/string/escapeRegExp.test.ts index e15edab0..e82d7900 100644 --- a/package/test/string/escapeRegExp.test.ts +++ b/package/test/string/escapeRegExp.test.ts @@ -1,18 +1,18 @@ -import { expect, test, describe } from 'vitest'; +import { expect, test, describe } from "vitest"; -import { escapeRegExp } from '@string/escapeRegExp'; +import { escapeRegExp } from "@string/escapeRegExp"; -describe('escapeRegExp', () => { - test('escapes special characters in a string', () => { - expect(escapeRegExp('hello.world*')).toBe('hello\\.world\\*'); - expect(escapeRegExp('[lodash](https://lodash.com/)')).toBe('\\[lodash\\]\\(https://lodash\\.com/\\)'); +describe("escapeRegExp", () => { + test("escapes special characters in a string", () => { + expect(escapeRegExp("hello.world*")).toBe("hello\\.world\\*"); + expect(escapeRegExp("[lodash](https://lodash.com/)")).toBe("\\[lodash\\]\\(https://lodash\\.com/\\)"); }); - test('returns an empty string for an empty input', () => { - expect(escapeRegExp('')).toBe(''); + test("returns an empty string for an empty input", () => { + expect(escapeRegExp("")).toBe(""); }); - test('returns the original string for a string without special characters', () => { - expect(escapeRegExp('hello world')).toBe('hello world'); + test("returns the original string for a string without special characters", () => { + expect(escapeRegExp("hello world")).toBe("hello world"); }); }); diff --git a/package/test/string/kebabCase.test.ts b/package/test/string/kebabCase.test.ts index 17eb6741..0f237b1f 100644 --- a/package/test/string/kebabCase.test.ts +++ b/package/test/string/kebabCase.test.ts @@ -1,18 +1,18 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { kebabCase } from '@string/kebabCase'; +import { kebabCase } from "@string/kebabCase"; -describe('kebabCase', () => { - test('converts a string to kebab case', () => { - expect(kebabCase('helloWorld')).toBe('hello-world'); - expect(kebabCase('helloCRUELWorld')).toBe('hello-cruel-world'); +describe("kebabCase", () => { + test("converts a string to kebab case", () => { + expect(kebabCase("helloWorld")).toBe("hello-world"); + expect(kebabCase("helloCRUELWorld")).toBe("hello-cruel-world"); }); - test('returns an empty string for an empty input', () => { - expect(kebabCase('')).toBe(''); + test("returns an empty string for an empty input", () => { + expect(kebabCase("")).toBe(""); }); - test('returns the original string for a single-word string', () => { - expect(kebabCase('hello')).toBe('hello'); + test("returns the original string for a single-word string", () => { + expect(kebabCase("hello")).toBe("hello"); }); }); diff --git a/package/test/string/pascalCase.test.ts b/package/test/string/pascalCase.test.ts index 39ba80d6..9c3c73ab 100644 --- a/package/test/string/pascalCase.test.ts +++ b/package/test/string/pascalCase.test.ts @@ -1,16 +1,16 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { pascalCase } from '@string/pascalCase'; +import { pascalCase } from "@string/pascalCase"; -describe('toPascalCase', () => { - test('converts a string to PascalCase', () => { - expect(pascalCase('hello world')).toEqual('HelloWorld'); - expect(pascalCase('this is a.test')).toEqual('ThisIsATest'); - expect(pascalCase('camelCase')).toEqual('CamelCase'); +describe("toPascalCase", () => { + test("converts a string to PascalCase", () => { + expect(pascalCase("hello world")).toEqual("HelloWorld"); + expect(pascalCase("this is a.test")).toEqual("ThisIsATest"); + expect(pascalCase("camelCase")).toEqual("CamelCase"); }); - test('handles empty strings and single words correctly', () => { - expect(pascalCase('')).toEqual(''); - expect(pascalCase('hello')).toEqual('Hello'); + test("handles empty strings and single words correctly", () => { + expect(pascalCase("")).toEqual(""); + expect(pascalCase("hello")).toEqual("Hello"); }); }); diff --git a/package/test/string/snakeCase.test.ts b/package/test/string/snakeCase.test.ts index 70c17ebb..906ebcf8 100644 --- a/package/test/string/snakeCase.test.ts +++ b/package/test/string/snakeCase.test.ts @@ -1,20 +1,20 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { snakeCase } from '@string/snakeCase'; +import { snakeCase } from "@string/snakeCase"; -describe('snakeCase', () => { - test('converts a string to snake_case', () => { - expect(snakeCase('someString')).toBe('some_string'); - expect(snakeCase('someOtherString')).toBe('some_other_string'); - expect(snakeCase('someStringWithCamelCase')).toBe('some_string_with_camel_case'); - expect(snakeCase('someCRUELWorld')).toBe('some_cruel_world'); +describe("snakeCase", () => { + test("converts a string to snake_case", () => { + expect(snakeCase("someString")).toBe("some_string"); + expect(snakeCase("someOtherString")).toBe("some_other_string"); + expect(snakeCase("someStringWithCamelCase")).toBe("some_string_with_camel_case"); + expect(snakeCase("someCRUELWorld")).toBe("some_cruel_world"); }); - test('handles strings that are already in snake_case', () => { - expect(snakeCase('some_string')).toBe('some_string'); + test("handles strings that are already in snake_case", () => { + expect(snakeCase("some_string")).toBe("some_string"); }); - test('handles empty strings', () => { - expect(snakeCase('')).toBe(''); + test("handles empty strings", () => { + expect(snakeCase("")).toBe(""); }); }); diff --git a/package/test/string/splitWords.test.ts b/package/test/string/splitWords.test.ts index 8d28eaa0..6e54987b 100644 --- a/package/test/string/splitWords.test.ts +++ b/package/test/string/splitWords.test.ts @@ -1,28 +1,28 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { splitWords } from '@string/splitWords.js'; +import { splitWords } from "@string/splitWords.js"; // Unit Test -describe('splitWords()', () => { - test('split camelCase into two words', () => { - expect(splitWords('camelCase')).toEqual(['camel', 'Case']); +describe("splitWords()", () => { + test("split camelCase into two words", () => { + expect(splitWords("camelCase")).toEqual(["camel", "Case"]); }); - test('split PascalCase into two words', () => { - expect(splitWords('PascalCase')).toEqual(['Pascal', 'Case']); + test("split PascalCase into two words", () => { + expect(splitWords("PascalCase")).toEqual(["Pascal", "Case"]); }); - test('split a string with non-alphanumeric characters into multiple words', () => { - expect(splitWords('hello_world-123')).toEqual(['hello', 'world', '123']); + test("split a string with non-alphanumeric characters into multiple words", () => { + expect(splitWords("hello_world-123")).toEqual(["hello", "world", "123"]); }); - test('return an empty array for an empty string', () => { - expect(splitWords('')).toEqual([]); + test("return an empty array for an empty string", () => { + expect(splitWords("")).toEqual([]); }); - test('return an array with one element for a single word string', () => { - expect(splitWords('hello')).toEqual(['hello']); + test("return an array with one element for a single word string", () => { + expect(splitWords("hello")).toEqual(["hello"]); }); }); \ No newline at end of file diff --git a/package/test/string/titleCase.test.ts b/package/test/string/titleCase.test.ts index 4284aa6f..17863529 100644 --- a/package/test/string/titleCase.test.ts +++ b/package/test/string/titleCase.test.ts @@ -1,14 +1,14 @@ -import { expect, test, describe } from 'vitest'; +import { expect, test, describe } from "vitest"; -import { titleCase } from '@string/titleCase'; +import { titleCase } from "@string/titleCase"; -describe('titleCase', () => { - test('convert a string to start case', () => { - expect(titleCase('hello world')).toBe('Hello World'); - expect(titleCase('HELLO WORLD')).toBe('Hello World'); - expect(titleCase('Hello World')).toBe('Hello World'); - expect(titleCase('hello-world')).toBe('Hello World'); - expect(titleCase('hello_world')).toBe('Hello World'); - expect(titleCase('hello world')).toBe('Hello World'); +describe("titleCase", () => { + test("convert a string to start case", () => { + expect(titleCase("hello world")).toBe("Hello World"); + expect(titleCase("HELLO WORLD")).toBe("Hello World"); + expect(titleCase("Hello World")).toBe("Hello World"); + expect(titleCase("hello-world")).toBe("Hello World"); + expect(titleCase("hello_world")).toBe("Hello World"); + expect(titleCase("hello world")).toBe("Hello World"); }); }); diff --git a/package/test/string/unescapeHtml.test.ts b/package/test/string/unescapeHtml.test.ts index 9924e96d..bac569f4 100644 --- a/package/test/string/unescapeHtml.test.ts +++ b/package/test/string/unescapeHtml.test.ts @@ -1,16 +1,16 @@ -import { test, expect, describe } from 'vitest'; +import { test, expect, describe } from "vitest"; -import { unescapeHtml } from '@string/unescapeHtml'; +import { unescapeHtml } from "@string/unescapeHtml"; -describe('unescapeHTML', () => { - test('unescape HTML entities', () => { - const html = '<p>Hello, World!</p>'; +describe("unescapeHTML", () => { + test("unescape HTML entities", () => { + const html = "<p>Hello, World!</p>"; const str = unescapeHtml(html); - expect(str).toBe('

Hello, World!

'); + expect(str).toBe("

Hello, World!

"); }); - test('return the original string if it does not contain HTML entities', () => { - const html = 'Hello, World!'; + test("return the original string if it does not contain HTML entities", () => { + const html = "Hello, World!"; const str = unescapeHtml(html); expect(str).toBe(html); }); diff --git a/package/test/validate/isEmpty.test.ts b/package/test/validate/isEmpty.test.ts index 41ff6256..3961f283 100644 --- a/package/test/validate/isEmpty.test.ts +++ b/package/test/validate/isEmpty.test.ts @@ -1,40 +1,40 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { isEmpty } from '@validate/isEmpty.js'; +import { isEmpty } from "@validate/isEmpty.js"; -describe('isEmpty', () => { - test('isEmpty with null and undefined', () => { +describe("isEmpty", () => { + test("isEmpty with null and undefined", () => { expect(isEmpty(null)).toBe(true); expect(isEmpty(undefined)).toBe(true); }); - test('isEmpty with string', () => { - expect(isEmpty('')).toBe(true); - expect(isEmpty('some string')).toBe(false); + test("isEmpty with string", () => { + expect(isEmpty("")).toBe(true); + expect(isEmpty("some string")).toBe(false); }); - test('isEmpty false on unsupported types', () => { + test("isEmpty false on unsupported types", () => { // @ts-expect-error - number not allowed expect(isEmpty(0)).toBe(false); }); - test('isEmpty with array', () => { + test("isEmpty with array", () => { expect(isEmpty([])).toBe(true); expect(isEmpty([1, 2, 3])).toBe(false); }); - test('isEmpty with Set', () => { + test("isEmpty with Set", () => { expect(isEmpty(new Set())).toBe(true); expect(isEmpty(new Set([1, 2, 3]))).toBe(false); }); - test('isEmpty with Map', () => { + test("isEmpty with Map", () => { expect(isEmpty(new Map())).toBe(true); - expect(isEmpty(new Map([['a', 1], ['b', 2]]))).toBe(false); + expect(isEmpty(new Map([["a", 1], ["b", 2]]))).toBe(false); }); - test('isEmpty with object', () => { + test("isEmpty with object", () => { expect(isEmpty({})).toBe(true); expect(isEmpty({ a: 1, b: 2 })).toBe(false); }); diff --git a/package/test/validate/isEqual.test.ts b/package/test/validate/isEqual.test.ts index 2209278a..86032666 100644 --- a/package/test/validate/isEqual.test.ts +++ b/package/test/validate/isEqual.test.ts @@ -1,91 +1,91 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { isEqual } from '@validate/isEqual'; +import { isEqual } from "@validate/isEqual"; -describe('isEqual', () => { - test('numbers', () => { +describe("isEqual", () => { + test("numbers", () => { expect(isEqual(1, 1)).toBe(true); expect(isEqual(1, 2)).toBe(false); }); - test('strings', () => { - expect(isEqual('a', 'a')).toBe(true); - expect(isEqual('a', 'b')).toBe(false); + test("strings", () => { + expect(isEqual("a", "a")).toBe(true); + expect(isEqual("a", "b")).toBe(false); }); - test('booleans', () => { + test("booleans", () => { expect(isEqual(true, true)).toBe(true); expect(isEqual(true, false)).toBe(false); }); - test('null', () => { + test("null", () => { expect(isEqual(null, null)).toBe(true); expect(isEqual(null, undefined)).toBe(false); }); - test('undefined', () => { + test("undefined", () => { expect(isEqual(undefined, undefined)).toBe(true); expect(isEqual(undefined, null)).toBe(false); }); - test('objects', () => { + test("objects", () => { expect(isEqual({ a: 1 }, { a: 1 })).toBe(true); expect(isEqual({ a: 1 }, { a: 2 })).toBe(false); }); - test('dates', () => { + test("dates", () => { expect(isEqual(new Date(1), new Date(1))).toBe(true); expect(isEqual(new Date(1), new Date(2))).toBe(false); }); - test('arrays', () => { + test("arrays", () => { expect(isEqual([1, 2, 3], [1, 2, 3])).toBe(true); expect(isEqual([1, 2, 3], [1, 2, 4])).toBe(false); }); - test('nested objects', () => { + test("nested objects", () => { expect(isEqual({ a: { b: 1 } }, { a: { b: 1 } })).toBe(true); expect(isEqual({ a: { b: 1 } }, { a: { b: 2 } })).toBe(false); }); - test('nested arrays', () => { + test("nested arrays", () => { expect(isEqual([[1], [2], [3]], [[1], [2], [3]])).toBe(true); expect(isEqual([[1], [2], [3]], [[1], [2], [4]])).toBe(false); }); - test('nested objects and arrays', () => { + test("nested objects and arrays", () => { expect(isEqual({ a: { b: [1] } }, { a: { b: [1] } })).toBe(true); expect(isEqual({ a: { b: [1] } }, { a: { b: [2] } })).toBe(false); }); - test('objects with different keys', () => { + test("objects with different keys", () => { expect(isEqual({ a: 1 }, { b: 1 })).toBe(false); }); - test('arrays with different lengths', () => { + test("arrays with different lengths", () => { expect(isEqual([1, 2, 3], [1, 2])).toBe(false); }); // eslint-disable-next-line unicorn/consistent-function-scoping const testFunction = () => { return 1 }; - test('functions', () => { + test("functions", () => { expect(isEqual(() => { return 1 }, () => { return 2 })).toBe(false); expect(isEqual(testFunction, testFunction)).toBe(true); }); - test('objects with functions', () => { + test("objects with functions", () => { expect(isEqual({ a: () => 1 }, { a: () => 1 })).toBe(false); expect(isEqual({ a: testFunction }, { a: testFunction })).toBe(true); }); - test('regExp', () => { + test("regExp", () => { expect(isEqual(/a(.*)/, /a(.*)/)).toBe(true); expect(isEqual(/a/, /b.*/)).toBe(false); }); - test('deepEquals with Error objects', () => { - const error1 = new Error('test error'); - const error2 = new Error('test error'); + test("deepEquals with Error objects", () => { + const error1 = new Error("test error"); + const error2 = new Error("test error"); expect(isEqual(error1, error1)).toBe(true); expect(isEqual(error1, error2)).toBe(false); }); diff --git a/package/test/validate/isPlainObject.test.ts b/package/test/validate/isPlainObject.test.ts index 89664848..75e63c9e 100644 --- a/package/test/validate/isPlainObject.test.ts +++ b/package/test/validate/isPlainObject.test.ts @@ -1,16 +1,16 @@ -import { describe, expect, test } from 'vitest'; +import { describe, expect, test } from "vitest"; -import { isPlainObject } from '@validate/isPlainObject.js'; +import { isPlainObject } from "@validate/isPlainObject.js"; -describe('isPlainObject', () => { - test('return true for plain objects', () => { +describe("isPlainObject", () => { + test("return true for plain objects", () => { expect(isPlainObject({})).toBe(true); expect(isPlainObject({ a: 1 })).toBe(true); }); - test('return false for non-plain objects', () => { + test("return false for non-plain objects", () => { expect(isPlainObject(null)).toBe(false); - expect(isPlainObject('1')).toBe(false); + expect(isPlainObject("1")).toBe(false); expect(isPlainObject([])).toBe(false); // eslint-disable-next-line @typescript-eslint/no-implied-eval expect(isPlainObject(new Function())).toBe(false); diff --git a/package/test/validate/isUrl.test.ts b/package/test/validate/isUrl.test.ts index da7ab145..8f72775e 100644 --- a/package/test/validate/isUrl.test.ts +++ b/package/test/validate/isUrl.test.ts @@ -1,11 +1,11 @@ -import { describe, test, expect } from 'vitest'; +import { describe, test, expect } from "vitest"; -import { isUrl } from '@validate/isUrl.js'; +import { isUrl } from "@validate/isUrl.js"; -describe('isUrl', () => { - test('isUrl', () => { - expect(isUrl('https://google.com')).toBe(true); - expect(isUrl('google.com')).toBe(false); +describe("isUrl", () => { + test("isUrl", () => { + expect(isUrl("https://google.com")).toBe(true); + expect(isUrl("google.com")).toBe(false); }); }); \ No newline at end of file diff --git a/package/tsup.config.ts b/package/tsup.config.ts index 2060f240..5cbd3d3b 100644 --- a/package/tsup.config.ts +++ b/package/tsup.config.ts @@ -1,10 +1,10 @@ -import { defineConfig } from 'tsup'; +import { defineConfig } from "tsup"; export default defineConfig({ - entry: ['src/index.ts'], - format: ['esm', 'cjs'], + entry: ["src/index.ts"], + format: ["esm", "cjs"], sourcemap: true, clean: true, - outDir: 'dist', + outDir: "dist", dts: true }); diff --git a/package/vitest.config.ts b/package/vitest.config.ts index 4ecf7779..5a2edda1 100644 --- a/package/vitest.config.ts +++ b/package/vitest.config.ts @@ -1,26 +1,26 @@ /// // Configure Vitest (https://vitest.dev/config/) -import { fileURLToPath, URL } from 'node:url'; +import { fileURLToPath, URL } from "node:url"; -import { defineConfig } from 'vitest/config'; +import { defineConfig } from "vitest/config"; const getPath = (path: string) => fileURLToPath(new URL(path, import.meta.url)); export default defineConfig({ resolve: { alias: { - '@array': getPath('src/array'), - '@object': getPath('src/object'), - '@function': getPath('src/function'), - '@string': getPath('src/string'), - '@crypto': getPath('src/crypto'), - '@number': getPath('src/number'), - '@helpers': getPath('src/helpers'), - '@promise': getPath('src/promise'), - '@validate': getPath('src/validate'), - '@type': getPath('src/type'), - '@decorator': getPath('src/decorator') + "@array": getPath("src/array"), + "@object": getPath("src/object"), + "@function": getPath("src/function"), + "@string": getPath("src/string"), + "@crypto": getPath("src/crypto"), + "@number": getPath("src/number"), + "@helpers": getPath("src/helpers"), + "@promise": getPath("src/promise"), + "@validate": getPath("src/validate"), + "@type": getPath("src/type"), + "@decorator": getPath("src/decorator") } } }); diff --git a/website/src/components/EditButton.svelte b/website/src/components/EditButton.svelte index dfdc0b52..3634f77a 100644 --- a/website/src/components/EditButton.svelte +++ b/website/src/components/EditButton.svelte @@ -1,6 +1,6 @@ diff --git a/website/src/components/Header.svelte b/website/src/components/Header.svelte index dddf6158..d6a8aa2f 100644 --- a/website/src/components/Header.svelte +++ b/website/src/components/Header.svelte @@ -1,19 +1,19 @@ diff --git a/website/src/components/Playground.svelte b/website/src/components/Playground.svelte index 149ff591..25a5938b 100644 --- a/website/src/components/Playground.svelte +++ b/website/src/components/Playground.svelte @@ -1,9 +1,9 @@ diff --git a/website/src/components/sidebar/Catergory.svelte b/website/src/components/sidebar/Catergory.svelte index f07336b8..db7e4a31 100644 --- a/website/src/components/sidebar/Catergory.svelte +++ b/website/src/components/sidebar/Catergory.svelte @@ -1,7 +1,7 @@ diff --git a/website/src/routes/+page.server.ts b/website/src/routes/+page.server.ts index 6938878c..70887614 100644 --- a/website/src/routes/+page.server.ts +++ b/website/src/routes/+page.server.ts @@ -1,11 +1,11 @@ -import type { PageServerLoad } from './$types'; +import type { PageServerLoad } from "./$types"; -import readme from '../../../README.md?raw'; +import readme from "../../../README.md?raw"; -import { markdownParser } from '$utils/markdown.js'; +import { markdownParser } from "$utils/markdown.js"; // remove first markdown image from readme -const trimmedReadme = readme.replace(/!\[.*]\(.*\)/, ''); +const trimmedReadme = readme.replace(/!\[.*]\(.*\)/, ""); const parsedMarkdown = markdownParser(trimmedReadme); export const load: PageServerLoad = (() => { diff --git a/website/src/routes/+page.svelte b/website/src/routes/+page.svelte index f8bc1be8..8f50e08d 100644 --- a/website/src/routes/+page.svelte +++ b/website/src/routes/+page.svelte @@ -1,8 +1,8 @@ diff --git a/website/src/routes/docs/[method]/+page.server.ts b/website/src/routes/docs/[method]/+page.server.ts index 1dc13a8f..69ec2117 100644 --- a/website/src/routes/docs/[method]/+page.server.ts +++ b/website/src/routes/docs/[method]/+page.server.ts @@ -1,9 +1,9 @@ -import type { PageServerLoad } from './$types.js'; +import type { PageServerLoad } from "./$types.js"; -import { unique } from 'moderndash'; +import { unique } from "moderndash"; -import { docData } from '$utils/docData.js'; -import { markdownParser } from '$utils/markdown.js'; +import { docData } from "$utils/docData.js"; +import { markdownParser } from "$utils/markdown.js"; export const load: PageServerLoad = (({ params }) => { const methodName = params.method; @@ -17,10 +17,10 @@ export const load: PageServerLoad = (({ params }) => { if (!signature) return { status: 404 }; - const codeMarkdown = signature.comment.blockTags.find(tag => tag.name === 'example')?.text; + const codeMarkdown = signature.comment.blockTags.find(tag => tag.name === "example")?.text; const code = getEmbedCode(signature.name, codeMarkdown); - const description = signature.comment.description ?? 'No description'; + const description = signature.comment.description ?? "No description"; const parsedMarkdown = markdownParser(description).replace(/{@link ([^}]+)}/g, '$1'); return { @@ -28,16 +28,16 @@ export const load: PageServerLoad = (({ params }) => { description, code, parsedMarkdown, - path: fileSource && (fileSource.path + '/' + fileSource.file) + path: fileSource && (fileSource.path + "/" + fileSource.file) }; }); function getEmbedCode(functionName: string, codetext: string | undefined) { - if (!codetext) return ''; - let code = codetext.replace(/```(ts|typescript)\n/, '').replace('```', ''); + if (!codetext) return ""; + let code = codetext.replace(/```(ts|typescript)\n/, "").replace("```", ""); // Deals with Top Level Await Bug in Stackblitz - if (code.includes('await')) { + if (code.includes("await")) { code = wrapInAsyncFunc(code); } @@ -46,24 +46,24 @@ function getEmbedCode(functionName: string, codetext: string | undefined) { function generateImportString(functionName: string, code: string) { - const codeWithOutComments = code.replace(/\/\*[\S\s]*?\*\/|(?<=[^:])\/\/.*|^\/\/.*/g, ''); + const codeWithOutComments = code.replace(/\/\*[\S\s]*?\*\/|(?<=[^:])\/\/.*|^\/\/.*/g, ""); const foundFunctionNames = codeWithOutComments.match( - new RegExp(`(? func.name).join('|')})\\b`, 'g') + new RegExp(`(? func.name).join("|")})\\b`, "g") ); const functionsToImport = unique([functionName, ...(foundFunctionNames ?? [])]); - return `import { ${functionsToImport.join(', ')} } from 'moderndash';\n\n`; + return `import { ${functionsToImport.join(", ")} } from 'moderndash';\n\n`; } function wrapInAsyncFunc(code: string) { - let lines = code.split('\n'); + let lines = code.split("\n"); lines = lines.map((line, index) => { if (index < lines.length - 1) { - return ' ' + line; + return " " + line; } return line; }); - code = lines.join('\n'); + code = lines.join("\n"); code = `(async () => {\n${code}})()`; return code; } diff --git a/website/src/routes/docs/[method]/+page.svelte b/website/src/routes/docs/[method]/+page.svelte index e70a5474..b858ab45 100644 --- a/website/src/routes/docs/[method]/+page.svelte +++ b/website/src/routes/docs/[method]/+page.svelte @@ -1,9 +1,9 @@