From b52351d6fb72db758f26ae8f0cb3be3ab3cf3076 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 3 Aug 2022 11:33:23 +0300 Subject: [PATCH] bugfixes and tweaks... Signed-off-by: Alex A. Naanou --- pwiki2.js | 3 ++- store/base.js | 1 + store/pouchdb.js | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pwiki2.js b/pwiki2.js index 7ffdb8c..60a3e95 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -316,7 +316,8 @@ object.Constructor('BasePage', { match: relMatchProxy('match'), resolve: relMatchProxy('resolve'), delete: function(path='.'){ - return this.__delete__() }, + this.__delete__() + return this }, // // .get([, ]) diff --git a/store/base.js b/store/base.js index a6d1397..2307b07 100755 --- a/store/base.js +++ b/store/base.js @@ -44,6 +44,7 @@ var pwpath = require('../lib/path') // cache/index??? // ...can we avoid this?? // +// XXX might be a good idea to split this into a generic store and a MemStore... // XXX LEADING_SLASH should this be strict about leading '/' in paths??? // ...this may lead to duplicate paths created -- '/a/b' and 'a/b' // XXX should we support page symlinking??? diff --git a/store/pouchdb.js b/store/pouchdb.js index b229011..b5e801c 100755 --- a/store/pouchdb.js +++ b/store/pouchdb.js @@ -49,7 +49,8 @@ module.PouchDBStore = { return e.id.slice(that.__key_prefix__.length) }) }, // XXX use an index... __exists__: async function(key){ - return !! await this.__get__(key) }, + return !!(await this.__get__(key)) + && key }, __get__: async function(key){ try{ return await this.data.get(this.__key_prefix__ + key)