diff --git a/src/data-structures/hash/hash-map.ts b/src/data-structures/hash/hash-map.ts index 554556c..0c189b5 100644 --- a/src/data-structures/hash/hash-map.ts +++ b/src/data-structures/hash/hash-map.ts @@ -20,7 +20,7 @@ export class HashMap { protected _objHashFn: (key: K) => object; - constructor(elements?: Iterable<[K, V]>, options: HashMapOptions = { + constructor(elements?: Iterable<[K, V]>, options: HashMapOptions = { hashFn: (key: K) => String(key), objHashFn: (key: K) => (key) diff --git a/src/types/data-structures/hash/hash-map.ts b/src/types/data-structures/hash/hash-map.ts index 8889ff2..294fa59 100644 --- a/src/types/data-structures/hash/hash-map.ts +++ b/src/types/data-structures/hash/hash-map.ts @@ -5,7 +5,7 @@ export type HashMapLinkedNode = { prev: HashMapLinkedNode; }; -export type HashMapOptions = { +export type HashMapOptions = { hashFn: (key: K) => string; objHashFn: (key: K) => object }