Socket
Socket
Sign inDemoInstall

@fastify/sensible

Package Overview
Dependencies
Maintainers
20
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/sensible - npm Package Compare versions

Comparing version 5.4.0 to 5.5.0

1

index.js

@@ -84,1 +84,2 @@ 'use strict'

module.exports.fastifySensible = fastifySensible
module.exports.httpErrors = httpErrors

@@ -102,1 +102,4 @@ interface HttpError extends Error {

} & Record<HttpErrorNames, (msg?: string) => HttpError>;
declare const HttpErrors: HttpErrors
export default HttpErrors;

2

package.json
{
"name": "@fastify/sensible",
"version": "5.4.0",
"version": "5.5.0",
"description": "Defaults for Fastify that everyone can agree on",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -84,2 +84,8 @@ 'use strict'

test('should throw error', (t) => {
const err = Sensible.httpErrors.conflict('custom')
t.equal(err.message, 'custom')
t.end()
})
function normalize (code, msg) {

@@ -86,0 +92,0 @@ if (code === '414') return 'uriTooLong'

import { FastifyPluginCallback, FastifyReply } from 'fastify'
import { HttpErrors, HttpErrorCodes, HttpErrorNames } from "../lib/httpError"
import { HttpErrors } from "../lib/httpError"
import * as Errors from '../lib/httpError'

@@ -96,2 +96,4 @@

export const httpErrors: typeof Errors.default
export type HttpErrorReplys = {

@@ -98,0 +100,0 @@ getHttpError: (code: HttpErrorCodes, message?: string) => FastifyReply;

import { expectType, expectAssignable, expectError, expectNotAssignable } from 'tsd'
import fastify from 'fastify'
import fastifySensible, { SensibleOptions } from '..'
import fastifySensible, { SensibleOptions, httpErrors } from '..'

@@ -152,1 +152,4 @@ const app = fastify()

})
httpErrors.forbidden('This type should be also available');
httpErrors.createError('MyError');
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