diff --git a/README.md b/README.md index 6f62453..59a8747 100644 --- a/README.md +++ b/README.md @@ -38,28 +38,28 @@ Wrap your `vi.fn()` mock - or a function imported from a `vi.mock`'d module - in If the stub is called with arguments that match `calledWith`, the configured behavior will occur. If the arguments do not match, the stub will no-op and return `undefined`. ```ts -import { vi, test, afterEach } from 'vitest'; -import { when } from ''; +import { vi, test, afterEach } from 'vitest' +import { when } from '' afterEach(() => { - vi.resetAllMocks(); -}); + vi.resetAllMocks() +}) test('stubbing with vitest-when', () => { - const stub = vi.fn(); + const stub = vi.fn() - when(stub).calledWith(1, 2, 3).thenReturn(4); - when(stub).calledWith(4, 5, 6).thenReturn(7); + when(stub).calledWith(1, 2, 3).thenReturn(4) + when(stub).calledWith(4, 5, 6).thenReturn(7) - let result = stub(1, 2, 3); - expect(result).toBe(4); + let result = stub(1, 2, 3) + expect(result).toBe(4) - result = stub(4, 5, 6); - expect(result).toBe(7); + result = stub(4, 5, 6) + expect(result).toBe(7) - result = stub(7, 8, 9); - expect(result).toBe(undefined); -}); + result = stub(7, 8, 9) + expect(result).toBe(undefined) +}) ``` You should call `vi.resetAllMocks()` in your suite's `afterEach` hook to remove the implementation added by `when`. You can also set Vitest's [`mockReset`](https://vitest.dev/config/#mockreset) config to `true` instead of using `afterEach`. @@ -84,15 +84,15 @@ Vitest's mock functions are powerful, but have an overly permissive API, inherit ```ts // arrange -const stub = vi.fn(); -stub.mockReturnValue('world'); +const stub = vi.fn() +stub.mockReturnValue('world') // act -const result = stub('hello'); +const result = stub('hello') // assert -expect(stub).toHaveBeenCalledWith('hello'); -expect(result).toBe('world'); +expect(stub).toHaveBeenCalledWith('hello') +expect(result).toBe('world') ``` In contrast, when using vitest-when stubs: @@ -103,14 +103,14 @@ In contrast, when using vitest-when stubs: ```ts // arrange -const stub = vi.fn(); -when(stub).calledWith('hello').thenReturn('world'); +const stub = vi.fn() +when(stub).calledWith('hello').thenReturn('world') // act -const result = stub('hello'); +const result = stub('hello') // assert -expect(result).toBe('world'); +expect(result).toBe('world') ``` [arrange and assert]: https://github.com/testdouble/contributing-tests/wiki/Arrange-Act-Assert @@ -121,62 +121,62 @@ See the [./example](./example) directory for example usage. ```ts // meaning-of-life.test.ts -import { vi, describe, afterEach, it, expect } from 'vitest'; -import { when } from '../src/vitest-when.ts'; +import { vi, describe, afterEach, it, expect } from 'vitest' +import { when } from '../src/vitest-when.ts' -import * as deepThought from './deep-thought.ts'; -import * as earth from './earth.ts'; -import * as subject from './meaning-of-life.ts'; +import * as deepThought from './deep-thought.ts' +import * as earth from './earth.ts' +import * as subject from './meaning-of-life.ts' -vi.mock('./deep-thought.ts'); -vi.mock('./earth.ts'); +vi.mock('./deep-thought.ts') +vi.mock('./earth.ts') describe('get the meaning of life', () => { afterEach(() => { - vi.resetAllMocks(); - }); + vi.resetAllMocks() + }) it('should get the answer and the question', async () => { - when(deepThought.calculateAnswer).calledWith().thenResolve(42); - when(earth.calculateQuestion).calledWith(42).thenResolve("What's 6 by 9?"); + when(deepThought.calculateAnswer).calledWith().thenResolve(42) + when(earth.calculateQuestion).calledWith(42).thenResolve("What's 6 by 9?") - const result = await subject.createMeaning(); + const result = await subject.createMeaning() - expect(result).toEqual({ question: "What's 6 by 9?", answer: 42 }); - }); -}); + expect(result).toEqual({ question: "What's 6 by 9?", answer: 42 }) + }) +}) ``` ```ts // meaning-of-life.ts -import { calculateAnswer } from './deep-thought.ts'; -import { calculateQuestion } from './earth.ts'; +import { calculateAnswer } from './deep-thought.ts' +import { calculateQuestion } from './earth.ts' export interface Meaning { - question: string; - answer: number; + question: string + answer: number } export const createMeaning = async (): Promise => { - const answer = await calculateAnswer(); - const question = await calculateQuestion(answer); + const answer = await calculateAnswer() + const question = await calculateQuestion(answer) - return { question, answer }; -}; + return { question, answer } +} ``` ```ts // deep-thought.ts export const calculateAnswer = async (): Promise => { - throw new Error(`calculateAnswer() not implemented`); -}; + throw new Error(`calculateAnswer() not implemented`) +} ``` ```ts // earth.ts export const calculateQuestion = async (answer: number): Promise => { - throw new Error(`calculateQuestion(${answer}) not implemented`); -}; + throw new Error(`calculateQuestion(${answer}) not implemented`) +} ``` ## API @@ -186,14 +186,14 @@ export const calculateQuestion = async (answer: number): Promise => { Configures a `vi.fn()` mock function to act as a vitest-when stub. Adds an implementation to the function that initially no-ops, and returns an API to configure behaviors for given arguments using [`.calledWith(...)`][called-with] ```ts -import { vi } from 'vitest'; -import { when } from 'vitest-when'; +import { vi } from 'vitest' +import { when } from 'vitest-when' -const spy = vi.fn(); +const spy = vi.fn() -when(spy); +when(spy) -expect(spy()).toBe(undefined); +expect(spy()).toBe(undefined) ``` ### `.calledWith(...args: TArgs): Stub` @@ -201,31 +201,31 @@ expect(spy()).toBe(undefined); Create a stub that matches a given set of arguments which you can configure with different behaviors using methods like [`.thenReturn(...)`][then-return]. ```ts -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenReturn('world'); +when(spy).calledWith('hello').thenReturn('world') -expect(spy('hello')).toEqual('world'); +expect(spy('hello')).toEqual('world') ``` When a call to a mock uses arguments that match those given to `calledWith`, a configured behavior will be triggered. All arguments must match, but you can use Vitest's [asymmetric matchers][] to loosen the stubbing: ```ts -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith(expect.any(String)).thenReturn('world'); +when(spy).calledWith(expect.any(String)).thenReturn('world') -expect(spy('hello')).toEqual('world'); -expect(spy('anything')).toEqual('world'); +expect(spy('hello')).toEqual('world') +expect(spy('anything')).toEqual('world') ``` If `calledWith` is used multiple times, the last configured stubbing will be used. ```ts -when(spy).calledWith('hello').thenReturn('world'); -expect(spy('hello')).toEqual('world'); -when(spy).calledWith('hello').thenReturn('goodbye'); -expect(spy('hello')).toEqual('goodbye'); +when(spy).calledWith('hello').thenReturn('world') +expect(spy('hello')).toEqual('world') +when(spy).calledWith('hello').thenReturn('goodbye') +expect(spy('hello')).toEqual('goodbye') ``` [asymmetric matchers]: https://vitest.dev/api/expect.html#expect-anything @@ -235,20 +235,20 @@ expect(spy('hello')).toEqual('goodbye'); Due to fundamental limitations in TypeScript, `when()` will always use the _last_ overload to infer function parameters and return types. You can use the `TFunc` type parameter of `when()` to manually select a different overload entry: ```ts -function overloaded(): null; -function overloaded(input: number): string; +function overloaded(): null +function overloaded(input: number): string function overloaded(input?: number): string | null { // ... } // Last entry: all good! -when(overloaded).calledWith(42).thenReturn('hello'); +when(overloaded).calledWith(42).thenReturn('hello') // $ts-expect-error: first entry -when(overloaded).calledWith().thenReturn(null); +when(overloaded).calledWith().thenReturn(null) // Manually specified: all good! -when<() => null>(overloaded).calledWith().thenReturn(null); +when<() => null>(overloaded).calledWith().thenReturn(null) ``` ### `.thenReturn(value: TReturn)` @@ -256,36 +256,36 @@ when<() => null>(overloaded).calledWith().thenReturn(null); When the stubbing is satisfied, return `value` ```ts -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenReturn('world'); +when(spy).calledWith('hello').thenReturn('world') -expect(spy('hello')).toEqual('world'); +expect(spy('hello')).toEqual('world') ``` To only return a value once, use the `ONCE` option. ```ts -import { ONCE, when } from 'vitest-when'; +import { ONCE, when } from 'vitest-when' -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenReturn('world', ONCE); +when(spy).calledWith('hello').thenReturn('world', ONCE) -expect(spy('hello')).toEqual('world'); -expect(spy('hello')).toEqual(undefined); +expect(spy('hello')).toEqual('world') +expect(spy('hello')).toEqual(undefined) ``` You may pass several values to `thenReturn` to return different values in succession. The last value will be latched, unless you pass the `ONCE` option. ```ts -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenReturn('hi', 'sup?'); +when(spy).calledWith('hello').thenReturn('hi', 'sup?') -expect(spy('hello')).toEqual('hi'); -expect(spy('hello')).toEqual('sup?'); -expect(spy('hello')).toEqual('sup?'); +expect(spy('hello')).toEqual('hi') +expect(spy('hello')).toEqual('sup?') +expect(spy('hello')).toEqual('sup?') ``` ### `.thenResolve(value: TReturn)` @@ -293,36 +293,36 @@ expect(spy('hello')).toEqual('sup?'); When the stubbing is satisfied, resolve a `Promise` with `value` ```ts -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenResolve('world'); +when(spy).calledWith('hello').thenResolve('world') -expect(await spy('hello')).toEqual('world'); +expect(await spy('hello')).toEqual('world') ``` To only resolve a value once, use the `ONCE` option. ```ts -import { ONCE, when } from 'vitest-when'; +import { ONCE, when } from 'vitest-when' -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenResolve('world', ONCE); +when(spy).calledWith('hello').thenResolve('world', ONCE) -expect(await spy('hello')).toEqual('world'); -expect(spy('hello')).toEqual(undefined); +expect(await spy('hello')).toEqual('world') +expect(spy('hello')).toEqual(undefined) ``` You may pass several values to `thenResolve` to resolve different values in succession. The last value will be latched, unless you pass the `ONCE` option. ```ts -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenResolve('hi', 'sup?'); +when(spy).calledWith('hello').thenResolve('hi', 'sup?') -expect(await spy('hello')).toEqual('hi'); -expect(await spy('hello')).toEqual('sup?'); -expect(await spy('hello')).toEqual('sup?'); +expect(await spy('hello')).toEqual('hi') +expect(await spy('hello')).toEqual('sup?') +expect(await spy('hello')).toEqual('sup?') ``` ### `.thenThrow(error: unknown)` @@ -330,38 +330,38 @@ expect(await spy('hello')).toEqual('sup?'); When the stubbing is satisfied, throw `error`. ```ts -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenThrow(new Error('oh no')); +when(spy).calledWith('hello').thenThrow(new Error('oh no')) -expect(() => spy('hello')).toThrow('oh no'); +expect(() => spy('hello')).toThrow('oh no') ``` To only throw an error only once, use the `ONCE` option. ```ts -import { ONCE, when } from 'vitest-when'; +import { ONCE, when } from 'vitest-when' -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenThrow(new Error('oh no'), ONCE); +when(spy).calledWith('hello').thenThrow(new Error('oh no'), ONCE) -expect(() => spy('hello')).toThrow('oh no'); -expect(spy('hello')).toEqual(undefined); +expect(() => spy('hello')).toThrow('oh no') +expect(spy('hello')).toEqual(undefined) ``` You may pass several values to `thenThrow` to throw different errors in succession. The last value will be latched, unless you pass the `ONCE` option. ```ts -const spy = vi.fn(); +const spy = vi.fn() when(spy) .calledWith('hello') - .thenThrow(new Error('oh no'), new Error('this is bad')); + .thenThrow(new Error('oh no'), new Error('this is bad')) -expect(() => spy('hello')).toThrow('oh no'); -expect(() => spy('hello')).toThrow('this is bad'); -expect(() => spy('hello')).toThrow('this is bad'); +expect(() => spy('hello')).toThrow('oh no') +expect(() => spy('hello')).toThrow('this is bad') +expect(() => spy('hello')).toThrow('this is bad') ``` ### `.thenReject(error: unknown)` @@ -369,38 +369,38 @@ expect(() => spy('hello')).toThrow('this is bad'); When the stubbing is satisfied, reject a `Promise` with `error`. ```ts -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenReject(new Error('oh no')); +when(spy).calledWith('hello').thenReject(new Error('oh no')) -await expect(spy('hello')).rejects.toThrow('oh no'); +await expect(spy('hello')).rejects.toThrow('oh no') ``` To only throw an error only once, use the `ONCE` option. ```ts -import { ONCE, when } from 'vitest-when'; +import { ONCE, when } from 'vitest-when' -const spy = vi.fn(); +const spy = vi.fn() -when(spy).calledWith('hello').thenReject(new Error('oh no'), ONCE); +when(spy).calledWith('hello').thenReject(new Error('oh no'), ONCE) -await expect(spy('hello')).rejects.toThrow('oh no'); -expect(spy('hello')).toEqual(undefined); +await expect(spy('hello')).rejects.toThrow('oh no') +expect(spy('hello')).toEqual(undefined) ``` You may pass several values to `thenReject` to throw different errors in succession. The last value will be latched, unless you pass the `ONCE` option. ```ts -const spy = vi.fn(); +const spy = vi.fn() when(spy) .calledWith('hello') - .thenReject(new Error('oh no'), new Error('this is bad')); + .thenReject(new Error('oh no'), new Error('this is bad')) -await expect(spy('hello')).rejects.toThrow('oh no'); -await expect(spy('hello')).rejects.toThrow('this is bad'); -await expect(spy('hello')).rejects.toThrow('this is bad'); +await expect(spy('hello')).rejects.toThrow('oh no') +await expect(spy('hello')).rejects.toThrow('this is bad') +await expect(spy('hello')).rejects.toThrow('this is bad') ``` ### `.thenDo(callback: (...args: TArgs) => TReturn)` @@ -408,47 +408,47 @@ await expect(spy('hello')).rejects.toThrow('this is bad'); When the stubbing is satisfied, run `callback` to trigger a side-effect and return its result (if any). `thenDo` is a relatively powerful tool for stubbing complex behaviors, so if you find yourself using `thenDo` often, consider refactoring your code to use more simple interactions! Your future self will thank you. ```ts -const spy = vi.fn(); -let called = false; +const spy = vi.fn() +let called = false when(spy) .calledWith('hello') .thenDo(() => { - called = true; - return 'world'; - }); + called = true + return 'world' + }) -expect(spy('hello')).toEqual('world'); -expect(called).toEqual(true); +expect(spy('hello')).toEqual('world') +expect(called).toEqual(true) ``` To only run the callback once, use the `ONCE` option. ```ts -import { ONCE, when } from 'vitest-when'; +import { ONCE, when } from 'vitest-when' -const spy = vi.fn(); +const spy = vi.fn() when(spy) .calledWith('hello') - .thenDo(() => 'world', ONCE); + .thenDo(() => 'world', ONCE) -expect(spy('hello')).toEqual('world'); -expect(spy('hello')).toEqual(undefined); +expect(spy('hello')).toEqual('world') +expect(spy('hello')).toEqual(undefined) ``` You may pass several callbacks to `thenDo` to trigger different side-effects in succession. The last callback will be latched, unless you pass the `ONCE` option. ```ts -const spy = vi.fn(); +const spy = vi.fn() when(spy) .calledWith('hello') .thenDo( () => 'world', - () => 'solar system' - ); + () => 'solar system', + ) -expect(spy('hello')).toEqual('world'); -expect(spy('hello')).toEqual('solar system'); +expect(spy('hello')).toEqual('world') +expect(spy('hello')).toEqual('solar system') ``` diff --git a/example/deep-thought.ts b/example/deep-thought.ts index 1f3d295..3519de2 100644 --- a/example/deep-thought.ts +++ b/example/deep-thought.ts @@ -1,4 +1,4 @@ // eslint-disable-next-line @typescript-eslint/require-await export const calculateAnswer = async (): Promise => { - throw new Error(`calculateAnswer() not implemented`); -}; + throw new Error(`calculateAnswer() not implemented`) +} diff --git a/example/earth.ts b/example/earth.ts index 380cb02..3dc34f8 100644 --- a/example/earth.ts +++ b/example/earth.ts @@ -1,4 +1,4 @@ // eslint-disable-next-line @typescript-eslint/require-await export const calculateQuestion = async (answer: number): Promise => { - throw new Error(`calculateQuestion(${answer}) not implemented`); -}; + throw new Error(`calculateQuestion(${answer}) not implemented`) +} diff --git a/example/meaning-of-life.test.ts b/example/meaning-of-life.test.ts index ca5ecb4..328e0a0 100644 --- a/example/meaning-of-life.test.ts +++ b/example/meaning-of-life.test.ts @@ -1,24 +1,24 @@ -import { vi, describe, afterEach, it, expect } from 'vitest'; -import { when } from '../src/vitest-when.ts'; +import { vi, describe, afterEach, it, expect } from 'vitest' +import { when } from '../src/vitest-when.ts' -import * as deepThought from './deep-thought.ts'; -import * as earth from './earth.ts'; -import * as subject from './meaning-of-life.ts'; +import * as deepThought from './deep-thought.ts' +import * as earth from './earth.ts' +import * as subject from './meaning-of-life.ts' -vi.mock('./deep-thought.ts'); -vi.mock('./earth.ts'); +vi.mock('./deep-thought.ts') +vi.mock('./earth.ts') describe('get the meaning of life', () => { afterEach(() => { - vi.resetAllMocks(); - }); + vi.resetAllMocks() + }) it('should get the answer and the question', async () => { - when(deepThought.calculateAnswer).calledWith().thenResolve(42); - when(earth.calculateQuestion).calledWith(42).thenResolve("What's 6 by 9?"); + when(deepThought.calculateAnswer).calledWith().thenResolve(42) + when(earth.calculateQuestion).calledWith(42).thenResolve("What's 6 by 9?") - const result = await subject.createMeaning(); + const result = await subject.createMeaning() - expect(result).toEqual({ question: "What's 6 by 9?", answer: 42 }); - }); -}); + expect(result).toEqual({ question: "What's 6 by 9?", answer: 42 }) + }) +}) diff --git a/example/meaning-of-life.ts b/example/meaning-of-life.ts index bca8b9d..3680012 100644 --- a/example/meaning-of-life.ts +++ b/example/meaning-of-life.ts @@ -1,14 +1,14 @@ -import { calculateAnswer } from './deep-thought.ts'; -import { calculateQuestion } from './earth.ts'; +import { calculateAnswer } from './deep-thought.ts' +import { calculateQuestion } from './earth.ts' export interface Meaning { - question: string; - answer: number; + question: string + answer: number } export const createMeaning = async (): Promise => { - const answer = await calculateAnswer(); - const question = await calculateQuestion(answer); + const answer = await calculateAnswer() + const question = await calculateQuestion(answer) - return { question, answer }; -}; + return { question, answer } +} diff --git a/package.json b/package.json index d5a5044..6512e25 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,21 @@ "name": "vitest-when", "version": "0.1.2", "description": "Stub behaviors of Vitest mock functions with a small, readable API.", + "keywords": [ + "tdd", + "testing", + "mocking" + ], + "homepage": "https://github.com/mcous/vitest-when#readme", + "bugs": { + "url": "https://github.com/mcous/vitest-when/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/mcous/vitest-when.git" + }, + "license": "MIT", + "author": "Michael Cousins (https://mike.cousins.io)", "type": "module", "exports": { ".": { @@ -15,75 +30,57 @@ "dist", "src" ], - "publishConfig": { - "access": "public", - "provenance": true - }, - "packageManager": "pnpm@8.5.1", - "author": "Michael Cousins (https://mike.cousins.io)", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/mcous/vitest-when.git" - }, - "bugs": { - "url": "https://github.com/mcous/vitest-when/issues" - }, - "homepage": "https://github.com/mcous/vitest-when#readme", - "keywords": [ - "tdd", - "testing", - "mocking" - ], "scripts": { + "_eslint": "eslint --ignore-path .lintignore \"**/*.ts\"", + "_prettier": "prettier --ignore-path .lintignore \"**/*.@(ts|json|yaml|md)\"", "all": "concurrently -g pnpm:coverage pnpm:build pnpm:check:*", - "build-and-check": "concurrently -g pnpm:build pnpm:check:*", "build": "tsup --clean --sourcemap --dts --format esm,cjs --target node14 src/vitest-when.ts", - "test": "vitest", - "coverage": "vitest run --coverage", + "build-and-check": "concurrently -g pnpm:build pnpm:check:*", "check:format": "pnpm run _prettier --check", "check:lint": "pnpm run _eslint", "check:types": "vitest typecheck --run", + "coverage": "vitest run --coverage", "format": "pnpm run _prettier --write && pnpm run _eslint --fix", - "_eslint": "eslint --ignore-path .lintignore \"**/*.ts\"", - "_prettier": "prettier --ignore-path .lintignore \"**/*.@(ts|json|yaml)\"" + "test": "vitest" }, + "prettier": "@mcous/prettier-config", "eslintConfig": { - "extends": "@viamrobotics/eslint-config", "parserOptions": { "project": "./tsconfig.json" }, - "settings": { - "import/resolver": { - "typescript": { - "project": "./tsconfig.json" - } - } - } - }, - "prettier": "@viamrobotics/prettier-config", - "peerDependencies": { - "vitest": ">=0.31.0 <1.0.0", - "@vitest/expect": ">=0.31.0 <1.0.0" + "extends": "@mcous/eslint-config" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.59.5", - "@typescript-eslint/parser": "^5.59.5", - "@viamrobotics/eslint-config": "^0.0.4", - "@viamrobotics/prettier-config": "^0.0.1", - "@viamrobotics/typescript-config": "^0.0.3", + "@mcous/eslint-config": "0.3.3", + "@mcous/prettier-config": "0.3.0", + "@mcous/typescript-config": "0.2.1", + "@typescript-eslint/eslint-plugin": "6.7.4", + "@typescript-eslint/parser": "6.7.4", "@vitest/coverage-istanbul": "^0.31.0", "@vitest/expect": "^0.31.0", "concurrently": "^8.0.1", - "eslint": "^8.40.0", - "eslint-config-prettier": "^8.8.0", - "eslint-import-resolver-typescript": "^3.5.5", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-sonarjs": "^0.19.0", - "eslint-plugin-unicorn": "^46.0.1", - "prettier": "^2.8.8", + "eslint": "8.51.0", + "eslint-config-prettier": "9.0.0", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-sonarjs": "0.21.0", + "eslint-plugin-unicorn": "48.0.1", + "prettier": "3.0.3", "tsup": "^6.7.0", - "typescript": "^5.0.4", + "typescript": "5.2.2", "vitest": "^0.31.0" + }, + "peerDependencies": { + "@vitest/expect": ">=0.31.0 <1.0.0", + "vitest": ">=0.31.0 <1.0.0" + }, + "peerDependenciesMeta": { + "@vitest/expect": { + "optional": true + } + }, + "packageManager": "pnpm@8.8.0+sha256.d713a5750e41c3660d1e090608c7f607ad00d1dd5ba9b6552b5f390bf37924e9", + "publishConfig": { + "access": "public", + "provenance": true } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 275e0a2..34da5b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,21 +1,25 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + devDependencies: + '@mcous/eslint-config': + specifier: 0.3.3 + version: 0.3.3(@typescript-eslint/eslint-plugin@6.7.4)(@typescript-eslint/parser@6.7.4)(eslint-config-prettier@9.0.0)(eslint-plugin-promise@6.1.1)(eslint-plugin-sonarjs@0.21.0)(eslint-plugin-unicorn@48.0.1)(eslint@8.51.0) + '@mcous/prettier-config': + specifier: 0.3.0 + version: 0.3.0(prettier@3.0.3) + '@mcous/typescript-config': + specifier: 0.2.1 + version: 0.2.1(typescript@5.2.2) '@typescript-eslint/eslint-plugin': - specifier: ^5.59.5 - version: 5.59.5(@typescript-eslint/parser@5.59.5)(eslint@8.40.0)(typescript@5.0.4) + specifier: 6.7.4 + version: 6.7.4(@typescript-eslint/parser@6.7.4)(eslint@8.51.0)(typescript@5.2.2) '@typescript-eslint/parser': - specifier: ^5.59.5 - version: 5.59.5(eslint@8.40.0)(typescript@5.0.4) - '@viamrobotics/eslint-config': - specifier: ^0.0.4 - version: 0.0.4(@typescript-eslint/eslint-plugin@5.59.5)(@typescript-eslint/parser@5.59.5)(eslint-config-prettier@8.8.0)(eslint-import-resolver-typescript@3.5.5)(eslint-plugin-import@2.27.5)(eslint-plugin-sonarjs@0.19.0)(eslint-plugin-unicorn@46.0.1)(eslint@8.40.0) - '@viamrobotics/prettier-config': - specifier: ^0.0.1 - version: 0.0.1(prettier@2.8.8) - '@viamrobotics/typescript-config': - specifier: ^0.0.3 - version: 0.0.3(typescript@5.0.4) + specifier: 6.7.4 + version: 6.7.4(eslint@8.51.0)(typescript@5.2.2) '@vitest/coverage-istanbul': specifier: ^0.31.0 version: 0.31.0(vitest@0.31.0) @@ -26,38 +30,40 @@ devDependencies: specifier: ^8.0.1 version: 8.0.1 eslint: - specifier: ^8.40.0 - version: 8.40.0 + specifier: 8.51.0 + version: 8.51.0 eslint-config-prettier: - specifier: ^8.8.0 - version: 8.8.0(eslint@8.40.0) - eslint-import-resolver-typescript: - specifier: ^3.5.5 - version: 3.5.5(@typescript-eslint/parser@5.59.5)(eslint-plugin-import@2.27.5)(eslint@8.40.0) - eslint-plugin-import: - specifier: ^2.27.5 - version: 2.27.5(@typescript-eslint/parser@5.59.5)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0) + specifier: 9.0.0 + version: 9.0.0(eslint@8.51.0) + eslint-plugin-promise: + specifier: 6.1.1 + version: 6.1.1(eslint@8.51.0) eslint-plugin-sonarjs: - specifier: ^0.19.0 - version: 0.19.0(eslint@8.40.0) + specifier: 0.21.0 + version: 0.21.0(eslint@8.51.0) eslint-plugin-unicorn: - specifier: ^46.0.1 - version: 46.0.1(eslint@8.40.0) + specifier: 48.0.1 + version: 48.0.1(eslint@8.51.0) prettier: - specifier: ^2.8.8 - version: 2.8.8 + specifier: 3.0.3 + version: 3.0.3 tsup: specifier: ^6.7.0 - version: 6.7.0(typescript@5.0.4) + version: 6.7.0(typescript@5.2.2) typescript: - specifier: ^5.0.4 - version: 5.0.4 + specifier: 5.2.2 + version: 5.2.2 vitest: specifier: ^0.31.0 version: 0.31.0 packages: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + /@ampproject/remapping@2.2.1: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} @@ -192,6 +198,11 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-validator-option@7.21.0: resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} engines: {node: '>=6.9.0'} @@ -466,14 +477,14 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.40.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.51.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.40.0 - eslint-visitor-keys: 3.4.1 + eslint: 8.51.0 + eslint-visitor-keys: 3.4.3 dev: true /@eslint-community/regexpp@4.5.1: @@ -481,13 +492,18 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.0.3: - resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} + /@eslint-community/regexpp@4.9.1: + resolution: {integrity: sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + + /@eslint/eslintrc@2.1.2: + resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.5.2 + espree: 9.6.1 globals: 13.20.0 ignore: 5.2.4 import-fresh: 3.3.0 @@ -498,13 +514,13 @@ packages: - supports-color dev: true - /@eslint/js@8.40.0: - resolution: {integrity: sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==} + /@eslint/js@8.51.0: + resolution: {integrity: sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@humanwhocodes/config-array@0.11.8: - resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} + /@humanwhocodes/config-array@0.11.11: + resolution: {integrity: sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -562,6 +578,42 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /@mcous/eslint-config@0.3.3(@typescript-eslint/eslint-plugin@6.7.4)(@typescript-eslint/parser@6.7.4)(eslint-config-prettier@9.0.0)(eslint-plugin-promise@6.1.1)(eslint-plugin-sonarjs@0.21.0)(eslint-plugin-unicorn@48.0.1)(eslint@8.51.0): + resolution: {integrity: sha512-D+45q/7uzbUSjL3iqh7yE7pdRdSX09j7fP1Co5UwGY3YLrlvBxH9ZEr2/z19EIZ5mEejyDEKKEEKk0fSw6/mPg==} + peerDependencies: + '@typescript-eslint/eslint-plugin': '>=5.0.0 <7' + '@typescript-eslint/parser': '>=5.0.0 <7' + eslint: '>=8.0.0 <9' + eslint-config-prettier: '>=8.0.0 <10' + eslint-plugin-promise: '>=6.0.0 <7' + eslint-plugin-sonarjs: '>=0.19.0 <0.22.0' + eslint-plugin-unicorn: '>=47.0.0 <49' + dependencies: + '@typescript-eslint/eslint-plugin': 6.7.4(@typescript-eslint/parser@6.7.4)(eslint@8.51.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.7.4(eslint@8.51.0)(typescript@5.2.2) + eslint: 8.51.0 + eslint-config-prettier: 9.0.0(eslint@8.51.0) + eslint-plugin-promise: 6.1.1(eslint@8.51.0) + eslint-plugin-sonarjs: 0.21.0(eslint@8.51.0) + eslint-plugin-unicorn: 48.0.1(eslint@8.51.0) + dev: true + + /@mcous/prettier-config@0.3.0(prettier@3.0.3): + resolution: {integrity: sha512-sSSBKjIIvg2kd377KZB2fK0NsQZm9pP0H3HQuvWClfEni/HQIoh07xlo00Pk2QbPP1MjuvWeV62jo6DwLdWFJw==} + peerDependencies: + prettier: '>=3.0.0 <4' + dependencies: + prettier: 3.0.3 + dev: true + + /@mcous/typescript-config@0.2.1(typescript@5.2.2): + resolution: {integrity: sha512-Fqfz1HqWbTbJUwfYhoXoT0yPRyyJh6H3WpwhgZKHU0WY1oX6KPkhUh4iDpwBnv5RXGrzDH6UB/LM9rPp0I/Xbw==} + peerDependencies: + typescript: '>=5.0.0 <6' + dependencies: + typescript: 5.2.2 + dev: true + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -583,18 +635,6 @@ packages: fastq: 1.15.0 dev: true - /@pkgr/utils@2.4.0: - resolution: {integrity: sha512-2OCURAmRtdlL8iUDTypMrrxfwe8frXTeXaxGsVOaYtc/wrUyk8Z/0OBetM7cdlsy7ZFWlMX72VogKeh+A4Xcjw==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - dependencies: - cross-spawn: 7.0.3 - fast-glob: 3.2.12 - is-glob: 4.0.3 - open: 9.1.0 - picocolors: 1.0.0 - tslib: 2.5.0 - dev: true - /@types/chai-subset@1.3.3: resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} dependencies: @@ -605,12 +645,8 @@ packages: resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} dev: true - /@types/json-schema@7.0.11: - resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} - dev: true - - /@types/json5@0.0.29: - resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + /@types/json-schema@7.0.13: + resolution: {integrity: sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==} dev: true /@types/node@20.1.2: @@ -625,172 +661,135 @@ packages: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} dev: true - /@typescript-eslint/eslint-plugin@5.59.5(@typescript-eslint/parser@5.59.5)(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/eslint-plugin@6.7.4(@typescript-eslint/parser@6.7.4)(eslint@8.51.0)(typescript@5.2.2): + resolution: {integrity: sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.59.5(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/scope-manager': 5.59.5 - '@typescript-eslint/type-utils': 5.59.5(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.5(eslint@8.40.0)(typescript@5.0.4) + '@typescript-eslint/parser': 6.7.4(eslint@8.51.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.7.4 + '@typescript-eslint/type-utils': 6.7.4(eslint@8.51.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.7.4(eslint@8.51.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.7.4 debug: 4.3.4 - eslint: 8.40.0 - grapheme-splitter: 1.0.4 + eslint: 8.51.0 + graphemer: 1.4.0 ignore: 5.2.4 - natural-compare-lite: 1.4.0 - semver: 7.5.0 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + natural-compare: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@5.59.5(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/parser@6.7.4(eslint@8.51.0)(typescript@5.2.2): + resolution: {integrity: sha512-I5zVZFY+cw4IMZUeNCU7Sh2PO5O57F7Lr0uyhgCJmhN/BuTlnc55KxPonR4+EM3GBdfiCyGZye6DgMjtubQkmA==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.59.5 - '@typescript-eslint/types': 5.59.5 - '@typescript-eslint/typescript-estree': 5.59.5(typescript@5.0.4) + '@typescript-eslint/scope-manager': 6.7.4 + '@typescript-eslint/types': 6.7.4 + '@typescript-eslint/typescript-estree': 6.7.4(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.7.4 debug: 4.3.4 - eslint: 8.40.0 - typescript: 5.0.4 + eslint: 8.51.0 + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@5.59.5: - resolution: {integrity: sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/scope-manager@6.7.4: + resolution: {integrity: sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==} + engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 5.59.5 - '@typescript-eslint/visitor-keys': 5.59.5 + '@typescript-eslint/types': 6.7.4 + '@typescript-eslint/visitor-keys': 6.7.4 dev: true - /@typescript-eslint/type-utils@5.59.5(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/type-utils@6.7.4(eslint@8.51.0)(typescript@5.2.2): + resolution: {integrity: sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: '*' + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.59.5(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.5(eslint@8.40.0)(typescript@5.0.4) + '@typescript-eslint/typescript-estree': 6.7.4(typescript@5.2.2) + '@typescript-eslint/utils': 6.7.4(eslint@8.51.0)(typescript@5.2.2) debug: 4.3.4 - eslint: 8.40.0 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + eslint: 8.51.0 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types@5.59.5: - resolution: {integrity: sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/types@6.7.4: + resolution: {integrity: sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==} + engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@5.59.5(typescript@5.0.4): - resolution: {integrity: sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/typescript-estree@6.7.4(typescript@5.2.2): + resolution: {integrity: sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.59.5 - '@typescript-eslint/visitor-keys': 5.59.5 + '@typescript-eslint/types': 6.7.4 + '@typescript-eslint/visitor-keys': 6.7.4 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.0 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.59.5(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/utils@6.7.4(eslint@8.51.0)(typescript@5.2.2): + resolution: {integrity: sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - '@types/json-schema': 7.0.11 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.51.0) + '@types/json-schema': 7.0.13 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.59.5 - '@typescript-eslint/types': 5.59.5 - '@typescript-eslint/typescript-estree': 5.59.5(typescript@5.0.4) - eslint: 8.40.0 - eslint-scope: 5.1.1 - semver: 7.5.0 + '@typescript-eslint/scope-manager': 6.7.4 + '@typescript-eslint/types': 6.7.4 + '@typescript-eslint/typescript-estree': 6.7.4(typescript@5.2.2) + eslint: 8.51.0 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@5.59.5: - resolution: {integrity: sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.59.5 - eslint-visitor-keys: 3.4.1 - dev: true - - /@viamrobotics/eslint-config@0.0.4(@typescript-eslint/eslint-plugin@5.59.5)(@typescript-eslint/parser@5.59.5)(eslint-config-prettier@8.8.0)(eslint-import-resolver-typescript@3.5.5)(eslint-plugin-import@2.27.5)(eslint-plugin-sonarjs@0.19.0)(eslint-plugin-unicorn@46.0.1)(eslint@8.40.0): - resolution: {integrity: sha512-q2hTWBprRXCQd71wS5b5xWf0/LtRk2e1uxasCo08tMymlNh85Tmd8eH09rwIcIc3JOf48vFasXC3brOSinfU8Q==} - peerDependencies: - '@typescript-eslint/eslint-plugin': '>=5 <6' - '@typescript-eslint/parser': '>=5 <6' - eslint: '>=8 <9' - eslint-config-prettier: '>=8 <9' - eslint-import-resolver-typescript: '>=3 <4' - eslint-plugin-import: '>=2 <3' - eslint-plugin-sonarjs: '>=0.19 <0.20' - eslint-plugin-unicorn: '>=46 <47' - dependencies: - '@typescript-eslint/eslint-plugin': 5.59.5(@typescript-eslint/parser@5.59.5)(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/parser': 5.59.5(eslint@8.40.0)(typescript@5.0.4) - eslint: 8.40.0 - eslint-config-prettier: 8.8.0(eslint@8.40.0) - eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/parser@5.59.5)(eslint-plugin-import@2.27.5)(eslint@8.40.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.59.5)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0) - eslint-plugin-sonarjs: 0.19.0(eslint@8.40.0) - eslint-plugin-unicorn: 46.0.1(eslint@8.40.0) - dev: true - - /@viamrobotics/prettier-config@0.0.1(prettier@2.8.8): - resolution: {integrity: sha512-z7tnrOlkbH/gs1Ict4dGriCpM+H5ywzyzqgLDY/XCgrTGWoH/AiGQ9Keym3xBfU3XkjJj7w6UWw7i8Bvh9Pizg==} - peerDependencies: - prettier: '>=2 <3' - dependencies: - prettier: 2.8.8 - dev: true - - /@viamrobotics/typescript-config@0.0.3(typescript@5.0.4): - resolution: {integrity: sha512-SEsauLS3OYbrK3k+eMMgouh2BQyi4Nk6yUCbn0aPNHPzSD+MszT+mKsdeAscrcnnjfWFR9cFQ6aadr0d753+3w==} - peerDependencies: - typescript: '>=5 <6' + /@typescript-eslint/visitor-keys@6.7.4: + resolution: {integrity: sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==} + engines: {node: ^16.0.0 || >=18.0.0} dependencies: - typescript: 5.0.4 + '@typescript-eslint/types': 6.7.4 + eslint-visitor-keys: 3.4.3 dev: true /@vitest/coverage-istanbul@0.31.0(vitest@0.31.0): @@ -848,12 +847,12 @@ packages: pretty-format: 27.5.1 dev: true - /acorn-jsx@5.3.2(acorn@8.8.2): + /acorn-jsx@5.3.2(acorn@8.10.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.8.2 + acorn: 8.10.0 dev: true /acorn-walk@8.2.0: @@ -861,6 +860,12 @@ packages: engines: {node: '>=0.4.0'} dev: true + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /acorn@8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} @@ -916,67 +921,19 @@ packages: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} dev: true - /array-buffer-byte-length@1.0.0: - resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} - dependencies: - call-bind: 1.0.2 - is-array-buffer: 3.0.2 - dev: true - - /array-includes@3.1.6: - resolution: {integrity: sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - get-intrinsic: 1.2.0 - is-string: 1.0.7 - dev: true - /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /array.prototype.flat@1.3.1: - resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - es-shim-unscopables: 1.0.0 - dev: true - - /array.prototype.flatmap@1.3.1: - resolution: {integrity: sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - es-shim-unscopables: 1.0.0 - dev: true - /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true - /available-typed-arrays@1.0.5: - resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} - engines: {node: '>= 0.4'} - dev: true - /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true - /big-integer@1.6.51: - resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} - engines: {node: '>=0.6'} - dev: true - /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} @@ -986,13 +943,6 @@ packages: resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} dev: true - /bplist-parser@0.2.0: - resolution: {integrity: sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==} - engines: {node: '>= 5.10.0'} - dependencies: - big-integer: 1.6.51 - dev: true - /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -1023,13 +973,6 @@ packages: engines: {node: '>=6'} dev: true - /bundle-name@3.0.0: - resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} - engines: {node: '>=12'} - dependencies: - run-applescript: 5.0.0 - dev: true - /bundle-require@4.0.1(esbuild@0.17.18): resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1045,13 +988,6 @@ packages: engines: {node: '>=8'} dev: true - /call-bind@1.0.2: - resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} - dependencies: - function-bind: 1.1.1 - get-intrinsic: 1.2.0 - dev: true - /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -1218,17 +1154,6 @@ packages: time-zone: 1.0.0 dev: true - /debug@3.2.7: - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true - /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -1252,37 +1177,6 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true - /default-browser-id@3.0.0: - resolution: {integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==} - engines: {node: '>=12'} - dependencies: - bplist-parser: 0.2.0 - untildify: 4.0.0 - dev: true - - /default-browser@4.0.0: - resolution: {integrity: sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==} - engines: {node: '>=14.16'} - dependencies: - bundle-name: 3.0.0 - default-browser-id: 3.0.0 - execa: 7.1.1 - titleize: 3.0.0 - dev: true - - /define-lazy-prop@3.0.0: - resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} - engines: {node: '>=12'} - dev: true - - /define-properties@1.2.0: - resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} - engines: {node: '>= 0.4'} - dependencies: - has-property-descriptors: 1.0.0 - object-keys: 1.1.1 - dev: true - /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -1290,13 +1184,6 @@ packages: path-type: 4.0.0 dev: true - /doctrine@2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} - dependencies: - esutils: 2.0.3 - dev: true - /doctrine@3.0.0: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} @@ -1312,84 +1199,12 @@ packages: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true - /enhanced-resolve@5.14.0: - resolution: {integrity: sha512-+DCows0XNwLDcUhbFJPdlQEVnT2zXlCv7hPxemTz86/O+B/hCQ+mb7ydkPKiflpVraqLPCAfu7lDy+hBXueojw==} - engines: {node: '>=10.13.0'} - dependencies: - graceful-fs: 4.2.11 - tapable: 2.2.1 - dev: true - /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: is-arrayish: 0.2.1 dev: true - /es-abstract@1.21.2: - resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.0 - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - es-set-tostringtag: 2.0.1 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.5 - get-intrinsic: 1.2.0 - get-symbol-description: 1.0.0 - globalthis: 1.0.3 - gopd: 1.0.1 - has: 1.0.3 - has-property-descriptors: 1.0.0 - has-proto: 1.0.1 - has-symbols: 1.0.3 - internal-slot: 1.0.5 - is-array-buffer: 3.0.2 - is-callable: 1.2.7 - is-negative-zero: 2.0.2 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.2 - is-string: 1.0.7 - is-typed-array: 1.1.10 - is-weakref: 1.0.2 - object-inspect: 1.12.3 - object-keys: 1.1.1 - object.assign: 4.1.4 - regexp.prototype.flags: 1.5.0 - safe-regex-test: 1.0.0 - string.prototype.trim: 1.2.7 - string.prototype.trimend: 1.0.6 - string.prototype.trimstart: 1.0.6 - typed-array-length: 1.0.4 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.9 - dev: true - - /es-set-tostringtag@2.0.1: - resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.0 - has: 1.0.3 - has-tostringtag: 1.0.0 - dev: true - - /es-shim-unscopables@1.0.0: - resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} - dependencies: - has: 1.0.3 - dev: true - - /es-to-primitive@1.2.1: - resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} - engines: {node: '>= 0.4'} - dependencies: - is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 - dev: true - /esbuild@0.17.18: resolution: {integrity: sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w==} engines: {node: '>=12'} @@ -1435,132 +1250,44 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier@8.8.0(eslint@8.40.0): - resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} + /eslint-config-prettier@9.0.0(eslint@8.51.0): + resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.40.0 - dev: true - - /eslint-import-resolver-node@0.3.7: - resolution: {integrity: sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==} - dependencies: - debug: 3.2.7 - is-core-module: 2.12.0 - resolve: 1.22.2 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-import-resolver-typescript@3.5.5(@typescript-eslint/parser@5.59.5)(eslint-plugin-import@2.27.5)(eslint@8.40.0): - resolution: {integrity: sha512-TdJqPHs2lW5J9Zpe17DZNQuDnox4xo2o+0tE7Pggain9Rbc19ik8kFtXdxZ250FVx2kF4vlt2RSf4qlUpG7bhw==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - eslint: '*' - eslint-plugin-import: '*' - dependencies: - debug: 4.3.4 - enhanced-resolve: 5.14.0 - eslint: 8.40.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.59.5)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.59.5)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0) - get-tsconfig: 4.5.0 - globby: 13.1.4 - is-core-module: 2.12.0 - is-glob: 4.0.3 - synckit: 0.8.5 - transitivePeerDependencies: - - '@typescript-eslint/parser' - - eslint-import-resolver-node - - eslint-import-resolver-webpack - - supports-color - dev: true - - /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.59.5)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0): - resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true - dependencies: - '@typescript-eslint/parser': 5.59.5(eslint@8.40.0)(typescript@5.0.4) - debug: 3.2.7 - eslint: 8.40.0 - eslint-import-resolver-node: 0.3.7 - eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/parser@5.59.5)(eslint-plugin-import@2.27.5)(eslint@8.40.0) - transitivePeerDependencies: - - supports-color + eslint: 8.51.0 dev: true - /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.59.5)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0): - resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} - engines: {node: '>=4'} + /eslint-plugin-promise@6.1.1(eslint@8.51.0): + resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true + eslint: ^7.0.0 || ^8.0.0 dependencies: - '@typescript-eslint/parser': 5.59.5(eslint@8.40.0)(typescript@5.0.4) - array-includes: 3.1.6 - array.prototype.flat: 1.3.1 - array.prototype.flatmap: 1.3.1 - debug: 3.2.7 - doctrine: 2.1.0 - eslint: 8.40.0 - eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.59.5)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0) - has: 1.0.3 - is-core-module: 2.12.0 - is-glob: 4.0.3 - minimatch: 3.1.2 - object.values: 1.1.6 - resolve: 1.22.2 - semver: 6.3.0 - tsconfig-paths: 3.14.2 - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color + eslint: 8.51.0 dev: true - /eslint-plugin-sonarjs@0.19.0(eslint@8.40.0): - resolution: {integrity: sha512-6+s5oNk5TFtVlbRxqZN7FIGmjdPCYQKaTzFPmqieCmsU1kBYDzndTeQav0xtQNwZJWu5awWfTGe8Srq9xFOGnw==} + /eslint-plugin-sonarjs@0.21.0(eslint@8.51.0): + resolution: {integrity: sha512-oezUDfFT5S6j3rQheZ4DLPrbetPmMS7zHIKWGHr0CM3g5JgyZroz1FpIKa4jV83NsGpmgIeagpokWDKIJzRQmw==} engines: {node: '>=14'} peerDependencies: eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.40.0 + eslint: 8.51.0 dev: true - /eslint-plugin-unicorn@46.0.1(eslint@8.40.0): - resolution: {integrity: sha512-setGhMTiLAddg1asdwjZ3hekIN5zLznNa5zll7pBPwFOka6greCKDQydfqy4fqyUhndi74wpDzClSQMEcmOaew==} - engines: {node: '>=14.18'} + /eslint-plugin-unicorn@48.0.1(eslint@8.51.0): + resolution: {integrity: sha512-FW+4r20myG/DqFcCSzoumaddKBicIPeFnTrifon2mWIzlfyvzwyqZjqVP7m4Cqr/ZYisS2aiLghkUWaPg6vtCw==} + engines: {node: '>=16'} peerDependencies: - eslint: '>=8.28.0' + eslint: '>=8.44.0' dependencies: - '@babel/helper-validator-identifier': 7.19.1 - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) + '@babel/helper-validator-identifier': 7.22.20 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.51.0) ci-info: 3.8.0 clean-regexp: 1.0.0 - eslint: 8.40.0 + eslint: 8.51.0 esquery: 1.5.0 indent-string: 4.0.0 is-builtin-module: 3.2.1 @@ -1569,43 +1296,34 @@ packages: pluralize: 8.0.0 read-pkg-up: 7.0.1 regexp-tree: 0.1.27 - regjsparser: 0.9.1 - safe-regex: 2.1.1 - semver: 7.5.0 + regjsparser: 0.10.0 + semver: 7.5.4 strip-indent: 3.0.0 dev: true - /eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - dev: true - - /eslint-scope@7.2.0: - resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 dev: true - /eslint-visitor-keys@3.4.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.40.0: - resolution: {integrity: sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==} + /eslint@8.51.0: + resolution: {integrity: sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - '@eslint-community/regexpp': 4.5.1 - '@eslint/eslintrc': 2.0.3 - '@eslint/js': 8.40.0 - '@humanwhocodes/config-array': 0.11.8 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.51.0) + '@eslint-community/regexpp': 4.9.1 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.51.0 + '@humanwhocodes/config-array': 0.11.11 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 @@ -1614,9 +1332,9 @@ packages: debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.0 - eslint-visitor-keys: 3.4.1 - espree: 9.5.2 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -1624,34 +1342,31 @@ packages: find-up: 5.0.0 glob-parent: 6.0.2 globals: 13.20.0 - grapheme-splitter: 1.0.4 + graphemer: 1.4.0 ignore: 5.2.4 - import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 - js-sdsl: 4.4.0 js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.1 + optionator: 0.9.3 strip-ansi: 6.0.1 - strip-json-comments: 3.1.1 text-table: 0.2.0 transitivePeerDependencies: - supports-color dev: true - /espree@9.5.2: - resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2(acorn@8.8.2) - eslint-visitor-keys: 3.4.1 + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + eslint-visitor-keys: 3.4.3 dev: true /esquery@1.5.0: @@ -1668,11 +1383,6 @@ packages: estraverse: 5.3.0 dev: true - /estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - dev: true - /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} @@ -1698,21 +1408,6 @@ packages: strip-final-newline: 2.0.0 dev: true - /execa@7.1.1: - resolution: {integrity: sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==} - engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 4.3.1 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.1.0 - onetime: 6.0.0 - signal-exit: 3.0.7 - strip-final-newline: 3.0.0 - dev: true - /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true @@ -1788,12 +1483,6 @@ packages: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true - /for-each@0.3.3: - resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} - dependencies: - is-callable: 1.2.7 - dev: true - /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true @@ -1810,20 +1499,6 @@ packages: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true - /function.prototype.name@1.1.5: - resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - functions-have-names: 1.2.3 - dev: true - - /functions-have-names@1.2.3: - resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - dev: true - /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -1838,31 +1513,11 @@ packages: resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} dev: true - /get-intrinsic@1.2.0: - resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} - dependencies: - function-bind: 1.1.1 - has: 1.0.3 - has-symbols: 1.0.3 - dev: true - /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} dev: true - /get-symbol-description@1.0.0: - resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - dev: true - - /get-tsconfig@4.5.0: - resolution: {integrity: sha512-MjhiaIWCJ1sAU4pIQ5i5OfOuHHxVo1oYeNsWTON7jxYkod8pHocXeh+SSbmu5OZZZK73B6cbJ2XADzXehLyovQ==} - dev: true - /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1911,13 +1566,6 @@ packages: type-fest: 0.20.2 dev: true - /globalthis@1.0.3: - resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} - engines: {node: '>= 0.4'} - dependencies: - define-properties: 1.2.0 - dev: true - /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -1930,33 +1578,8 @@ packages: slash: 3.0.0 dev: true - /globby@13.1.4: - resolution: {integrity: sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - dir-glob: 3.0.1 - fast-glob: 3.2.12 - ignore: 5.2.4 - merge2: 1.4.1 - slash: 4.0.0 - dev: true - - /gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - dependencies: - get-intrinsic: 1.2.0 - dev: true - - /graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - dev: true - - /grapheme-splitter@1.0.4: - resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} - dev: true - - /has-bigints@1.0.2: - resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true /has-flag@3.0.0: @@ -1969,29 +1592,6 @@ packages: engines: {node: '>=8'} dev: true - /has-property-descriptors@1.0.0: - resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} - dependencies: - get-intrinsic: 1.2.0 - dev: true - - /has-proto@1.0.1: - resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} - engines: {node: '>= 0.4'} - dev: true - - /has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - dev: true - - /has-tostringtag@1.0.0: - resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: true - /has@1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} @@ -2012,11 +1612,6 @@ packages: engines: {node: '>=10.17.0'} dev: true - /human-signals@4.3.1: - resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} - engines: {node: '>=14.18.0'} - dev: true - /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} @@ -2051,33 +1646,10 @@ packages: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true - /internal-slot@1.0.5: - resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.0 - has: 1.0.3 - side-channel: 1.0.4 - dev: true - - /is-array-buffer@3.0.2: - resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - is-typed-array: 1.1.10 - dev: true - /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true - /is-bigint@1.0.4: - resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} - dependencies: - has-bigints: 1.0.2 - dev: true - /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -2085,14 +1657,6 @@ packages: binary-extensions: 2.2.0 dev: true - /is-boolean-object@1.1.2: - resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true - /is-builtin-module@3.2.1: resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} engines: {node: '>=6'} @@ -2100,36 +1664,12 @@ packages: builtin-modules: 3.3.0 dev: true - /is-callable@1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} - dev: true - /is-core-module@2.12.0: resolution: {integrity: sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==} dependencies: has: 1.0.3 dev: true - /is-date-object@1.0.5: - resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - - /is-docker@2.2.1: - resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} - engines: {node: '>=8'} - hasBin: true - dev: true - - /is-docker@3.0.0: - resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - hasBin: true - dev: true - /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -2147,26 +1687,6 @@ packages: is-extglob: 2.1.1 dev: true - /is-inside-container@1.0.0: - resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} - engines: {node: '>=14.16'} - hasBin: true - dependencies: - is-docker: 3.0.0 - dev: true - - /is-negative-zero@2.0.2: - resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} - engines: {node: '>= 0.4'} - dev: true - - /is-number-object@1.0.7: - resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -2177,68 +1697,11 @@ packages: engines: {node: '>=8'} dev: true - /is-regex@1.1.4: - resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true - - /is-shared-array-buffer@1.0.2: - resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} - dependencies: - call-bind: 1.0.2 - dev: true - /is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} dev: true - /is-stream@3.0.0: - resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true - - /is-string@1.0.7: - resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - - /is-symbol@1.0.4: - resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: true - - /is-typed-array@1.1.10: - resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - dev: true - - /is-weakref@1.0.2: - resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} - dependencies: - call-bind: 1.0.2 - dev: true - - /is-wsl@2.2.0: - resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} - engines: {node: '>=8'} - dependencies: - is-docker: 2.2.1 - dev: true - /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true @@ -2294,10 +1757,6 @@ packages: engines: {node: '>=10'} dev: true - /js-sdsl@4.4.0: - resolution: {integrity: sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==} - dev: true - /js-string-escape@1.0.1: resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} engines: {node: '>= 0.8'} @@ -2343,13 +1802,6 @@ packages: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: true - /json5@1.0.2: - resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} - hasBin: true - dependencies: - minimist: 1.2.8 - dev: true - /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -2475,11 +1927,6 @@ packages: engines: {node: '>=6'} dev: true - /mimic-fn@4.0.0: - resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} - engines: {node: '>=12'} - dev: true - /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -2491,10 +1938,6 @@ packages: brace-expansion: 1.1.11 dev: true - /minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - dev: true - /mlly@1.2.0: resolution: {integrity: sha512-+c7A3CV0KGdKcylsI6khWyts/CYrGTrRVo4R/I7u/cUsy0Conxa6LUhiEzVKIw14lc2L5aiO4+SeVe4TeGRKww==} dependencies: @@ -2522,10 +1965,6 @@ packages: hasBin: true dev: true - /natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - dev: true - /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true @@ -2555,46 +1994,11 @@ packages: path-key: 3.1.1 dev: true - /npm-run-path@5.1.0: - resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - path-key: 4.0.0 - dev: true - /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} dev: true - /object-inspect@1.12.3: - resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} - dev: true - - /object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - dev: true - - /object.assign@4.1.4: - resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - has-symbols: 1.0.3 - object-keys: 1.1.1 - dev: true - - /object.values@1.1.6: - resolution: {integrity: sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: @@ -2608,33 +2012,16 @@ packages: mimic-fn: 2.1.0 dev: true - /onetime@6.0.0: - resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} - engines: {node: '>=12'} - dependencies: - mimic-fn: 4.0.0 - dev: true - - /open@9.1.0: - resolution: {integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==} - engines: {node: '>=14.16'} - dependencies: - default-browser: 4.0.0 - define-lazy-prop: 3.0.0 - is-inside-container: 1.0.0 - is-wsl: 2.2.0 - dev: true - - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - word-wrap: 1.2.3 dev: true /p-limit@2.3.0: @@ -2709,11 +2096,6 @@ packages: engines: {node: '>=8'} dev: true - /path-key@4.0.0: - resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} - engines: {node: '>=12'} - dev: true - /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true @@ -2788,9 +2170,9 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.0.3: + resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} + engines: {node: '>=14'} hasBin: true dev: true @@ -2851,17 +2233,8 @@ packages: hasBin: true dev: true - /regexp.prototype.flags@1.5.0: - resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - functions-have-names: 1.2.3 - dev: true - - /regjsparser@0.9.1: - resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==} + /regjsparser@0.10.0: + resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} hasBin: true dependencies: jsesc: 0.5.0 @@ -2911,13 +2284,6 @@ packages: fsevents: 2.3.2 dev: true - /run-applescript@5.0.0: - resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==} - engines: {node: '>=12'} - dependencies: - execa: 5.1.1 - dev: true - /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -2930,20 +2296,6 @@ packages: tslib: 2.5.0 dev: true - /safe-regex-test@1.0.0: - resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - is-regex: 1.1.4 - dev: true - - /safe-regex@2.1.1: - resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} - dependencies: - regexp-tree: 0.1.27 - dev: true - /semver@5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true @@ -2962,6 +2314,14 @@ packages: lru-cache: 6.0.0 dev: true + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -2978,14 +2338,6 @@ packages: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} dev: true - /side-channel@1.0.4: - resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - object-inspect: 1.12.3 - dev: true - /siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} dev: true @@ -2999,11 +2351,6 @@ packages: engines: {node: '>=8'} dev: true - /slash@4.0.0: - resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} - engines: {node: '>=12'} - dev: true - /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -3064,31 +2411,6 @@ packages: strip-ansi: 6.0.1 dev: true - /string.prototype.trim@1.2.7: - resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - - /string.prototype.trimend@1.0.6: - resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - - /string.prototype.trimstart@1.0.6: - resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -3096,21 +2418,11 @@ packages: ansi-regex: 5.0.1 dev: true - /strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} - dev: true - /strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} dev: true - /strip-final-newline@3.0.0: - resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} - engines: {node: '>=12'} - dev: true - /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -3169,19 +2481,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /synckit@0.8.5: - resolution: {integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==} - engines: {node: ^14.18.0 || >=16.0.0} - dependencies: - '@pkgr/utils': 2.4.0 - tslib: 2.5.0 - dev: true - - /tapable@2.2.1: - resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} - engines: {node: '>=6'} - dev: true - /test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} @@ -3227,11 +2526,6 @@ packages: engines: {node: '>=14.0.0'} dev: true - /titleize@3.0.0: - resolution: {integrity: sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==} - engines: {node: '>=12'} - dev: true - /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} @@ -3255,28 +2549,24 @@ packages: hasBin: true dev: true - /ts-interface-checker@0.1.13: - resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - dev: true - - /tsconfig-paths@3.14.2: - resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} + /ts-api-utils@1.0.3(typescript@5.2.2): + resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} + engines: {node: '>=16.13.0'} + peerDependencies: + typescript: '>=4.2.0' dependencies: - '@types/json5': 0.0.29 - json5: 1.0.2 - minimist: 1.2.8 - strip-bom: 3.0.0 + typescript: 5.2.2 dev: true - /tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + /ts-interface-checker@0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true /tslib@2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} dev: true - /tsup@6.7.0(typescript@5.0.4): + /tsup@6.7.0(typescript@5.2.2): resolution: {integrity: sha512-L3o8hGkaHnu5TdJns+mCqFsDBo83bJ44rlK7e6VdanIvpea4ArPcU3swWGsLVbXak1PqQx/V+SSmFPujBK+zEQ==} engines: {node: '>=14.18'} hasBin: true @@ -3306,22 +2596,12 @@ packages: source-map: 0.8.0-beta.0 sucrase: 3.32.0 tree-kill: 1.2.2 - typescript: 5.0.4 + typescript: 5.2.2 transitivePeerDependencies: - supports-color - ts-node dev: true - /tsutils@3.21.0(typescript@5.0.4): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - dependencies: - tslib: 1.14.1 - typescript: 5.0.4 - dev: true - /type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -3349,17 +2629,9 @@ packages: engines: {node: '>=8'} dev: true - /typed-array-length@1.0.4: - resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} - dependencies: - call-bind: 1.0.2 - for-each: 0.3.3 - is-typed-array: 1.1.10 - dev: true - - /typescript@5.0.4: - resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} - engines: {node: '>=12.20'} + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + engines: {node: '>=14.17'} hasBin: true dev: true @@ -3367,20 +2639,6 @@ packages: resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true - /unbox-primitive@1.0.2: - resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} - dependencies: - call-bind: 1.0.2 - has-bigints: 1.0.2 - has-symbols: 1.0.3 - which-boxed-primitive: 1.0.2 - dev: true - - /untildify@4.0.0: - resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} - engines: {node: '>=8'} - dev: true - /update-browserslist-db@1.0.11(browserslist@4.21.5): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true @@ -3541,28 +2799,6 @@ packages: webidl-conversions: 4.0.2 dev: true - /which-boxed-primitive@1.0.2: - resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} - dependencies: - is-bigint: 1.0.4 - is-boolean-object: 1.1.2 - is-number-object: 1.0.7 - is-string: 1.0.7 - is-symbol: 1.0.4 - dev: true - - /which-typed-array@1.1.9: - resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - is-typed-array: 1.1.10 - dev: true - /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -3580,11 +2816,6 @@ packages: stackback: 0.0.2 dev: true - /word-wrap@1.2.3: - resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} - engines: {node: '>=0.10.0'} - dev: true - /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} diff --git a/src/behaviors.ts b/src/behaviors.ts index 8b2a8e8..4ad8298 100644 --- a/src/behaviors.ts +++ b/src/behaviors.ts @@ -1,57 +1,55 @@ -import { equals } from '@vitest/expect'; -import type { AnyFunction } from './types.ts'; +import { equals } from '@vitest/expect' +import type { AnyFunction } from './types.ts' -export const ONCE = Symbol('ONCE'); +export const ONCE = Symbol('ONCE') -export type StubValue = TValue | typeof ONCE; +export type StubValue = TValue | typeof ONCE export interface BehaviorStack { - use: ( - args: Parameters - ) => BehaviorEntry> | undefined; + use: (args: Parameters) => BehaviorEntry> | undefined bindArgs: >( - args: TArgs - ) => BoundBehaviorStack>; + args: TArgs, + ) => BoundBehaviorStack> } export interface BoundBehaviorStack { - addReturn: (values: StubValue[]) => void; - addResolve: (values: StubValue>[]) => void; - addThrow: (values: StubValue[]) => void; - addReject: (values: StubValue[]) => void; - addDo: (values: StubValue[]) => void; + addReturn: (values: StubValue[]) => void + addResolve: (values: StubValue>[]) => void + addThrow: (values: StubValue[]) => void + addReject: (values: StubValue[]) => void + addDo: (values: StubValue[]) => void } export interface BehaviorEntry { - args: TArgs; - returnValue?: unknown; - throwError?: unknown | undefined; - doCallback?: AnyFunction | undefined; - times?: number | undefined; + args: TArgs + returnValue?: unknown + throwError?: unknown + doCallback?: AnyFunction | undefined + times?: number | undefined } export interface BehaviorOptions { - value: TValue; - times: number | undefined; + value: TValue + times: number | undefined } export const createBehaviorStack = < - TFunc extends AnyFunction + TFunc extends AnyFunction, >(): BehaviorStack => { - const behaviors: BehaviorEntry>[] = []; + const behaviors: BehaviorEntry>[] = [] return { use: (args) => { const behavior = behaviors .filter((b) => behaviorAvailable(b)) - .find(behaviorHasArgs(args)); + .find(behaviorMatches(args)) if (behavior?.times !== undefined) { - behavior.times -= 1; + behavior.times -= 1 } - return behavior; + return behavior }, bindArgs: (args) => ({ @@ -61,8 +59,8 @@ export const createBehaviorStack = < args, times, returnValue: value, - })) - ); + })), + ) }, addResolve: (values) => { behaviors.unshift( @@ -70,8 +68,8 @@ export const createBehaviorStack = < args, times, returnValue: Promise.resolve(value), - })) - ); + })), + ) }, addThrow: (values) => { behaviors.unshift( @@ -79,8 +77,8 @@ export const createBehaviorStack = < args, times, throwError: value, - })) - ); + })), + ) }, addReject: (values) => { behaviors.unshift( @@ -88,8 +86,8 @@ export const createBehaviorStack = < args, times, returnValue: Promise.reject(value), - })) - ); + })), + ) }, addDo: (values) => { behaviors.unshift( @@ -97,47 +95,47 @@ export const createBehaviorStack = < args, times, doCallback: value, - })) - ); + })), + ) }, }), - }; -}; + } +} const getBehaviorOptions = ( - valuesAndOptions: StubValue[] + valuesAndOptions: StubValue[], ): BehaviorOptions[] => { - const once = valuesAndOptions.includes(ONCE); - let values = valuesAndOptions.filter((value) => value !== ONCE) as TValue[]; + const once = valuesAndOptions.includes(ONCE) + let values = valuesAndOptions.filter((value) => value !== ONCE) as TValue[] if (values.length === 0) { - values = [undefined as TValue]; + values = [undefined as TValue] } - return values.map((value, i) => ({ + return values.map((value, index) => ({ value, - times: once || i < values.length - 1 ? 1 : undefined, - })); -}; + times: once || index < values.length - 1 ? 1 : undefined, + })) +} const behaviorAvailable = ( - behavior: BehaviorEntry + behavior: BehaviorEntry, ): boolean => { - return behavior.times === undefined || behavior.times > 0; -}; + return behavior.times === undefined || behavior.times > 0 +} -const behaviorHasArgs = (args: TArgs) => { +const behaviorMatches = (args: TArgs) => { return (behavior: BehaviorEntry): boolean => { - let i = 0; + let index = 0 - while (i < args.length || i < behavior.args.length) { - if (!equals(args[i], behavior.args[i])) { - return false; + while (index < args.length || index < behavior.args.length) { + if (!equals(args[index], behavior.args[index])) { + return false } - i += 1; + index += 1 } - return true; - }; -}; + return true + } +} diff --git a/src/errors.ts b/src/errors.ts index 5717b0f..f096dec 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,6 +1,6 @@ export class NotAMockFunctionError extends TypeError { constructor(value: unknown) { - super(`when() must be given a Vite mock, but received ${String(value)}`); - this.name = 'NotAMockFunctionError'; + super(`when() must be given a Vite mock, but received ${String(value)}`) + this.name = 'NotAMockFunctionError' } } diff --git a/src/stubs.ts b/src/stubs.ts index 76083e3..6a2c8b0 100644 --- a/src/stubs.ts +++ b/src/stubs.ts @@ -1,53 +1,53 @@ -import type { Mock as Spy } from 'vitest'; -import { createBehaviorStack, type BehaviorStack } from './behaviors.ts'; -import { NotAMockFunctionError } from './errors.ts'; -import type { AnyFunction } from './types.ts'; +import type { Mock as Spy } from 'vitest' +import { createBehaviorStack, type BehaviorStack } from './behaviors.ts' +import { NotAMockFunctionError } from './errors.ts' +import type { AnyFunction } from './types.ts' -const BEHAVIORS_KEY = Symbol('behaviors'); +const BEHAVIORS_KEY = Symbol('behaviors') interface WhenStubImplementation { - (...args: Parameters): unknown; - [BEHAVIORS_KEY]: BehaviorStack; + (...args: Parameters): unknown + [BEHAVIORS_KEY]: BehaviorStack } export const configureStub = ( - maybeSpy: unknown + maybeSpy: unknown, ): BehaviorStack => { - const spy = validateSpy(maybeSpy); + const spy = validateSpy(maybeSpy) const existingImplementation = spy.getMockImplementation() as | WhenStubImplementation | TFunc - | undefined; + | undefined if (existingImplementation && BEHAVIORS_KEY in existingImplementation) { - return existingImplementation[BEHAVIORS_KEY]; + return existingImplementation[BEHAVIORS_KEY] } - const behaviors = createBehaviorStack(); + const behaviors = createBehaviorStack() const implementation = (...args: Parameters): unknown => { - const behavior = behaviors.use(args); + const behavior = behaviors.use(args) if (behavior?.throwError) { - throw behavior.throwError as Error; + throw behavior.throwError as Error } if (behavior?.doCallback) { - return behavior.doCallback(...args); + return behavior.doCallback(...args) } - return behavior?.returnValue; - }; + return behavior?.returnValue + } spy.mockImplementation( - Object.assign(implementation, { [BEHAVIORS_KEY]: behaviors }) - ); + Object.assign(implementation, { [BEHAVIORS_KEY]: behaviors }), + ) - return behaviors; -}; + return behaviors +} const validateSpy = ( - maybeSpy: unknown + maybeSpy: unknown, ): Spy, unknown> => { if ( typeof maybeSpy === 'function' && @@ -56,8 +56,8 @@ const validateSpy = ( 'getMockImplementation' in maybeSpy && typeof maybeSpy.getMockImplementation === 'function' ) { - return maybeSpy as Spy, unknown>; + return maybeSpy as Spy, unknown> } - throw new NotAMockFunctionError(maybeSpy); -}; + throw new NotAMockFunctionError(maybeSpy) +} diff --git a/src/types.ts b/src/types.ts index b73a897..08b5f82 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ /** Common type definitions. */ /** Any function, for use in `extends` */ -export type AnyFunction = (...args: never[]) => unknown; +export type AnyFunction = (...args: never[]) => unknown diff --git a/src/vitest-when.ts b/src/vitest-when.ts index 016e2b9..5d163f4 100644 --- a/src/vitest-when.ts +++ b/src/vitest-when.ts @@ -1,32 +1,32 @@ -import { configureStub } from './stubs.ts'; -import type { StubValue } from './behaviors.ts'; -import type { AnyFunction } from './types.ts'; +import { configureStub } from './stubs.ts' +import type { StubValue } from './behaviors.ts' +import type { AnyFunction } from './types.ts' -export { ONCE, type StubValue } from './behaviors.ts'; -export * from './errors.ts'; +export { ONCE, type StubValue } from './behaviors.ts' +export * from './errors.ts' export interface StubWrapper { calledWith>( ...args: TArgs - ): Stub>; + ): Stub> } export interface Stub { - thenReturn: (...values: StubValue[]) => void; - thenResolve: (...values: StubValue>[]) => void; - thenThrow: (...errors: StubValue[]) => void; - thenReject: (...errors: StubValue[]) => void; - thenDo: (...callbacks: StubValue<(...args: TArgs) => TReturn>[]) => void; + thenReturn: (...values: StubValue[]) => void + thenResolve: (...values: StubValue>[]) => void + thenThrow: (...errors: StubValue[]) => void + thenReject: (...errors: StubValue[]) => void + thenDo: (...callbacks: StubValue<(...args: TArgs) => TReturn>[]) => void } export const when = ( - spy: TFunc + spy: TFunc, ): StubWrapper => { - const behaviorStack = configureStub(spy); + const behaviorStack = configureStub(spy) return { calledWith: (...args) => { - const boundBehaviors = behaviorStack.bindArgs(args); + const boundBehaviors = behaviorStack.bindArgs(args) return { thenReturn: (...values) => boundBehaviors.addReturn(values), @@ -34,7 +34,7 @@ export const when = ( thenThrow: (...errors) => boundBehaviors.addThrow(errors), thenReject: (...errors) => boundBehaviors.addReject(errors), thenDo: (...callbacks) => boundBehaviors.addDo(callbacks), - }; + } }, - }; -}; + } +} diff --git a/test/typing.test-d.ts b/test/typing.test-d.ts index eb33aab..98e8295 100644 --- a/test/typing.test-d.ts +++ b/test/typing.test-d.ts @@ -4,94 +4,94 @@ func-style */ -import { vi, describe, it, assertType } from 'vitest'; -import * as subject from '../src/vitest-when.ts'; +import { vi, describe, it, assertType } from 'vitest' +import * as subject from '../src/vitest-when.ts' describe('vitest-when type signatures', () => { it('should handle an anonymous mock', () => { - const spy = vi.fn(); - const stub = subject.when(spy).calledWith(1, 2, 3); + const spy = vi.fn() + const stub = subject.when(spy).calledWith(1, 2, 3) - assertType>(stub); - }); + assertType>(stub) + }) it('should handle an untyped function', () => { - const stub = subject.when(untyped).calledWith(1); + const stub = subject.when(untyped).calledWith(1) - stub.thenReturn('hello'); + stub.thenReturn('hello') - assertType>(stub); - }); + assertType>(stub) + }) it('should handle a simple function', () => { - const stub = subject.when(simple).calledWith(1); + const stub = subject.when(simple).calledWith(1) - stub.thenReturn('hello'); + stub.thenReturn('hello') - assertType>(stub); - }); + assertType>(stub) + }) it('should handle a generic function', () => { - const stub = subject.when(generic).calledWith(1); + const stub = subject.when(generic).calledWith(1) - stub.thenReturn('hello'); + stub.thenReturn('hello') - assertType>(stub); - }); + assertType>(stub) + }) it('should handle an overloaded function using its last overload', () => { - const stub = subject.when(overloaded).calledWith(1); + const stub = subject.when(overloaded).calledWith(1) - stub.thenReturn('hello'); + stub.thenReturn('hello') - assertType>(stub); - }); + assertType>(stub) + }) it('should handle an overloaded function using an explicit type', () => { - const stub = subject.when<() => null>(overloaded).calledWith(); + const stub = subject.when<() => boolean>(overloaded).calledWith() - stub.thenReturn(null); + stub.thenReturn(true) - assertType>(stub); - }); + assertType>(stub) + }) it('should reject invalid usage of a simple function', () => { // @ts-expect-error: args missing - subject.when(simple).calledWith(); + subject.when(simple).calledWith() // @ts-expect-error: args wrong type - subject.when(simple).calledWith('hello'); + subject.when(simple).calledWith('hello') // @ts-expect-error: return wrong type - subject.when(simple).calledWith(1).thenReturn(42); - }); + subject.when(simple).calledWith(1).thenReturn(42) + }) it('should reject invalid usage of a generic function', () => { // @ts-expect-error: args missing - subject.when(generic).calledWith(); + subject.when(generic).calledWith() // @ts-expect-error: args wrong type - subject.when(generic).calledWith(42); + subject.when(generic).calledWith(42) // @ts-expect-error: return wrong type - subject.when(generic).calledWith(1).thenReturn(42); - }); -}); + subject.when(generic).calledWith(1).thenReturn(42) + }) +}) function untyped(...args: any[]): any { - throw new Error(`untyped(...${args})`); + throw new Error(`untyped(...${args})`) } function simple(input: number): string { - throw new Error(`simple(${input})`); + throw new Error(`simple(${input})`) } function generic(input: T): string { - throw new Error(`generic(${input})`); + throw new Error(`generic(${input})`) } -function overloaded(): null; -function overloaded(input: number): string; -function overloaded(input?: number): string | null { - throw new Error(`overloaded(${input})`); +function overloaded(): boolean +function overloaded(input: number): string +function overloaded(input?: number): string | boolean { + throw new Error(`overloaded(${input})`) } diff --git a/test/vitest-when.test.ts b/test/vitest-when.test.ts index 7b7ffba..e534ac6 100644 --- a/test/vitest-when.test.ts +++ b/test/vitest-when.test.ts @@ -1,10 +1,10 @@ -import { vi, describe, expect, it } from 'vitest'; +import { vi, describe, expect, it } from 'vitest' -import * as subject from '../src/vitest-when.ts'; +import * as subject from '../src/vitest-when.ts' declare module 'vitest' { interface AsymmetricMatchersContaining { - toBeFoo(): unknown; + toBeFoo(): unknown } } @@ -13,183 +13,183 @@ expect.extend({ return { pass: received === 'foo', message: () => '', - }; + } }, -}); +}) -const noop = () => null; +const noop = () => undefined describe('vitest-when', () => { it('should raise an error if passed a non-spy', () => { expect(() => { - subject.when(noop); - }).toThrow(subject.NotAMockFunctionError); - }); + subject.when(noop) + }).toThrow(subject.NotAMockFunctionError) + }) it('should return undefined by default', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenReturn(4); + subject.when(spy).calledWith(1, 2, 3).thenReturn(4) - expect(spy()).toEqual(undefined); - expect(spy(1)).toEqual(undefined); - expect(spy(1, 2)).toEqual(undefined); - expect(spy(1, 2, 3, 4)).toEqual(undefined); - expect(spy(4, 5, 6)).toEqual(undefined); - }); + expect(spy()).toEqual(undefined) + expect(spy(1)).toEqual(undefined) + expect(spy(1, 2)).toEqual(undefined) + expect(spy(1, 2, 3, 4)).toEqual(undefined) + expect(spy(4, 5, 6)).toEqual(undefined) + }) it('should return a value', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenReturn(4); + subject.when(spy).calledWith(1, 2, 3).thenReturn(4) - expect(spy(1, 2, 3)).toEqual(4); - expect(spy(1, 2, 3)).toEqual(4); - }); + expect(spy(1, 2, 3)).toEqual(4) + expect(spy(1, 2, 3)).toEqual(4) + }) it('should return undefined if passed nothing', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenReturn(); + subject.when(spy).calledWith(1, 2, 3).thenReturn() - expect(spy(1, 2, 3)).toEqual(undefined); - }); + expect(spy(1, 2, 3)).toEqual(undefined) + }) it('should return a value once', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenReturn(4, subject.ONCE); + subject.when(spy).calledWith(1, 2, 3).thenReturn(4, subject.ONCE) - expect(spy(1, 2, 3)).toEqual(4); - expect(spy(1, 2, 3)).toEqual(undefined); - }); + expect(spy(1, 2, 3)).toEqual(4) + expect(spy(1, 2, 3)).toEqual(undefined) + }) it('should be resettable', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenReturn(4); - vi.resetAllMocks(); + subject.when(spy).calledWith(1, 2, 3).thenReturn(4) + vi.resetAllMocks() - expect(spy(1, 2, 3)).toEqual(undefined); - }); + expect(spy(1, 2, 3)).toEqual(undefined) + }) it('should throw an error', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenThrow(new Error('oh no')); + subject.when(spy).calledWith(1, 2, 3).thenThrow(new Error('oh no')) expect(() => { - spy(1, 2, 3); - }).toThrow('oh no'); - }); + spy(1, 2, 3) + }).toThrow('oh no') + }) it('should resolve a Promise', async () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenResolve(4); + subject.when(spy).calledWith(1, 2, 3).thenResolve(4) - await expect(spy(1, 2, 3)).resolves.toEqual(4); - }); + await expect(spy(1, 2, 3)).resolves.toEqual(4) + }) it('should resolve undefined if passed nothing', async () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenResolve(); + subject.when(spy).calledWith(1, 2, 3).thenResolve() - await expect(spy(1, 2, 3)).resolves.toEqual(undefined); - }); + await expect(spy(1, 2, 3)).resolves.toEqual(undefined) + }) it('should reject a Promise', async () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenReject(new Error('oh no')); + subject.when(spy).calledWith(1, 2, 3).thenReject(new Error('oh no')) - await expect(spy(1, 2, 3)).rejects.toThrow('oh no'); - }); + await expect(spy(1, 2, 3)).rejects.toThrow('oh no') + }) it('should do a callback', () => { - const spy = vi.fn(); - const callback = vi.fn(() => 4); + const spy = vi.fn() + const callback = vi.fn(() => 4) - subject.when(spy).calledWith(1, 2, 3).thenDo(callback); + subject.when(spy).calledWith(1, 2, 3).thenDo(callback) - expect(spy(1, 2, 3)).toEqual(4); - expect(callback).toHaveBeenCalledWith(1, 2, 3); - expect(callback).toHaveBeenCalledTimes(1); - }); + expect(spy(1, 2, 3)).toEqual(4) + expect(callback).toHaveBeenCalledWith(1, 2, 3) + expect(callback).toHaveBeenCalledTimes(1) + }) it('should return multiple values', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenReturn(4, 5, 6); + subject.when(spy).calledWith(1, 2, 3).thenReturn(4, 5, 6) - expect(spy(1, 2, 3)).toEqual(4); - expect(spy(1, 2, 3)).toEqual(5); - expect(spy(1, 2, 3)).toEqual(6); - expect(spy(1, 2, 3)).toEqual(6); - }); + expect(spy(1, 2, 3)).toEqual(4) + expect(spy(1, 2, 3)).toEqual(5) + expect(spy(1, 2, 3)).toEqual(6) + expect(spy(1, 2, 3)).toEqual(6) + }) it('should resolve multiple values', async () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenResolve(4, 5, 6); + subject.when(spy).calledWith(1, 2, 3).thenResolve(4, 5, 6) - await expect(spy(1, 2, 3)).resolves.toEqual(4); - await expect(spy(1, 2, 3)).resolves.toEqual(5); - await expect(spy(1, 2, 3)).resolves.toEqual(6); - await expect(spy(1, 2, 3)).resolves.toEqual(6); - }); + await expect(spy(1, 2, 3)).resolves.toEqual(4) + await expect(spy(1, 2, 3)).resolves.toEqual(5) + await expect(spy(1, 2, 3)).resolves.toEqual(6) + await expect(spy(1, 2, 3)).resolves.toEqual(6) + }) it('should reject multiple errors', async () => { - const spy = vi.fn(); + const spy = vi.fn() subject .when(spy) .calledWith(1, 2, 3) - .thenReject(new Error('4'), new Error('5'), new Error('6')); + .thenReject(new Error('4'), new Error('5'), new Error('6')) - await expect(spy(1, 2, 3)).rejects.toThrow('4'); - await expect(spy(1, 2, 3)).rejects.toThrow('5'); - await expect(spy(1, 2, 3)).rejects.toThrow('6'); - await expect(spy(1, 2, 3)).rejects.toThrow('6'); - }); + await expect(spy(1, 2, 3)).rejects.toThrow('4') + await expect(spy(1, 2, 3)).rejects.toThrow('5') + await expect(spy(1, 2, 3)).rejects.toThrow('6') + await expect(spy(1, 2, 3)).rejects.toThrow('6') + }) it('should reject once', async () => { - const spy = vi.fn(); + const spy = vi.fn() subject .when(spy) .calledWith(1, 2, 3) - .thenReject(new Error('4'), subject.ONCE); + .thenReject(new Error('4'), subject.ONCE) - await expect(spy(1, 2, 3)).rejects.toThrow('4'); - expect(spy(1, 2, 3)).toEqual(undefined); - }); + await expect(spy(1, 2, 3)).rejects.toThrow('4') + expect(spy(1, 2, 3)).toEqual(undefined) + }) it('should throw multiple errors', () => { - const spy = vi.fn(); + const spy = vi.fn() subject .when(spy) .calledWith(1, 2, 3) - .thenThrow(new Error('4'), new Error('5'), new Error('6')); + .thenThrow(new Error('4'), new Error('5'), new Error('6')) expect(() => { - spy(1, 2, 3); - }).toThrow('4'); + spy(1, 2, 3) + }).toThrow('4') expect(() => { - spy(1, 2, 3); - }).toThrow('5'); + spy(1, 2, 3) + }).toThrow('5') expect(() => { - spy(1, 2, 3); - }).toThrow('6'); + spy(1, 2, 3) + }).toThrow('6') expect(() => { - spy(1, 2, 3); - }).toThrow('6'); - }); + spy(1, 2, 3) + }).toThrow('6') + }) it('should call multiple callbacks', () => { - const spy = vi.fn(); + const spy = vi.fn() subject .when(spy) @@ -197,61 +197,61 @@ describe('vitest-when', () => { .thenDo( () => 4, () => 5, - () => 6 - ); + () => 6, + ) - expect(spy(1, 2, 3)).toEqual(4); - expect(spy(1, 2, 3)).toEqual(5); - expect(spy(1, 2, 3)).toEqual(6); - expect(spy(1, 2, 3)).toEqual(6); - }); + expect(spy(1, 2, 3)).toEqual(4) + expect(spy(1, 2, 3)).toEqual(5) + expect(spy(1, 2, 3)).toEqual(6) + expect(spy(1, 2, 3)).toEqual(6) + }) it('should allow multiple different stubs', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenReturn(4); - subject.when(spy).calledWith(4, 5, 6).thenReturn(7); + subject.when(spy).calledWith(1, 2, 3).thenReturn(4) + subject.when(spy).calledWith(4, 5, 6).thenReturn(7) - expect(spy(1, 2, 3)).toEqual(4); - expect(spy(4, 5, 6)).toEqual(7); - }); + expect(spy(1, 2, 3)).toEqual(4) + expect(spy(4, 5, 6)).toEqual(7) + }) it('should use the latest stub', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(1, 2, 3).thenReturn(4); - subject.when(spy).calledWith(1, 2, 3).thenReturn(1000); + subject.when(spy).calledWith(1, 2, 3).thenReturn(4) + subject.when(spy).calledWith(1, 2, 3).thenReturn(1000) - expect(spy(1, 2, 3)).toEqual(1000); - }); + expect(spy(1, 2, 3)).toEqual(1000) + }) it('should respect asymmetric matchers', () => { - const spy = vi.fn(); + const spy = vi.fn() subject .when(spy) .calledWith(expect.stringContaining('foo')) - .thenReturn(1000); + .thenReturn(1000) - expect(spy('foobar')).toEqual(1000); - }); + expect(spy('foobar')).toEqual(1000) + }) it('should respect custom asymmetric matchers', () => { - const spy = vi.fn(); + const spy = vi.fn() - subject.when(spy).calledWith(expect.toBeFoo()).thenReturn(1000); + subject.when(spy).calledWith(expect.toBeFoo()).thenReturn(1000) - expect(spy('foo')).toEqual(1000); - }); + expect(spy('foo')).toEqual(1000) + }) it('should deeply check object arguments', () => { - const spy = vi.fn(); + const spy = vi.fn() subject .when(spy) .calledWith({ foo: { bar: { baz: 0 } } }) - .thenReturn(100); + .thenReturn(100) - expect(spy({ foo: { bar: { baz: 0 } } })).toEqual(100); - }); -}); + expect(spy({ foo: { bar: { baz: 0 } } })).toEqual(100) + }) +}) diff --git a/tsconfig.json b/tsconfig.json index d737673..27e1f9a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,9 @@ { - "extends": "@viamrobotics/typescript-config/base.json", + "extends": "@mcous/typescript-config/base.json", "compilerOptions": { + "module": "esnext", + "moduleResolution": "bundler", + "target": "es2021", "noEmit": true, "allowImportingTsExtensions": true }, diff --git a/vitest.config.ts b/vitest.config.ts index c599007..1f51f9f 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from 'vitest/config'; +import { defineConfig } from 'vitest/config' export default defineConfig({ test: { @@ -8,4 +8,4 @@ export default defineConfig({ reporter: ['text', 'html', 'lcovonly'], }, }, -}); +})