Skip to content

Releases: adamhamlin/deep-equality-data-structures

v2.0.0

10 Apr 02:33
Compare
Choose a tag to compare

Adding 2 breaking changes:

  • Changed/improved the semantics for DeepMap.difference() and DeepMap.intersection() such that they will only consider an entry to "match" if both the key and its value are equivalent--instead of just the key.

    const map1 = new DeepMap([[1, "dog"], [2, "cat"]]);
    const map2 = new DeepMap([[1, "dog"], [2, "laser-cat"]]);
    
    const pairsInMap1NotInMap2 = map1.difference(map2);
    const pairsInBothMaps = map1.intersection(map2);
                
    expect([...pairsInMap1NotInMap2.entries()]).toStrictEqual([[2, "cat"]]); // previously would have been: [[]]
    expect([...pairsInBothMaps.entries()]).toStrictEqual([[1, "dog"]]); // previously would have been: [[1, "dog"], [2, "cat"]]
  • Library will now enforce that two structures are using the same options during comparison operations like .equals, .union, etc. This is to prevent a potential footgun/unexpected behavior.

    const set1 = new DeepSet(["DOG", "CAT"]);
    const set2 = new DeepSet(["dog", "cat"], { caseInsensitive: true });
    
    set1.equals(set2); // errors; previously, no error

v1.5.1

11 Oct 21:25
Compare
Choose a tag to compare

Exporting the Options type for ease of use

v1.5.0

21 Sep 15:49
Compare
Choose a tag to compare
  • Adding caseInsensitive option to ignore casing in all strings, including keys/values in objects and arrays
  • Allowing useToJsonTransform option in combination with transformer/mapValueTransformer options

v1.4.0

03 Sep 14:04
Compare
Choose a tag to compare

Adding BiDirectionalDeepMap to support O(1) lookups by both keys AND values

v1.3.1

19 Jul 16:49
Compare
Choose a tag to compare

Ignore jest config file during npm publish

v1.3.0

21 Oct 18:44
Compare
Choose a tag to compare

Adding the static areEqual utility method for one-time equality checks against an arbitrary number of values.

v1.2.1

21 Oct 04:32
Compare
Choose a tag to compare

Fix high severity CVE

v1.2.0

31 Jan 03:43
Compare
Choose a tag to compare

Adding binary operations union, intersection, and difference for both maps and sets.

v1.1.0

05 Jan 04:34
Compare
Choose a tag to compare

Type safety improvements when using the custom transform functions transformer and mapValueTransformer

v1.0.3

18 Dec 20:46
Compare
Choose a tag to compare

Properly sets typescript as a dev dependency.