Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@foodsy-app/fastify-typebox

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foodsy-app/fastify-typebox - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

fastify+3.1.1.patch

5

package.json
{
"name": "@foodsy-app/fastify-typebox",
"version": "2.0.0",
"version": "3.0.0",
"description": "Plugin for Fastify to prevent having to write duplicate type definitions for schemas",

@@ -33,3 +33,2 @@ "keywords": [

"clean": "rimraf index.js index.d.ts",
"postinstall": "patch-package",
"prepublishOnly": "npm run clean && npm run build"

@@ -40,4 +39,2 @@ },

"fastify-plugin": "^2.0.1",
"patch-package": "^6.2.2",
"postinstall-postinstall": "^2.1.0",
"rimraf": "^3.0.2"

@@ -44,0 +41,0 @@ },

45

README.md

@@ -7,6 +7,47 @@ # @foodsy-app/fastify-typebox

**Important!**
**Important note before using this plugin!**
This plugin uses [patch-package](https://www.npmjs.com/package/patch-package) to comment existing type declarations for request methods in `node_modules/fastify/types/instance.d.ts` since TypeScript does not allow to overwrite declarations. If you notice any problems, please post a issue.
This plugin requires [patch-package](https://www.npmjs.com/package/patch-package) to comment existing type declarations for request methods in `node_modules/fastify/types/instance.d.ts` since TypeScript does not allow to overwrite declarations.
Create a `fastify+3.1.1.patch` file (edit the version based on the Fastify version you have installed) and paste the block below inside:
```diff
diff --git a/node_modules/fastify/types/instance.d.ts b/node_modules/fastify/types/instance.d.ts
index 06380bd..558338d 100644
--- a/node_modules/fastify/types/instance.d.ts
+++ b/node_modules/fastify/types/instance.d.ts
@@ -66,14 +66,14 @@ export interface FastifyInstance<
ContextConfig = ContextConfigDefault
>(opts: RouteOptions<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig>): FastifyInstance<RawServer, RawRequest, RawReply, Logger>;
- get: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
- head: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
- post: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
- put: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
- delete: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
- options: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
- patch: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
- all: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
+ // get: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
+ // head: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
+ // post: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
+ // put: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
+ // delete: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
+ // options: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
+ // patch: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
+ // all: RouteShorthandMethod<RawServer, RawRequest, RawReply>;
// addHook: overloads
```
After this, run the following command:
```bash
npx patch-package --patch-dir .
```
Run the same command using the `--reverse` flag if you notice any problems.
## Install

@@ -13,0 +54,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc