From 982152abc028c77768c5c507739798d561798d4a Mon Sep 17 00:00:00 2001 From: Revone Date: Sat, 25 Nov 2023 22:33:38 +0800 Subject: [PATCH] fix: type fixed --- src/data-structures/hash/hash-map.ts | 2 +- src/types/data-structures/hash/hash-map.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 }