You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this wonderful tiny library to generate keys for puchdb as suggested in a number of places on the web and I have been confronted to the common issue of supporting integers (#6).
I had also been pondering using dates (ISO formatted) in keys and had the same kind of issue with the additional disadvantage that these dates look ugly when processed by docuri:
Think more about this these issues and looking at the code I have noticed that everything would be much easier if there was a way to specify which functions should be used in place of decodeURIComponent and encodeURIComponent and I'd like to propose to add an optional parameter to specify, for each key, which functions should be used (the default being, of course, to use decodeURIComponent and encodeURIComponent.
With this simple modification, it would be possible to define routes such as:
I am using this wonderful tiny library to generate keys for puchdb as suggested in a number of places on the web and I have been confronted to the common issue of supporting integers (#6).
I had also been pondering using dates (ISO formatted) in keys and had the same kind of issue with the additional disadvantage that these dates look ugly when processed by docuri:
Think more about this these issues and looking at the code I have noticed that everything would be much easier if there was a way to specify which functions should be used in place of
decodeURIComponent
andencodeURIComponent
and I'd like to propose to add an optional parameter to specify, for each key, which functions should be used (the default being, of course, to usedecodeURIComponent
andencodeURIComponent
.With this simple modification, it would be possible to define routes such as:
Or, with a helper function:
Similarly, for dates:
Let me know what you think and if you want me to submit a PR for this update.
Thanks!
The text was updated successfully, but these errors were encountered: