Closed fasttime closed 2 years ago
This seems fine to me - sorry that we were modifying the input object in the first place!
Even if this was bad, we need to treat it as a breaking fix because people might be relying on the inappropriate behavior
If we're doing a breaking release, we'll also want to upgrade the repo scaffold.
Thanks @fasttime 🎉
Thanks @yocontra and @phated for reviewing and merging this. Happy I could help!
Currently, plugin-error modifies the arguments provided to it (errors or option objects) by adding a
plugin
property and sometimes aerror
ormessage
property to them. This is inconvenient because sometimes you would like to reuse an argument later without having it modified after the first usage of plugin-error.This PR changes the current behavior by ensuring that the argument interpreted as an options object is shallow-cloned before any additional properties are set.