-
Notifications
You must be signed in to change notification settings - Fork 439
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
Implement std.objectValues and std.objectValuesAll #858
Conversation
doc/ref/stdlib.html
Outdated
@@ -63,7 +63,7 @@ <h4 id="extVar"> | |||
<p> | |||
If an external variable with the given name was defined, return its string value. Otherwise, raise an error. | |||
</p> | |||
|
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.
Sorry about this noise - I have an vim trigger thing that deletes trailing whitespace ...
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.
Please don't edit this file manually. Here are the instructions for updating stdlib docs: https://github.com/google/jsonnet#locally-serving-the-website.
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.
Ah, that makes a lot more sense - updated.
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.
Thanks! This is a good addition to the standard library.
doc/ref/stdlib.html
Outdated
@@ -63,7 +63,7 @@ <h4 id="extVar"> | |||
<p> | |||
If an external variable with the given name was defined, return its string value. Otherwise, raise an error. | |||
</p> | |||
|
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.
Please don't edit this file manually. Here are the instructions for updating stdlib docs: https://github.com/google/jsonnet#locally-serving-the-website.
4aa1719
to
7956072
Compare
@@ -39,7 +39,7 @@ limitations under the License. | |||
assert std.isString(str) : 'substr first parameter should be a string, got ' + std.type(str); | |||
assert std.isNumber(from) : 'substr second parameter should be a string, got ' + std.type(from); | |||
assert std.isNumber(len) : 'substr third parameter should be a string, got ' + std.type(len); | |||
assert len >=0 : 'substr third parameter should be greater than zero, got ' + len; | |||
assert len >= 0 : 'substr third parameter should be greater than zero, got ' + len; |
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.
These changes are also all autoformatting but they look like good changes? I can rebase and just take the actual stuff I added if you want.
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.
Yeah, it looks like our own auto-formatting. Ideally that would be a separate commit, but that's not a big deal.
Hello friends!
This PR adds two helper functions for extracting an array of values from an object. This was not impossible before (hence the implementations are in jsonnet), but I think it is worth having a 'first class' implementation - for further evidence, it is a very common feature of data transformation libraries.
It was mentioned in this comment.