fastify-multer icon indicating copy to clipboard operation
fastify-multer copied to clipboard

Q: Why is File interface's path property optional?

Open naseemkullah opened this issue 4 years ago • 1 comments

https://github.com/fox1t/fastify-multer/blob/0801665b6c8d7b25cd8e68bbbc2a03a1474f83fb/src/interfaces.ts#L25-L34

Express version of multer have them all as required: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/661506820433050469e8d608e3059b0166d043be/types/multer/index.d.ts#L20-L47 I was wondering if there was a reason in particular that that some of these properties are considered optional.

edit: only interested in the path property being required atm

naseemkullah avatar Jul 29 '20 04:07 naseemkullah

Hi @naseemkullah! Sorry for the late response but this issue finished between hundred of GitHub emails.

If I recall correctly I implemented them as optional due to the fact that not all of them are always defined:

  • https://github.com/fox1t/fastify-multer/blob/master/src/storage/disk.ts#L59
  • https://github.com/fox1t/fastify-multer/blob/master/src/storage/memory.ts#L15

What do you think?

fox1t avatar Aug 10 '20 15:08 fox1t