chore(storage-uploadthing): enable TypeScript strict (#12304)

This commit is contained in:
Germán Jabloñski
2025-05-02 17:03:38 -03:00
committed by GitHub
parent ddf40d59ac
commit d7d37447aa
3 changed files with 4 additions and 8 deletions

View File

@@ -13,6 +13,6 @@ export const UploadthingClientUploadHandler = createClientUploadHandler({
files: [file],
})
return { key: res[0].key }
return { key: res[0]?.key }
},
})

View File

@@ -33,7 +33,7 @@ export const getHandler = ({ utApi }: Args): StaticHandler => {
},
]
if (collectionConfig.upload.imageSizes) {
if (collectionConfig?.upload.imageSizes) {
collectionConfig.upload.imageSizes.forEach(({ name }) => {
or.push({
[`sizes.${name}.filename`]: {
@@ -58,7 +58,7 @@ export const getHandler = ({ utApi }: Args): StaticHandler => {
return new Response(null, { status: 404, statusText: 'Not Found' })
}
key = getKeyFromFilename(retrievedDoc, filename)
key = getKeyFromFilename(retrievedDoc, filename)!
}
if (!key) {
@@ -97,7 +97,7 @@ export const getHandler = ({ utApi }: Args): StaticHandler => {
headers: new Headers({
'Content-Length': String(blob.size),
'Content-Type': blob.type,
ETag: objectEtag,
ETag: objectEtag!,
}),
status: 200,
})