Skip to content

Releases: itchyny/gojq

Release v0.12.9

01 Sep 13:18

Choose a tag to compare

  • fix fromjson to emit error on unexpected trailing string
  • fix path analyzer on variable argument evaluation (def f($x): .y; path(f(.x)))
  • fix raw input option --raw-input (-R) to keep carriage returns and support 64KiB+ lines

Release v0.12.8

01 Jun 12:12

Choose a tag to compare

  • implement gojq.Compare for comparing values in custom internal functions
  • implement gojq.TypeOf for obtaining type name of values in custom internal functions
  • implement gojq.Preview for previewing values for error messages of custom internal functions
  • fix query lexer to parse string literals as JSON to support surrogate pairs ("\ud83d\ude04")
  • fix priority bug of declared and builtin functions (def empty: .; null | select(.))
  • fix string indexing by index out of bounds to emit null ("abc" | .[3])
  • fix array binding pattern not to match against strings ("abc" as [$a] ?// $a | $a)
  • fix sub and gsub functions to emit results in the same order of jq
  • fix fromjson to keep integer precision ("10000000000000000" | fromjson + 1)
  • fix stream option to raise error against incomplete JSON input
  • improve array updating index and string repetition to increase limitations
  • improve mktime to support nanoseconds, just like gmtime and now
  • improve query lexer to report unterminated string literals
  • improve performance of string indexing and slicing by reducing allocations
  • improve performance of object and array indexing, slicing, and iteration,
    by validating path values by comparing data addresses. This change improves jq
    compatibility of path value validation ({} | {}.x = 0, [0] | [.[]][] = 1).
    Also optimize constant indexing and slicing by specialized instruction
  • improve performance of add (on array of strings), flatten, min, max,
    sort, unique, join, to_entries, from_entries, indices, index,
    rindex, startswith, endswith, ltrimstr, rtrimstr, explode,
    capture, sub, and gsub functions

Release v0.12.7

01 Mar 12:41

Choose a tag to compare

  • fix precedence of try expression against operators (try 0 * error(0))
  • fix iterator suffix with optional operator (0 | .x[]?)
  • fix stream option with slurp option or input, inputs functions
  • fix the command flag parser to support equal sign in short options with argument
  • fix string conversion of query including empty strings in module and import metadata
  • improve performance of isempty function

Release v0.12.6

01 Dec 13:11

Choose a tag to compare

  • implement options for consuming remaining arguments (--args, --jsonargs, $ARGS.positional)
  • fix delpaths function with overlapped paths
  • fix --exit-status flag with halt, halt_error functions
  • fix input_filename function with null input option
  • fix path value validation for nan
  • fix crash on branch optimization (if 0 then . else 0|0 end)
  • add validation on regular expression flags to reject unsupported ones
  • improve performance of range, join, flatten functions
  • improve constant value optimization for object with quoted keys
  • remove dependency on forked go-flags package

Release v0.12.5

01 Sep 13:01

Choose a tag to compare

  • implement input_filename function for the command
  • fix priority bug of declared functions and arguments (def g: 1; def f(g): g; f(2))
  • fix label handling to catch the correct break error (first((0, 0) | first(0)))
  • fix null|error and error(null) to behave like empty (null | [0, error, error(null), 1])
  • fix integer division to keep precision when divisible (1 / 1 * 1000000000000000000000)
  • fix modulo operator on negative number and large number ((-1) % 10000000000)
  • fix combination of slurp (--slurp) and raw input option (--raw-input) to keep newlines
  • change the default module paths to ~/.jq, $ORIGIN/../lib/gojq, $ORIGIN/lib where $ORIGIN is the directory where the executable is located in
  • improve command argument parser to recognize query with leading hyphen, allow hyphen for standard input, and force posix style on Windows
  • improve @base64d to allow input without padding characters
  • improve fromdate, fromdateiso8601 to parse date time strings with timezone offset
  • improve halt_error to print error values without prefix
  • improve sub, gsub to allow the replacement string emitting multiple values
  • improve encoding \b and \f in strings
  • improve module loader for search path in query, and absolute path
  • improve query lexer to support string literal including newlines
  • improve performance of index, rindex, indices, transpose, and walk functions
  • improve performance of value preview in errors and debug mode
  • improve runtime performance including tail call optimization
  • switch Docker base image to distroless/static:debug

Release v0.12.4

01 Jun 12:01

Choose a tag to compare

  • fix numeric conversion of large floating-point numbers in modulo operator
  • implement a compiler option for adding custom iterator functions
  • implement gojq.NewIter function for creating a new iterator from values
  • implement $ARGS.named for listing command line variables
  • remove debug and stderr functions from the library
  • stop printing newlines on stderr function for jq compatibility

Release v0.12.3

01 Apr 12:00

Choose a tag to compare

  • fix array slicing with infinities and large numbers ([0][-infinite:infinite], [0][:1e20])
  • fix multiplying strings and modulo by infinities on MIPS 64 architecture
  • fix git revision information in Docker images
  • release multi-platform Docker images for ARM 64
  • switch to distroless image for Docker base image

Release v0.12.2

01 Mar 13:01

Choose a tag to compare

  • implement GOJQ_COLORS environment variable to configure individual colors
  • respect --color-output (-C) option even if NO_COLOR is set
  • implement gojq.ValueError interface for custom internal functions
  • fix crash on timestamps in YAML input
  • fix calculation on infinite (infinite-infinite | isnan)
  • fix comparison on nan (nan < nan)
  • fix validation of implode ([-1] | implode)
  • fix number normalization for custom JSON module loader
  • print error line numbers on invalid JSON and YAML
  • improve strftime, strptime for time zone offsets
  • improve performance on reading a large JSON file given by command line argument
  • improve performance and reduce memory allocation of the lexer, compiler and executor

Release v0.12.1

17 Jan 04:03

Choose a tag to compare

  • skip adding $HOME/.jq to module paths when $HOME is unset
  • fix optional operator followed by division operator (1?/1)
  • fix undefined format followed by optional operator (@foo?)
  • fix parsing invalid consecutive dots while scanning a number (0..[empty])
  • fix panic on printing a query with %#v
  • improve performance and reduce memory allocation of query.String()
  • change all methods of ModuleLoader optional

Release v0.12.0

24 Dec 12:57

Choose a tag to compare

  • implement tab indentation option (--tab)
  • implement a compiler option for adding custom internal functions
  • implement gojq.Marshal function for jq-flavored encoding
  • fix slurp option with JSON file arguments
  • fix escaping characters in object keys
  • fix normalizing negative int64 to int on 32-bit architecture
  • fix crash on continuing iteration after emitting an error
  • iter.Next() does not normalize NaN and infinities anymore. Library users should take care of them. To handle them for encoding as JSON bytes, use gojq.Marshal. Also, iter.Next() does not clone values deeply anymore for performance reason. Users must not update the elements of the returned arrays and objects.
  • improve performance of outputting JSON values by about 3.5 times