Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rush] JSON Selector Expressions (with "json:" selector parser) #4271
base: main
Are you sure you want to change the base?
[rush] JSON Selector Expressions (with "json:" selector parser) #4271
Changes from all commits
b66c79d
5c89832
a247e2f
d66c54f
a6bb2f3
5acf61e
a9aea9e
bed6c5a
3ceb1e5
f87af3b
86da31c
fdf166d
2eb83cf
dfef721
874d5ed
ea94618
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is
scope
? Give example stringsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is
value
? Give example stringsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this should be allowed:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is multi-subtraction overcomplicated?
For example,
subtract({A,C}, {B,C}, {C})
:({A,C} - {B,C}) - {C} = {A}
?{A,C} - ({B,C} - {C}) = {A,C}
?This order-of-operations concern does not arise with union or intersection. Multi-subtraction can easily be non-ambiguously implemented as
subtract(A, union(B,C))
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I guess the only pushback I have is where to enforce such a restriction.
I could attempt to use a
FixedLengthArray
type for this everywhere, and enforce a min/max length in the JSON schema, and then throw Error in the function if it's not exactly 2 elements, but it seems like a lot of extra work to prevent the user from providing multiple elements. Whereas if you allow it, and all your examples only show 2 elements, I think most people will typically just subtract two elements.(For what it's worth, your first result seems like the clear answer, it is the 1st operand minus all the other operands.)
P.S. I definitely don't want to change to not be an array e.g.
{ minuend: , subtrahend: }
- I think there's value in all operators taking an operands array of at least 2 elements.