chore(storage-uploadthing): enable TypeScript strict (#12304)
This commit is contained in:
@@ -13,6 +13,6 @@ export const UploadthingClientUploadHandler = createClientUploadHandler({
|
|||||||
files: [file],
|
files: [file],
|
||||||
})
|
})
|
||||||
|
|
||||||
return { key: res[0].key }
|
return { key: res[0]?.key }
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const getHandler = ({ utApi }: Args): StaticHandler => {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
if (collectionConfig.upload.imageSizes) {
|
if (collectionConfig?.upload.imageSizes) {
|
||||||
collectionConfig.upload.imageSizes.forEach(({ name }) => {
|
collectionConfig.upload.imageSizes.forEach(({ name }) => {
|
||||||
or.push({
|
or.push({
|
||||||
[`sizes.${name}.filename`]: {
|
[`sizes.${name}.filename`]: {
|
||||||
@@ -58,7 +58,7 @@ export const getHandler = ({ utApi }: Args): StaticHandler => {
|
|||||||
return new Response(null, { status: 404, statusText: 'Not Found' })
|
return new Response(null, { status: 404, statusText: 'Not Found' })
|
||||||
}
|
}
|
||||||
|
|
||||||
key = getKeyFromFilename(retrievedDoc, filename)
|
key = getKeyFromFilename(retrievedDoc, filename)!
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!key) {
|
if (!key) {
|
||||||
@@ -97,7 +97,7 @@ export const getHandler = ({ utApi }: Args): StaticHandler => {
|
|||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Content-Length': String(blob.size),
|
'Content-Length': String(blob.size),
|
||||||
'Content-Type': blob.type,
|
'Content-Type': blob.type,
|
||||||
ETag: objectEtag,
|
ETag: objectEtag!,
|
||||||
}),
|
}),
|
||||||
status: 200,
|
status: 200,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
"compilerOptions": {
|
|
||||||
/* TODO: remove the following lines */
|
|
||||||
"strict": false,
|
|
||||||
},
|
|
||||||
"references": [{ "path": "../payload" }, { "path": "../plugin-cloud-storage" }]
|
"references": [{ "path": "../payload" }, { "path": "../plugin-cloud-storage" }]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user