diff --git a/cypress/e2e/entities.cy.js b/cypress/e2e/entities.cy.js index 907b925..c3d1836 100644 --- a/cypress/e2e/entities.cy.js +++ b/cypress/e2e/entities.cy.js @@ -48,11 +48,6 @@ describe("Entity initialization", () => { .which.is.an("array") .and.is.deep.equal([400, 500, 600, 700, 800]) ) - it("has someSet with numbers", () => expect(entity) - .to.have.property("someSet") - .which.is.instanceOf(Set) - .and.is.deep.equal(new Set([10, 20, 30, 40, 50, 60, 70])) - ) it("is equal to another empty SimpleEntity", () => expect(entity.equals(new SimpleEntity())) .to.be.true ) @@ -70,7 +65,6 @@ describe("Entity initialization", () => { someBoolean2: false, someObjectString: new String("delta"), someArray: [-1, -2, -3], - someSet: new Set([-10, -20, -30]), }) const other2 = new SimpleEntity({ someNumber: 123, @@ -80,7 +74,6 @@ describe("Entity initialization", () => { someBoolean2: false, someObjectString: "delta", someArray: [-1, -2, -3], - someSet: new Set([-10, -20, -30]), }) it("compares equal entities as equal", () => expect(other1.equals(other2)) .to.be.true diff --git a/cypress/e2e/utility.cy.js b/cypress/e2e/utility.cy.js index 99eb8d1..e181bc8 100644 --- a/cypress/e2e/utility.cy.js +++ b/cypress/e2e/utility.cy.js @@ -69,34 +69,6 @@ describe("Utility class", () => { [-2, "Alpha", new String("beta"), new Number(40), [1, 2, 3]], [new Number(-2), new String("alpha"), new String("beta"), new Number(40), new Array(1, 2, 3)] )).to.be.false // Second element is different - expect(Utility.equals( - new Set(["alpha", -67, new String("beta"), [1, 2, 3]]), - new Set([-67, "beta", new String("alpha"), [1, 2, 3]]) - )).to.be.true - expect(Utility.equals( // First element has capital Beta - new Set(["alpha", -67, new String("Beta"), [1, 2, 3]]), - new Set([-67, "beta", new String("alpha"), [1, 2, 3]]) - )).to.be.false - expect(Utility.equals( // First element has capital Beta - new Set(["alpha", -67, new String("beta"), [1, 2, 3]]), - new Set([-67, "beta", new String("alpha"), [1, 3]]) - )).to.be.false - expect(Utility.equals( // Different number of elements - new Set([2, 4, 6, 8]), - new Set([8, 6, 4]) - )).to.be.false - expect(Utility.equals( // Second element has different type - new Set([4, "6", 8]), - new Set([8, 6, 4]) - )).to.be.false - expect(Utility.equals( - new Set([new IEntity({ a: "alpha", b: new String("beta") })]), - new Set([new IEntity({ a: "alpha", b: new String("beta") })]), - )).to.be.true - expect(Utility.equals( // First a key has a number - new Set([new IEntity({ a: 2, b: new String("beta") })]), - new Set([new IEntity({ a: "alpha", b: new String("beta") })]), - )).to.be.false }) it("isValueOfType method test", () => { expect(Utility.isValueOfType(34, Number)).to.be.true diff --git a/js/Utility.js b/js/Utility.js index 799bd21..0c4e203 100755 --- a/js/Utility.js +++ b/js/Utility.js @@ -175,14 +175,6 @@ export default class Utility { if (a instanceof Array && b instanceof Array) { return a.length === b.length && a.every((value, i) => Utility.equals(value, b[i])) } - if (a instanceof Set && b instanceof Set) { - if (a.size !== b.size) { - return false - } - a = [...a] - b = [...b] - return a.every(first => /** @type {Array} */(b).some(second => Utility.equals(first, second))) - } return false }