From 8c30d6c24b022fd996757bb1fe3577afdc3a8f2b Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 16 Sep 2023 07:45:04 +0100 Subject: [PATCH] refactor(index): add `u` unicode flag to regex --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index bee65f8..6a9e5a9 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,7 @@ function fastifyAccepts (fastify, options, done) { fastify.decorateReply('requestAccepts', replyAcceptMethod) methodNames.forEach(methodName => { - const capitalizedMethodName = methodName.replace(/(?:^|\s)\S/g, a => a.toUpperCase()) + const capitalizedMethodName = methodName.replace(/(?:^|\s)\S/gu, a => a.toUpperCase()) fastify.decorateReply('request' + capitalizedMethodName, function (arr) { const acceptsObject = this.requestAccepts() if (arguments.length === 0) return acceptsObject[methodName]()