tidy-url
tidy-url copied to clipboard
Request: More flexibility with `set`
Right now you can use set(key, value)
or setMany(object)
.
I'd like to allow users to use set
for both cases. I was being lazy when I created setMany
. In future versions I would like this function to be removed and the set
function expanded to fit this issue.
For clarification, a user should be able to use the following:
tidy.set('key', 'value');
tidy.set('another', 'val');
// or
tidy.set({ key: 'value', another: 'val' });
You should be able to pass either an object or two parameters. In both cases the keys should be validated to ensure they match the config. If something is invalid or doesn't match then a warning should be displayed.
Because this is a breaking change the setMany
function should be marked as @deprecated
until the next major update.