Skip to content

Commit

Permalink
Bumped v4.12.0
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Jan 21, 2023
1 parent 2cf0c32 commit d34f81b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fastify.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const VERSION = '4.11.0'
const VERSION = '4.12.0'

const Avvio = require('avvio')
const http = require('http')
Expand Down
8 changes: 8 additions & 0 deletions lib/error-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@



// eslint-disable-next-line
const STR_ESCAPE = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/

class Serializer {
constructor (options = {}) {
switch (options.rounding) {
Expand Down Expand Up @@ -99,6 +102,11 @@ class Serializer {
str = str.toString()
}

// Fast escape chars check
if (!STR_ESCAPE.test(str)) {
return quotes + str + quotes
}

if (str.length < 42) {
return this.asStringSmall(str)
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fastify",
"version": "4.11.0",
"version": "4.12.0",
"description": "Fast and low overhead web framework, for Node.js",
"main": "fastify.js",
"type": "commonjs",
Expand Down

0 comments on commit d34f81b

Please sign in to comment.