From 883025fe70d563166cafcaac86d276fa770a4d47 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Tue, 17 Dec 2024 13:42:56 -0500 Subject: [PATCH] try to fix the error in screenshots --- packages/server/lib/screenshots.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/lib/screenshots.ts b/packages/server/lib/screenshots.ts index c141b23d9af8..3d4e79dfd2cf 100644 --- a/packages/server/lib/screenshots.ts +++ b/packages/server/lib/screenshots.ts @@ -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 @@ -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)