fix(platform): ignore fastify typing in the constructor

This commit is contained in:
Kamil Myśliwiec
2019-12-18 17:08:28 +01:00
parent fb69ee206a
commit 5a31027c28
3 changed files with 10 additions and 3 deletions

7
package-lock.json generated
View File

@@ -12172,6 +12172,13 @@
"requires": {
"path-to-regexp": "^3.0.0",
"reusify": "^1.0.2"
},
"dependencies": {
"path-to-regexp": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz",
"integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA=="
}
}
},
"mime": {

View File

@@ -12,7 +12,7 @@ import * as pathToRegexp from 'path-to-regexp';
export class FastifyAdapter extends AbstractHttpAdapter {
constructor(
instanceOrOptions:
| fastify.FastifyInstance<any, any, any>
| any
| fastify.ServerOptions
| fastify.ServerOptionsAsHttp
| fastify.ServerOptionsAsHttp2
@@ -24,7 +24,7 @@ export class FastifyAdapter extends AbstractHttpAdapter {
instanceOrOptions &&
(instanceOrOptions as fastify.FastifyInstance<any, any, any>).server
? instanceOrOptions
: fastify(instanceOrOptions as fastify.ServerOptions);
: fastify((instanceOrOptions as any) as fastify.ServerOptions);
super(instance);
}

View File

@@ -17,7 +17,7 @@
"access": "public"
},
"dependencies": {
"fastify": "2.10.0",
"fastify": "2.11.0",
"fastify-cors": "3.0.0",
"fastify-formbody": "3.1.0",
"path-to-regexp": "3.2.0"