Skip to content

Commit

Permalink
refactor: rename SensibleOptions into FastifySensibleOptions (#162)
Browse files Browse the repository at this point in the history
* refactor: deprecate SensibleOptions for FastifySensibleOptions

* refactor - no need for deprecation
  • Loading branch information
jean-michelet committed Jul 29, 2024
1 parent 575d16d commit 4b885e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit 4b885e0

Please sign in to comment.