Skip to content

Commit d34f81b

Browse files
committed
Bumped v4.12.0
Signed-off-by: Matteo Collina <hello@matteocollina.com>
1 parent 2cf0c32 commit d34f81b

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

fastify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const VERSION = '4.11.0'
3+
const VERSION = '4.12.0'
44

55
const Avvio = require('avvio')
66
const http = require('http')

lib/error-serializer.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66

77

8+
// eslint-disable-next-line
9+
const STR_ESCAPE = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/
10+
811
class Serializer {
912
constructor (options = {}) {
1013
switch (options.rounding) {
@@ -99,6 +102,11 @@ class Serializer {
99102
str = str.toString()
100103
}
101104

105+
// Fast escape chars check
106+
if (!STR_ESCAPE.test(str)) {
107+
return quotes + str + quotes
108+
}
109+
102110
if (str.length < 42) {
103111
return this.asStringSmall(str)
104112
} else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fastify",
3-
"version": "4.11.0",
3+
"version": "4.12.0",
44
"description": "Fast and low overhead web framework, for Node.js",
55
"main": "fastify.js",
66
"type": "commonjs",

0 commit comments

Comments
 (0)