Skip to content

Commit

Permalink
try to fix the error in screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane committed Dec 17, 2024
1 parent 30e51c2 commit 883025f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/server/lib/screenshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ const getDimensions = function (details) {
return pick(details.image.bitmap)
}

const ensureSafePath = function (withoutExt, extension, overwrite, num = 0) {
const ensureSafePath = function (withoutExt: string, extension: string, overwrite: boolean, num = 0) {
const suffix = `${(num && !overwrite) ? ` (${num})` : ''}.${extension}`

const maxSafePrefixBytes = maxSafeBytes - suffix.length
Expand Down Expand Up @@ -418,7 +418,8 @@ const getPath = function (data: Data, ext, screenshotsFolder: ScreenshotsFolder,
.split(pathSeparatorRe)

if (data.name) {
names = data.name.split(pathSeparatorRe).map((name: string) => sanitize(name))
// @ts-expect-error
names = data.name.split(pathSeparatorRe).map(sanitize)
} else {
names = _
.chain(data.titles)
Expand Down

0 comments on commit 883025f

Please sign in to comment.