Giter Site home page Giter Site logo

Comments (4)

SylvainEstevez avatar SylvainEstevez commented on September 26, 2024

@bjamba Thanks for raising the question. I actually spent quite some time thinking on the best way to deal with empty objects when I wrote the filter utility.

What behavior would you see happening for the following example?

Key.filter({ a: {}, b: { foo: 'bar' } }, ['!a', '!b.foo'])

Would you see the result to be {} or { b: {} }?

from access-control.

bjamba avatar bjamba commented on September 26, 2024

I'm currently seeing the result as { a: {} }. I think if I were to think about what I would like to see in that instance, I'd think I'd like to see { b: {} }, since if we're nesting into properties.

I guess to put it another way, the way I imagine the filters could work is so that if you are explicitly filtering out a parent key, it should filter out anything that's a child of it. But if I'm filtering a child key that would effectively render the parent key to be an empty object, we preserve the object.

from access-control.

bjamba avatar bjamba commented on September 26, 2024

Hi, circling back on this to ask if there had been any additional thoughts on solving this issue or if there was more clarification on my end that was needed. Thanks!

from access-control.

SylvainEstevez avatar SylvainEstevez commented on September 26, 2024

@bjamba Sorry for not getting back to you earlier. What you are saying makes total sense and I'll provide a fix within 10 days. If you wish to make a PR yourself, that's even better!

from access-control.

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.