ts-reset
ts-reset copied to clipboard
Worth making parameters for JSON.parse's reviver and JSON.stringify's replacer use `unknown` instead of `any`?
using unknown for JSON.parse's return type makes total sense, as you have no idea what you will get.
equally, you have no idea what the reviver (or replacer) will be called with. using unknown would force you to check what the function was called with, before doing any important reviving/replacing logic.
love the library by the way! 😄
The same is for String.prototype.replace/String.prototype.replaceAll (args in replacer)