Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Fix typings for Batch
Browse files Browse the repository at this point in the history
Tried using the typings with typescript 2.6/2.7 and neither worked. Both throw on `type Batch<K=any, V?=any>`. b353fb4 added the `?` before the default for some reason. AFAIK this is not valid typescript, and servers no purpose. Since `type Batch<K=any, V=any>` already has defaults, the values are optional. Without the question mark it seems to be working.

@vweevers can you elaborate on what you were trying to achieve?
  • Loading branch information
Tapppi authored Feb 19, 2018
1 parent c17886b commit aef012d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface AbstractIteratorOptions<K=any> {
values?: boolean;
}

export type Batch<K=any, V?=any> = PutBatch<K, V> | DelBatch<K>
export type Batch<K=any, V=any> = PutBatch<K, V> | DelBatch<K>

export interface PutBatch<K=any, V=any> {
type: 'put',
Expand Down

0 comments on commit aef012d

Please sign in to comment.