Replies: 2 comments 2 replies
-
Can you give some examples invocations, with arguments and output? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Any thoughts on the design? I am happy to take over the development. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The API for all three functions is the same.
Each sub-index is either a string to index a sub-map or an integer to index a sub-list.
If the var is invalid for a given format or the index (k1, k2, …, kn) is not found, the function returns an empty string.
The examples below are for JSON but represent TOML and YAML, too, because of their semantic equality.
Assume the following input string with JSON:
All scalar values are converted to strings.
Proposed API, v1 -- variadic index and individual functions for each map representation
There are three functions:
json()
,yaml()
,toml()
. All three have the same parameters. The example below usesjson
.Proposed API, v2 -- generic map type and a single string index:
There is one
map()
function for all three formats. Theindex
is a single string with sub-indexes separated by adelimiter
(the default is.
).Beta Was this translation helpful? Give feedback.
All reactions