Skip to content

Commit

Permalink
refactor(lib): add u unicode flag to regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Oct 21, 2023
1 parent 4744e73 commit 9376349
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/spec/openapi/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function normalizeUrl (url, serverUrls, stripBasePath) {

function resolveServerUrls (servers) {
const resolvedUrls = []
const findVariablesRegex = /{(.*?)}/g // As for OpenAPI v3 spec url variables are named in brackets, e.g. {foo}
const findVariablesRegex = /\{(.*?)\}/gu // As for OpenAPI v3 spec url variables are named in brackets, e.g. {foo}

servers = Array.isArray(servers) ? servers : []
for (const server of servers) {
Expand Down
2 changes: 1 addition & 1 deletion lib/util/generate-params-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { matchParams } = require('./match-params')

const namePattern = /\{([^}]+)\}/
const namePattern = /\{([^}]+)\}/u

function paramName (param) {
return param.replace(namePattern, (_, captured) => captured)
Expand Down
2 changes: 1 addition & 1 deletion lib/util/match-params.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const paramPattern = /\{[^{}]+\}/g
const paramPattern = /\{[^{}]+\}/gu

function hasParams (url) {
if (!url) return false
Expand Down

0 comments on commit 9376349

Please sign in to comment.