-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
The Selector is a pair of Keyexpr + Parameters which can be constructed from a string of format "a/b/c?d=e;f=g" where "a/b/c" is keyexpr and "d=e;f=g" is parameters.
The typescript doesn't support multiple constructors so the prototype of Selector constructor is
constructor(selector: IntoSelector, parameters?: IntoParameters) {From this definition it's not clear that the parameters are actually ignored if the selector have Selector type.
Also the implementation of this constructor doesn't try to parse keyexpr?params strings. The IntoSelector type makes user expect that it should. There is such functionality in other bindings (TryFrom<&'a str> in Rust, parse_selector in C++),
The proposal is:
- make type of first parameter
IntoKeyexpr | IntoSelector. This is excessive but makes intention more clear - if string of format "keyexpr?params" is passed, parse it
- if first parameter contains parameter and second parameter exists, throw exception
- explain this behavior in doc above
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers