Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add u unicode flag to regex #418

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const contentDisposition = require('content-disposition')

const dirList = require('./lib/dirList')

const winSeparatorRegex = new RegExp(`\\${path.win32.sep}`, 'g')
const backslashRegex = /\\/g
const startForwardSlashRegex = /^\//
const endForwardSlashRegex = /\/$/
const doubleForwardSlashRegex = /\/\//g
const asteriskRegex = /\*/g
const winSeparatorRegex = new RegExp(`\\${path.win32.sep}`, 'gu')
const backslashRegex = /\\/gu
const startForwardSlashRegex = /^\//u
const endForwardSlashRegex = /\/$/u
const doubleForwardSlashRegex = /\/\//gu
const asteriskRegex = /\*/gu

const supportedEncodings = ['br', 'gzip', 'deflate']
send.mime.default_type = 'application/octet-stream'
Expand Down
2 changes: 1 addition & 1 deletion lib/dirList.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const dirList = {
route = path.normalize(path.join(route, '..'))
}
return {
href: path.join(prefix, route, entry.name).replace(/\\/g, '/'),
href: path.join(prefix, route, entry.name).replace(/\\/gu, '/'),
name: entry.name,
stats: entry.stats,
extendedInfo: entry.extendedInfo
Expand Down
Loading