Git Product home page Git Product logo

Comments (1)

hell-racer avatar hell-racer commented on July 18, 2024 1

From my perspective (and from what I think 'convenience' point of view) it would be nice if all functions returned null if argument is null and throw exception if the argument is of wrong type. Usually if an argument has incorrect type means that you have an error in your expression, and if an argument is null - usually means that your expression is correct but the data lacks something (which is usually ok). Functions throwing if argument is null means that all the expressions are cluttered with 'fallback' values, e.g. instead of length(a) you have length(a || '') (or a && length(a)) all over the place. It is extremely visible when you have large templates that consist only of JmesPath expressions.
Now, there are some edge cases... E.g. it would be nice if join() just skipped null values and automatically converted numbers to strings (and throw if there are some objects or arrays among items).

from jmespath.spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.