Age | Commit message (Collapse) | Author | |
---|---|---|---|
2014-11-23 | jshn: shorten variable names to speed up processing | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2014-11-23 | jshn: remove TYPE_JSON_VAR | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2014-11-23 | jshn: do not export JSON_SEQ | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2014-11-23 | jshn: only keep UP_* variables around while they are needed | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2014-11-23 | jshn: improve performance by using let instead of $(( )) | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2014-07-16 | jshn: do not collapse whitespace in json_load() | Jo-Philipp Wich | |
When running the test case below the $key variable holds "foo bar" instead of the expected "foo bar". -- 8< -- . /usr/share/libubox/jshn.sh json_init json_load '{ "key": "foo bar" }' json_get_var key key -- >8 -- Quote the output of the "jshn -r" backtick expression to prevent the shell from erroneously collapsing whitespace. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> | |||
2014-04-26 | sh/jshn.sh - json_cleanup() dont pollute env with local vars | Bastian Bittorf | |
this script is mostly sourced, so we should try to keep the pollution of the users environment as low as possible. make the var 'tmp' local Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> | |||
2014-02-02 | jshn: drop json_select warnings when called from json_get_values() | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-12-10 | jshn: add ability to pass default values to json_get_var and json_get_vars | Jo-Philipp Wich | |
2013-12-02 | jshn: in json_get_values(), handle json_select errors | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-12-02 | jshn: optimize the shell code some more | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-10-30 | jshn: refactor _jshn_append to require fewer evals | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-10-30 | jshn: improve performance by getting rid of unnecessary variables in parser ↵ | Felix Fietkau | |
related code Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-10-30 | jshn: do not export SEQ_* | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-10-30 | jshn: get rid of the table stack, use the UP_* variable instead to speed up ↵ | Felix Fietkau | |
processing Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-10-30 | jshn: reduce the number of appends to the cleanup list to speed up ↵ | Felix Fietkau | |
processing of large json files Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-10-29 | jshn: allow json_get_keys/values to refer to the currently selected ↵ | Felix Fietkau | |
array/table if no argument is given Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-10-29 | jshn: add json_get_values (useful for arrays) | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-10-20 | jshn: add json_get_keys() | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-03-17 | jshn: add support for the double datatype | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2013-01-17 | rename internal variables in json_get_type | Luka Perkov | |
Signed-off-by: Luka Perkov <luka@openwrt.org> | |||
2013-01-04 | sanitize json_get_type function | Luka Perkov | |
Signed-off-by: Luka Perkov <luka@openwrt.org> | |||
2012-12-18 | jshn: fix check to reset array sequence counters on cleanup | Felix Fietkau | |
2012-12-17 | jshn: introduce json_is_a() convenience function to check field types ↵ | Jo-Philipp Wich | |
without using a temporary variable | |||
2012-12-16 | jshn: fix array handling | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2012-12-16 | jshn: fix some variable handling regressions | Felix Fietkau | |
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2012-12-16 | jshn: add support for namespaces | Felix Fietkau | |
Can be used to fix variable namespace clashes in library code using jshn Signed-off-by: Felix Fietkau <nbd@openwrt.org> | |||
2012-05-30 | sh/jshn.sh: fix json_get_var() and json_get_type() to not return cached values | Jo-Philipp Wich | |
2012-05-29 | sh/jshn.sh: replace "tr" calls with inline substitution, signalize success ↵ | Jo-Philipp Wich | |
with return values | |||
2012-05-17 | sh/jshn.sh: fix allowing numbers in identifiers | Felix Fietkau | |
json_add_generic() needs to handle them as well | |||
2012-05-16 | sh/jshn.sh: allow numbers in identifiers for json_get_var() | Jo-Philipp Wich | |
When traversing arrays of tables or arrays of array it is required to call json_select # where # is the index of the array item to select. Internally json_select() calls json_get_var() to obtain the correct prefix to populate $JSON_CUR with. However, the "tr" call in json_get_var() incorrectly replaces all digits with underscores, making any lookup for numeric array items fail. The attached patch changes the "tr" expression to allow digits and thus implements the expected behaviour for nested arrays. | |||
2012-05-14 | jshn.sh: add json_get_vars() wrapper function | Felix Fietkau | |
2011-09-11 | same for json_get_var | Felix Fietkau | |
2011-09-11 | jshn: support using characters in elements that do not conform to shell ↵ | Felix Fietkau | |
variable restrictions | |||
2011-08-12 | jshn: clear more variables on json_init, fix adding array elements | Felix Fietkau | |
2011-05-31 | jshn: add an option for printing the json data without a terminating newline | Felix Fietkau | |
2011-05-24 | jshn: fix invalid variable reuse | Felix Fietkau | |
2011-05-24 | jshn: do not use -n on export | Felix Fietkau | |
2011-05-24 | add jshn | Felix Fietkau | |