Socket
Socket
Sign inDemoInstall

fastify-plugin

Package Overview
Dependencies
Maintainers
9
Versions
42
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 4.0.0 to 4.1.0

2

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

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

@@ -78,2 +78,5 @@ 'use strict'

function toCamelCase (name) {
if (name[0] === '@') {
name = name.slice(1).replace('/', '-')
}
const newName = name.replace(/-(.)/g, function (match, g1) {

@@ -80,0 +83,0 @@ return g1.toUpperCase()

@@ -62,3 +62,3 @@ 'use strict'

test('from kebabo-case to camelCase', (t) => {
test('from kebab-case to camelCase', (t) => {
const plugin = fp((fastify, opts, next) => {

@@ -74,2 +74,24 @@ next()

test('from @-prefixed named imports', (t) => {
const plugin = fp((fastify, opts, next) => {
next()
}, {
name: '@hello/world'
})
t.equal(plugin.helloWorld, plugin)
t.end()
})
test('from @-prefixed named kebab-case to camelCase', (t) => {
const plugin = fp((fastify, opts, next) => {
next()
}, {
name: '@hello/my-world'
})
t.equal(plugin.helloMyWorld, plugin)
t.end()
})
test('from kebab-case to camelCase multiple words', (t) => {

@@ -76,0 +98,0 @@ const plugin = fp((fastify, opts, next) => {

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