Skip to content

Commit

Permalink
[ADD] types definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
device committed May 17, 2021
1 parent efd24ec commit 281f2d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="node" />

import { FastifyPluginCallback } from 'fastify';
export interface FastifyMsgpackOptions { }
declare const fastifyMsgpack: FastifyPluginCallback<FastifyMsgpackOptions>;
export default fastifyMsgpack;
9 changes: 3 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const msgpack = require('@msgpack/msgpack')
* @param {*} options
* @param {*} next
*/
function msgpackSerializerPlugin(fastify, options, next) {
function fastifyMsgpack(fastify, options, next) {
fastify.register(require('fastify-accepts-serializer'), {
serializers: [
{
Expand All @@ -34,10 +34,7 @@ function msgpackSerializerPlugin(fastify, options, next) {
next()
}

const fastifyMsgpack = fp(msgpackSerializerPlugin, {
module.exports = fp(fastifyMsgpack, {
fastify: '3.x',
name: 'fastify-msgpack',
dependencies: ['fastify-accepts-serializer']
name: 'fastify-msgpack'
})

module.exports = fastifyMsgpack

0 comments on commit 281f2d9

Please sign in to comment.