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

fastify-plugin

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-plugin - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

6

index.js

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

if (options === undefined) return fn
if (typeof options === 'string') {
checkVersion(options)
return fn
}
if (typeof options !== 'object' || Array.isArray(options) || options === null) {

@@ -16,0 +22,0 @@ throw new TypeError('The options object should be an object')

2

package.json
{
"name": "fastify-plugin",
"version": "0.2.0",
"version": "0.2.1",
"description": "Plugin helper for Fastify",

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

@@ -39,2 +39,4 @@ # fastify-plugin

If you need to check the Fastify version only, you can pass just the version string.
You can check [here](https://github.com/npm/node-semver#ranges) how to define a `semver` range.

@@ -41,0 +43,0 @@

@@ -50,14 +50,22 @@ 'use strict'

test('the options object should be an object', t => {
t.plan(3)
test('should check the fastify version', t => {
t.plan(1)
function plugin (fastify, opts, next) {
next()
}
try {
fp(() => {}, null)
fp(plugin, '>=0.10.0')
t.pass()
} catch (e) {
t.fail()
} catch (e) {
t.is(e.message, 'The options object should be an object')
}
})
test('the options object should be an object', t => {
t.plan(2)
try {
fp(() => {}, [])
fp(() => {}, null)
t.fail()

@@ -69,3 +77,3 @@ } catch (e) {

try {
fp(() => {}, 'abc')
fp(() => {}, [])
t.fail()

@@ -72,0 +80,0 @@ } catch (e) {

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