From 4b885e098a798246cdb54b4391d90a88cef46a8e Mon Sep 17 00:00:00 2001 From: Jean <110341611+jean-michelet@users.noreply.github.com> Date: Mon, 29 Jul 2024 08:28:27 +0200 Subject: [PATCH] refactor: rename SensibleOptions into FastifySensibleOptions (#162) * refactor: deprecate SensibleOptions for FastifySensibleOptions * refactor - no need for deprecation --- types/index.d.ts | 4 ++-- types/index.test-d.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 2b99401..9f6fedd 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -2,7 +2,7 @@ import { FastifyPluginCallback, FastifyReply } from 'fastify' import { HttpErrors } from "../lib/httpError" import * as Errors from '../lib/httpError' -type FastifySensible = FastifyPluginCallback +type FastifySensible = FastifyPluginCallback type singleValueTypes = | 'must-revalidate' @@ -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. * diff --git a/types/index.test-d.ts b/types/index.test-d.ts index 4496cdc..5cc2b39 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -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({}); -expectAssignable({ sharedSchemaId: 'HttpError' }); -expectNotAssignable({ notSharedSchemaId: 'HttpError' }); +expectAssignable({}); +expectAssignable({ sharedSchemaId: 'HttpError' }); +expectNotAssignable({ notSharedSchemaId: 'HttpError' }); app.get('/', (req, reply) => { expectAssignable(reply.badRequest())