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

@fastify/etag

Package Overview
Dependencies
Maintainers
19
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/etag - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

benchmarks/run.js

15

index.js

@@ -7,3 +7,18 @@ 'use strict'

function validateAlgorithm (algorithm) {
if (algorithm === 'fnv1a') {
return true
}
// validate that the algorithm is supported by the node runtime
try {
createHash(algorithm)
} catch (e) {
throw new TypeError(`Algorithm ${algorithm} not supported.`)
}
}
function buildHashFn (algorithm = 'fnv1a', weak = false) {
validateAlgorithm(algorithm)
const prefix = weak ? 'W/"' : '"'

@@ -10,0 +25,0 @@ if (algorithm === 'fnv1a') {

16

package.json
{
"name": "@fastify/etag",
"version": "4.0.0",
"version": "4.1.0",
"description": "Automatically generate etags for HTTP responses, for Fastify",
"main": "index.js",
"types": "types/index.d.ts",
"scripts": {
"bench": "node benchmarks/run.js",
"test": "standard | snazzy && tsd && tap -J test/*.test.js && npm run typescript",
"typescript": "tsd"
"lint": "standard | snazzy",
"test": "npm run test:unit && npm run test:typescript",
"test:unit": "tap",
"test:typescript": "tsd"
},

@@ -29,3 +32,3 @@ "repository": {

"devDependencies": {
"@types/node": "^17.0.0",
"@types/node": "^18.0.0",
"autocannon": "^7.0.0",

@@ -36,7 +39,6 @@ "fastify": "^4.0.0-rc.2",

"tap": "^16.0.0",
"typescript": "^4.0.2",
"tsd": "^0.20.0"
"tsd": "^0.22.0"
},
"dependencies": {
"fastify-plugin": "^3.0.0"
"fastify-plugin": "^4.0.0"
},

@@ -43,0 +45,0 @@ "tsd": {

@@ -5,3 +5,2 @@ # @fastify/etag

[![NPM version](https://img.shields.io/npm/v/@fastify/etag.svg?style=flat)](https://www.npmjs.com/package/@fastify/etag)
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-etag/badge.svg)](https://snyk.io/test/github/fastify/fastify-etag)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)

@@ -8,0 +7,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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc