diff --git a/Makefile b/Makefile index de57510..917c050 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ distclean: clean rm -rf node_modules .PHONY: test -test: node_modules +test: node_modules dist pnpm exec vitest .PHONY: test.update diff --git a/lib/command.ts b/lib/command.ts index e7145b2..67bd638 100644 --- a/lib/command.ts +++ b/lib/command.ts @@ -3,15 +3,15 @@ import type { JsonifiableObject } from 'type-fest/source/jsonifiable.js'; import type { HttpMethod } from './types.js'; type Middleware< - CommandInput extends JsonifiableObject | undefined, - CommandOutput extends Jsonifiable | undefined, + CommandInput extends JsonifiableObject | undefined = never, + CommandOutput extends Jsonifiable | undefined = never, > = (input: CommandInput, output: CommandOutput) => CommandOutput; export abstract class Command< - CommandInput extends JsonifiableObject | undefined, - CommandOutput extends Jsonifiable | undefined, - CommandBody extends Jsonifiable | undefined, - CommandQuery extends JsonifiableObject | undefined, + CommandInput extends JsonifiableObject | undefined = never, + CommandOutput extends Jsonifiable | undefined = never, + CommandBody extends Jsonifiable | undefined = never, + CommandQuery extends JsonifiableObject | undefined = never, > { public method: HttpMethod = 'get'; diff --git a/test/test1.test.ts b/test/test1.test.ts index 144f12e..8f239a9 100644 --- a/test/test1.test.ts +++ b/test/test1.test.ts @@ -11,10 +11,10 @@ import { import { BillingCountry } from './fixtures/test1/types.js'; async function thisAlwaysThrows< - CommandInput extends JsonifiableObject | undefined, - CommandOutput extends Jsonifiable | undefined, - CommandBody extends Jsonifiable | undefined, - CommandQuery extends JsonifiableObject | undefined, + CommandInput extends JsonifiableObject | undefined = never, + CommandOutput extends Jsonifiable | undefined = never, + CommandBody extends Jsonifiable | undefined = never, + CommandQuery extends JsonifiableObject | undefined = never, >( // eslint-disable-next-line @typescript-eslint/no-unused-vars _: Command,