Skip to content

Commit

Permalink
refactor(index): add u unicode flag to regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Sep 16, 2023
1 parent 73d663d commit 8c30d6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]()
Expand Down

0 comments on commit 8c30d6c

Please sign in to comment.