From dede948db9cd87039b842fe3354659e66c8d602c Mon Sep 17 00:00:00 2001 From: su-chang Date: Tue, 22 Oct 2019 20:24:40 +0800 Subject: [PATCH 1/4] test: add test --- src/flash-store.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/flash-store.spec.ts b/src/flash-store.spec.ts index 696533d..0bc319f 100755 --- a/src/flash-store.spec.ts +++ b/src/flash-store.spec.ts @@ -105,6 +105,16 @@ test('async set()', async t => { } }) +test('set the same key more than one time, and the size should be 1', async t => { + for await (const store of storeFixture()) { + await store.set(KEY, VAL) + await store.set(KEY, VAL) + await store.set(KEY, VAL) + const size = await store.size + t.equal(size, 1, 'the size should be 1') + } +}) + test('async size()', async t => { for await (const store of storeFixture()) { let size = await store.size From f06c8b7ae0466bb7cdc5945c5c9de2ef1e440ea4 Mon Sep 17 00:00:00 2001 From: su-chang Date: Tue, 22 Oct 2019 20:24:54 +0800 Subject: [PATCH 2/4] 0.16.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8fad561..12248ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flash-store", - "version": "0.16.6", + "version": "0.16.7", "description": "FlashStore is a Key-Value persistent storage with easy to use ES6 Map-like API(both Async and Sync support), powered by LevelDB and TypeScript.", "main": "bundles/flash-store.umd.js", "types": "dist/src/index.d.ts", From ce8e0a3f29b0d857df068ab251e54ccbc8d6b72f Mon Sep 17 00:00:00 2001 From: su-chang Date: Mon, 10 Feb 2020 18:33:56 +0800 Subject: [PATCH 3/4] modify: make the log show the value detail which will be saved to cache. --- src/flash-store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flash-store.ts b/src/flash-store.ts index f503bef..b5e633c 100644 --- a/src/flash-store.ts +++ b/src/flash-store.ts @@ -103,7 +103,7 @@ export class FlashStore implements AsyncMap { * await flashStore.set(1, 1) */ public async set (key: K, value: V): Promise { - log.verbose('FlashStore', 'set(%s, %s) value type: %s', key, value, typeof value) + log.verbose('FlashStore', 'set(%s, %s) value type: %s', key, JSON.stringify(value), typeof value) await this.levelDb.put(key, JSON.stringify(value)) } From d75a7c9d87d006b0bc3970c1aafe02b0db1c77d9 Mon Sep 17 00:00:00 2001 From: su-chang Date: Mon, 10 Feb 2020 18:34:19 +0800 Subject: [PATCH 4/4] 0.18.16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ec8149b..7237cf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flash-store", - "version": "0.18.15", + "version": "0.18.16", "description": "FlashStore is a Key-Value persistent storage with easy to use ES6 Map-like API(both Async and Sync support), powered by LevelDB and TypeScript.", "main": "dist/src/index.js", "types": "dist/src/index.d.ts",