Skip to content

Commit 836211f

Browse files
committed
chore: small fixes
1 parent 00dd695 commit 836211f

File tree

4 files changed

+1555
-6767
lines changed

4 files changed

+1555
-6767
lines changed

index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import * as os from 'os'
44
import * as fs from 'fs-extra'
55
import EventEmitter from 'events';
6-
import {type KeyvStoreAdapter, type StoredData} from 'keyv';
6+
import type {KeyvStoreAdapter, StoredData} from 'keyv';
77

88
export interface Options {
99
deserialize: (val: any) => any;
@@ -193,9 +193,9 @@ export class KeyvFile extends EventEmitter implements KeyvStoreAdapter {
193193
this._savePromise = new Promise<void>((resolve, reject) => {
194194
setTimeout(
195195
() => {
196-
this.saveToDisk().then(() => {
197-
this._savePromise = void 0;
198-
}).then(resolve, reject);
196+
this.saveToDisk().then(resolve, reject).finally(() => {
197+
this._savePromise = void 0
198+
});
199199
},
200200
this.opts.writeDelay
201201
)

0 commit comments

Comments
 (0)