@nestjs/platform-fastify 10.3.3 → 10.3.4

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/Readme.md CHANGED
@@ -25,12 +25,12 @@
25
25
 
26
26
  Nest is a framework for building efficient, scalable <a href="https://nodejs.org" target="_blank">Node.js</a> server-side applications. It uses modern JavaScript, is built with <a href="https://www.typescriptlang.org" target="_blank">TypeScript</a> (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
27
27
 
28
- <p>Under the hood, Nest makes use of <a href="https://expressjs.com/" target="_blank">Express</a>, but also, provides compatibility with a wide range of other libraries, like e.g. <a href="https://github.com/fastify/fastify" target="_blank">Fastify</a>, allowing for easy use of the myriad third-party plugins which are available.</p>
28
+ <p>Under the hood, Nest makes use of <a href="https://expressjs.com/" target="_blank">Express</a>, but also provides compatibility with a wide range of other libraries, like <a href="https://github.com/fastify/fastify" target="_blank">Fastify</a>, allowing for easy use of the myriad of third-party plugins which are available.</p>
29
29
 
30
30
  ## Philosophy
31
31
 
32
- <p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front and backend applications, giving rise to awesome projects like <a href="https://angular.io/" target="_blank">Angular</a>, <a href="https://github.com/facebook/react" target="_blank">React</a> and <a href="https://github.com/vuejs/vue" target="_blank">Vue</a> which improve developer productivity and enable the construction of fast, testable, extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers and tools for Node, none of them effectively solve the main problem - the architecture.</p>
33
- <p>Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.</p>
32
+ <p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front and backend applications, giving rise to awesome projects like <a href="https://angular.io/" target="_blank">Angular</a>, <a href="https://github.com/facebook/react" target="_blank">React</a>, and <a href="https://github.com/vuejs/vue" target="_blank">Vue</a>, which improve developer productivity and enable the construction of fast, testable, and extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers, and tools for Node, none of them effectively solve the main problem - the architecture.</p>
33
+ <p>Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, and loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.</p>
34
34
 
35
35
  ## Getting started
36
36
 
@@ -93,7 +93,6 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
93
93
  <table style="text-align:center;"><tr>
94
94
  <td><a href="https://n.inc" target="_blank"><img src="https://nestjs.com/img/n-inc-logo.svg" width="120" valign="middle" /></td>
95
95
  <td><a href="https://twistag.com/" target="_blank"><img src="https://nestjs.com/img/twistag-logo.png" width="120" valign="middle" /></td>
96
- <td><a href="https://immediateedgeapp.org/" target="_blank"><img src="https://nestjs.com/img/immediate-edge-logo.png" width="120" valign="middle" /></td>
97
96
  </tr>
98
97
  </table>
99
98
 
@@ -306,12 +306,15 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
306
306
  await this.registerMiddie();
307
307
  }
308
308
  return (path, callback) => {
309
+ const hasEndOfStringCharacter = path.endsWith('$');
310
+ path = hasEndOfStringCharacter ? path.slice(0, -1) : path;
309
311
  let normalizedPath = path.endsWith('/*')
310
312
  ? `${path.slice(0, -1)}(.*)`
311
313
  : path;
312
314
  // Fallback to "(.*)" to support plugins like GraphQL
313
315
  normalizedPath = normalizedPath === '/(.*)' ? '(.*)' : normalizedPath;
314
- const re = pathToRegexp(normalizedPath);
316
+ let re = pathToRegexp(normalizedPath);
317
+ re = hasEndOfStringCharacter ? new RegExp(re.source + '$', re.flags) : re;
315
318
  // The following type assertion is valid as we use import('@fastify/middie') rather than require('@fastify/middie')
316
319
  // ref https://github.com/fastify/middie/pull/55
317
320
  this.instance.use(normalizedPath, (req, res, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/platform-fastify",
3
- "version": "10.3.3",
3
+ "version": "10.3.4",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@platform-fastify)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -21,8 +21,8 @@
21
21
  "@fastify/cors": "9.0.1",
22
22
  "@fastify/formbody": "7.4.0",
23
23
  "@fastify/middie": "8.3.0",
24
- "fastify": "4.26.0",
25
- "light-my-request": "5.11.0",
24
+ "fastify": "4.26.2",
25
+ "light-my-request": "5.12.0",
26
26
  "path-to-regexp": "3.2.0",
27
27
  "tslib": "2.6.2"
28
28
  },