Skip to content

Commit e310ffd

Browse files
Swissbitedfd1985
andauthored
Fix TypeScript return type of get and getMany (#117)
Co-authored-by: dfd1985 <dfd1985@gmail.com>
1 parent 15eb289 commit e310ffd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ declare class ClassicLevel<KDefault = string, VDefault = string>
4848
open (): Promise<void>
4949
open (options: OpenOptions): Promise<void>
5050

51-
get (key: KDefault): Promise<VDefault>
52-
get<K = KDefault, V = VDefault> (key: K, options: GetOptions<K, V>): Promise<V>
51+
get (key: KDefault): Promise<VDefault | undefined>
52+
get<K = KDefault, V = VDefault> (key: K, options: GetOptions<K, V>): Promise<V | undefined>
5353

54-
getMany (keys: KDefault[]): Promise<VDefault[]>
55-
getMany<K = KDefault, V = VDefault> (keys: K[], options: GetManyOptions<K, V>): Promise<V[]>
54+
getMany (keys: KDefault[]): Promise<(VDefault | undefined)[]>
55+
getMany<K = KDefault, V = VDefault> (keys: K[], options: GetManyOptions<K, V>): Promise<(V | undefined)[]>
5656

5757
put (key: KDefault, value: VDefault): Promise<void>
5858
put<K = KDefault, V = VDefault> (key: K, value: V, options: PutOptions<K, V>): Promise<void>

0 commit comments

Comments
 (0)