Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tidwall/gjson
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.7.5
Choose a base ref
...
head repository: tidwall/gjson
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.8.0
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on May 12, 2021

  1. Delete file

    tidwall authored May 12, 2021
    Configuration menu
    Copy the full SHA
    51e0e24 View commit details
    Browse the repository at this point in the history

Commits on May 14, 2021

  1. Add tilde boolean operator

    This commit adds the new tilde '~' operator, which when used will
    convert a value to a boolean before comparison.
    
    For example, using the following JSON:
    
        {
          "vals": [
            { "a": 1, "b": true },
            { "a": 2, "b": true },
            { "a": 3, "b": false },
            { "a": 4, "b": "0" },
            { "a": 5, "b": 0 },
            { "a": 6, "b": "1" },
            { "a": 7, "b": 1 }
            { "a": 8, "b": "true" },
            { "a": 9, "b": false }
            { "a": 10, "b": null }
            { "a": 11 }
          ]
        }
    
    You can now query for all true(ish) values:
    
        vals.#(b==~true)#
    
    Which returns:
    
        [1,2,6,7,8]
    
    Or all false(ish) values:
    
        vals.#(b==~false)#
    
    Which returns:
    
        [3,4,5,9,10,11]
    
    The last value which was non-existent is treated as "false"
    tidwall committed May 14, 2021
    Configuration menu
    Copy the full SHA
    d7dbdd1 View commit details
    Browse the repository at this point in the history
Loading