2.0.3 • Published 4 years ago

ts-hashmap v2.0.3

Weekly downloads
33
License
MIT
Repository
github
Last release
4 years ago

A hashtable-based implementation of Map<K,V> and Set<V>

An implementation of Map<TKey, TValue> and Set<TValue> that can use custom equals and getHashCode functions.

A case-insensitve set, using EqualityComparer<T> and getHashCode

const names = ["zebra", "antelope", "ardvaark", "tortoise", "turtle", "dog", "frog"]
const comparer: EqualityComparer<string> = {
    equals: (a, b) => a.toLowerCase() === b.toLowerCase(),
    getHashCode: (x) => getHashCode(x.toLowerCase())
}
const set = createComparerSet(comparer)
names.forEach(n => set.add(n))
expect(set.has("DOg")).toBeTruthy()

acknowledgements

Created using the wonderful https://github.com/alexjoverm/typescript-library-starter.

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago