multer-storage-cloudinary
multer-storage-cloudinary copied to clipboard
Params types incomplete, folder does not exist in type "Params".
Params types incomplete, folder does not exist in type "Params".
Steps to reproduce
import { v2 as cloudinary } from "cloudinary"
const cloudinaryStorage = new CloudinaryStorage({ cloudinary, params: { folder: "folderName" } })
Results in:
"Type '{ folder: string; }' is not assignable to type 'Params | undefined'. Object literal may only specify known properties, and 'folder' does not exist in type 'Params'."
Multer-Storage-Cloudinary - 4.0.0 Node - v14.17.4 NPM - 7.20.0
Params types incomplete, folder does not exist in type "Params".
Steps to reproduce
import { v2 as cloudinary } from "cloudinary" const cloudinaryStorage = new CloudinaryStorage({ cloudinary, params: { folder: "folderName" } })
Results in:
"Type '{ folder: string; }' is not assignable to type 'Params | undefined'. Object literal may only specify known properties, and 'folder' does not exist in type 'Params'."
Multer-Storage-Cloudinary - 4.0.0 Node - v14.17.4 NPM - 7.20.0
Hello Tom! Till they fix it, you may work around it. I first import Options from multer-storage-cloudinary and then extended it like the following.
import { Options } from "multer-storage-cloudinary";
declare interface cloudinaryOptions extends Options { params: { folder: string } }
const multerOpts: cloudinaryOptions = { cloudinary: cloudinary, params: { folder: "Profile", }, };
const storage = new CloudinaryStorage(multerOpts);