Giter VIP home page Giter VIP logo

Comments (5)

jankapunkt avatar jankapunkt commented on May 20, 2024

hi @michaelmior thank you for the bug report. I will investigate and will use this as a chance to revive this package.

from js-set-extension.

jankapunkt avatar jankapunkt commented on May 20, 2024

This revealed another bug in Set.prototype.equal, where

Set {
  Set { 1, 2, 3 },
  Set { 1, 2 },
  Set { 1, 3 },
  Set { 2, 3 },
  Set { 1 },
  Set { 2 },
  Set { 3 },
  Set {}
}

and

Set {
  Set { 3 },
  Set { 3, 2 },
  Set { 3, 1 },
  Set { 3, 2, 1 },
  Set {},
  Set { 1 },
  Set { 2 },
  Set { 3 }
}

are evualuated as equal, while in fact they are not.

from js-set-extension.

jankapunkt avatar jankapunkt commented on May 20, 2024

Another bug is that there should be no doubled entries of Set { 3 }. It is right to assume, that these are two totally different instances and therefore pass the checks but their absolute value representation are the same (Set { 3 } should be considered equal to Set { 3 }). So the Set.prototype.has function is also involved here.

The has function is not involved, as it works correct. The add function is rather affected:

const set = (...args) => new Set(args)

const set1 = set(3)
const set2 = set(3)

const set3 = set()
set3.add(set1)
set3.has(set1) // true
set3.has(set2) // true

set3.add(set2) // should skip set2
set3 // Set { Set { 3 }, Set { 3 } }

from js-set-extension.

jankapunkt avatar jankapunkt commented on May 20, 2024

@michaelmior I added you as collaborator. If you accept I can assign you to review the PR #51 which attempts to fix the issue.

from js-set-extension.

jankapunkt avatar jankapunkt commented on May 20, 2024

Implemented, via #51

from js-set-extension.

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.