Socket
Socket
Sign inDemoInstall

bigriver

Package Overview
Dependencies
133
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.1.3

6

dist/http/app.d.ts
/// <reference types="node" />
import { FastifyServerOptions } from 'fastify';
import { Router } from './router';
declare module 'fastify' {
interface FastifyRequest {
state: RequestState;
}
}
export declare type RequestState = Record<string, any>;
export declare const useApp: ({ routers, cors, logger, caseSensitive, ignoreTrailingSlash, ...fastifyOptions }?: {

@@ -5,0 +11,0 @@ routers?: {

2

dist/http/app.js

@@ -28,2 +28,3 @@ "use strict";

}
app.decorateRequest('state', null);
app.addHook('onRequest', (req, _, next) => {

@@ -35,2 +36,3 @@ if (req.method === 'DELETE' || req.method == 'delete') {

}
req.state = {};
next();

@@ -37,0 +39,0 @@ });

3

package.json
{
"name": "bigriver",
"version": "1.1.2",
"version": "1.1.3",
"description": "A fast well-typed back-end prototyping framework",

@@ -26,4 +26,5 @@ "main": "dist/index.js",

"@types/node": "^14.14.39",
"rimraf": "^3.0.2",
"typescript": "^4.2.4"
}
}

@@ -1,5 +0,13 @@

import fastify, { FastifyServerOptions } from 'fastify'
import fastify, { FastifyRequest, FastifyServerOptions } from 'fastify'
import fastifyCors from 'fastify-cors'
import { Router } from './router'
declare module 'fastify' {
interface FastifyRequest {
state: RequestState
}
}
export type RequestState = Record<string, any>
export const useApp = ({

@@ -36,4 +44,8 @@ routers = [],

// Patch for DELETE method
// Decorate request for state
app.decorateRequest('state', null)
// Implement onRequest hook
app.addHook('onRequest', (req, _, next) => {
// Patch for DELETE method
if (req.method === 'DELETE' || req.method == 'delete') {

@@ -45,2 +57,5 @@ if (req.headers['content-type']) {

// Set initial request state
req.state = {}
next()

@@ -47,0 +62,0 @@ })

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc