unstorage icon indicating copy to clipboard operation
unstorage copied to clipboard

Make sure drivers don't modify input options object

Open pi0 opened this issue 11 months ago • 0 comments

Describe the feature

Found from https://github.com/nitrojs/nitro/issues/2174

Drivers such as fs/fsLite currently modify options objects. this might have unwanted side-effects especially if input options are used in different places.

We should:

  • Make defineDriver types to make sure options object is (deep) ReadOnly
  • Possibly update tests to make sure there is no runtime update
  • Fix drivers that currently modify input to instead, make a copy of object

Additional information

  • [x] Would you be willing to help implement this feature?

pi0 avatar Jan 07 '25 23:01 pi0