@nestjs/platform-fastify 8.2.2 → 8.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/Readme.md +6 -3
- package/adapters/fastify-adapter.js +4 -3
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(The MIT License)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017-
|
|
3
|
+
Copyright (c) 2017-2022 Kamil Mysliwiec <https://kamilmysliwiec.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/Readme.md
CHANGED
|
@@ -57,10 +57,13 @@ With official support, you can get expert help straight from Nest core team. We
|
|
|
57
57
|
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
|
58
58
|
|
|
59
59
|
#### Principal Sponsors
|
|
60
|
-
<table style="text-align:center;"><tr
|
|
60
|
+
<table style="text-align:center;"><tr>
|
|
61
|
+
<td><a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/trilon.svg" width="200" valign="middle" /></a></td>
|
|
62
|
+
<td><a href="https://www.redhat.com" target="_blank"><img src="https://nestjs.com/img/red-hat-logo.svg" width="200" valign="middle" /></a></td>
|
|
63
|
+
<td>
|
|
61
64
|
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td>
|
|
62
65
|
<td>
|
|
63
|
-
<a href="https://
|
|
66
|
+
<a href="https://nx.dev" target="_blank"><img src="https://nestjs.com/img/nx-logo.png" height="45" valign="middle" /></a></td>
|
|
64
67
|
</tr></table>
|
|
65
68
|
|
|
66
69
|
#### Gold Sponsors
|
|
@@ -78,7 +81,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
78
81
|
<table style="text-align:center;"><tr><td>
|
|
79
82
|
<a href="https://neoteric.eu/" target="_blank"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" valign="middle" /></a> </td><td>
|
|
80
83
|
<a href="http://gojob.com" target="_blank"><img src="http://nestjs.com/img/gojob-logo.png" valign="middle" width="100" /></a> </td><td>
|
|
81
|
-
<a href="
|
|
84
|
+
<a href="https://www.myleodsc.com/" target="_blank"><img src="https://nestjs.com/img/myleo-logo.png" width="180" valign="middle" /></td><td>
|
|
82
85
|
<a href="https://careers.meetdandy.com/?gh_src=063ba61e3us" target="_blank"><img src="https://nestjs.com/img/dandy-roles-logo.svg" width="150" valign="middle" /></td><td>
|
|
83
86
|
<a href="https://www.castlecraft.in" target="_blank"><img src="https://nestjs.com/img/castlecraft-logo.png" width="150" valign="middle" /></td>
|
|
84
87
|
<td><a href="https://www.tinystacks.com" target="_blank"><img src="https://nestjs.com/img/tinystacks-logo.png#1" width="140" valign="middle" /></td></tr></table>
|
|
@@ -4,6 +4,7 @@ exports.FastifyAdapter = void 0;
|
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const interfaces_1 = require("@nestjs/common/interfaces");
|
|
6
6
|
const load_package_util_1 = require("@nestjs/common/utils/load-package.util");
|
|
7
|
+
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
7
8
|
const http_adapter_1 = require("@nestjs/core/adapters/http-adapter");
|
|
8
9
|
const fastify_1 = require("fastify");
|
|
9
10
|
const Reply = require("fastify/lib/reply");
|
|
@@ -13,7 +14,7 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
13
14
|
this.versionConstraint = {
|
|
14
15
|
name: 'version',
|
|
15
16
|
validate(value) {
|
|
16
|
-
if (
|
|
17
|
+
if (!shared_utils_1.isString(value) && !Array.isArray(value)) {
|
|
17
18
|
throw new Error('Version constraint should be a string or an array of strings.');
|
|
18
19
|
}
|
|
19
20
|
},
|
|
@@ -190,7 +191,7 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
190
191
|
return this.register(load_package_util_1.loadPackage('fastify-static', 'FastifyAdapter.useStaticAssets()', () => require('fastify-static')), options);
|
|
191
192
|
}
|
|
192
193
|
setViewEngine(options) {
|
|
193
|
-
if (
|
|
194
|
+
if (shared_utils_1.isString(options)) {
|
|
194
195
|
new common_1.Logger('FastifyAdapter').error("setViewEngine() doesn't support a string argument.");
|
|
195
196
|
process.exit(1);
|
|
196
197
|
}
|
|
@@ -249,7 +250,7 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
249
250
|
}
|
|
250
251
|
injectConstraintsIfVersioned(routerMethodKey, ...args) {
|
|
251
252
|
const handlerRef = args[args.length - 1];
|
|
252
|
-
const isVersioned =
|
|
253
|
+
const isVersioned = !shared_utils_1.isUndefined(handlerRef.version) &&
|
|
253
254
|
handlerRef.version !== interfaces_1.VERSION_NEUTRAL;
|
|
254
255
|
if (isVersioned) {
|
|
255
256
|
const isPathAndRouteTuple = args.length === 2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/platform-fastify",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.6",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@platform-fastify)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"fastify": "3.
|
|
20
|
+
"fastify": "3.27.0",
|
|
21
21
|
"fastify-cors": "6.0.2",
|
|
22
22
|
"fastify-formbody": "5.2.0",
|
|
23
|
-
"light-my-request": "4.
|
|
23
|
+
"light-my-request": "4.7.0",
|
|
24
24
|
"middie": "5.3.0",
|
|
25
25
|
"path-to-regexp": "3.2.0",
|
|
26
26
|
"tslib": "2.3.1"
|