Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename SensibleOptions into FastifySensibleOptions #162

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FastifyPluginCallback, FastifyReply } from 'fastify'
import { HttpErrors } from "../lib/httpError"
import * as Errors from '../lib/httpError'

type FastifySensible = FastifyPluginCallback<fastifySensible.SensibleOptions>
type FastifySensible = FastifyPluginCallback<fastifySensible.FastifySensibleOptions>

type singleValueTypes =
| 'must-revalidate'
Expand Down Expand Up @@ -66,7 +66,7 @@ declare module 'fastify' {
}

declare namespace fastifySensible {
export interface SensibleOptions {
export interface FastifySensibleOptions {
/**
* This option registers a shared JSON Schema to be used by all response schemas.
*
Expand Down
8 changes: 4 additions & 4 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { expectType, expectAssignable, expectError, expectNotAssignable } from 'tsd'
import fastify from 'fastify'
import fastifySensible, { SensibleOptions, httpErrors, HttpError } from '..'
import fastifySensible, { FastifySensibleOptions, httpErrors, HttpError } from '..'

const app = fastify()

app.register(fastifySensible)

expectAssignable<SensibleOptions>({});
expectAssignable<SensibleOptions>({ sharedSchemaId: 'HttpError' });
expectNotAssignable<SensibleOptions>({ notSharedSchemaId: 'HttpError' });
expectAssignable<FastifySensibleOptions>({});
expectAssignable<FastifySensibleOptions>({ sharedSchemaId: 'HttpError' });
expectNotAssignable<FastifySensibleOptions>({ notSharedSchemaId: 'HttpError' });

app.get('/', (req, reply) => {
expectAssignable<typeof reply>(reply.badRequest())
Expand Down