Skip to content

Commit

Permalink
refactor: add u unicode flag to regex (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Oct 22, 2023
1 parent f169915 commit 16d3f27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 16d3f27

Please sign in to comment.