@fastify/etag
Advanced tools
Comparing version 4.0.0 to 4.1.0
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') { |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
30558
7
17
549
64
9
3
+ Addedfastify-plugin@4.5.1(transitive)
- Removedfastify-plugin@3.0.1(transitive)
Updatedfastify-plugin@^4.0.0