From 30140f0918306e43d132d2f9cf39d9f29f39dfb3 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 3 Aug 2022 01:52:01 +0300 Subject: [PATCH] tweaks and cleanup... Signed-off-by: Alex A. Naanou --- pwiki2.js | 17 ++++++----------- store/pouchdb.js | 4 ++-- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/pwiki2.js b/pwiki2.js index ca55859..7ffdb8c 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -1,7 +1,6 @@ /********************************************************************** * * -* * Architecture: * store * page @@ -18,12 +17,15 @@ * * * TODO: -* - .load(..) / .json(..) -- for most stores... -* might be a good idea to keep a unified format... * - .then() -- resolve when all pending write operations done ??? * - an async REPL??? * * +* XXX BUG: .get('/* /path').raw will return a punch of '/*' copies, should +* be the same as .get('/*').match()... +* (NOTE: the " " in the pattern is to avoid closing the block comment) +* +* * *********************************************************************** * @@ -77,10 +79,6 @@ var pouchdbstore = require('./store/pouchdb') -//--------------------------------------------------------------------- - - - //--------------------------------------------------------------------- // Page... @@ -1732,14 +1730,11 @@ store.next.load( store.update('@file', Object.create(filestore.FileStore)) -// XXX writing to pages in here does not work yet... -// p.pwiki.path = '/@pouch/README' -// p.pwiki.text = 'PouchDB Store' store.update('@pouch', Object.assign( Object.create(pouchdbstore.PouchDBStore), { - __name__: 'data/pouch', + __path__: 'data/pouch', })) diff --git a/store/pouchdb.js b/store/pouchdb.js index 9174ff3..b229011 100755 --- a/store/pouchdb.js +++ b/store/pouchdb.js @@ -26,7 +26,7 @@ module.PouchDBStore = { // XXX should this be __path__??? // ...this sets the path where the store is created... - __name__: 'data/pouch', + __path__: 'data/pouch', __key_prefix__: 'pwiki:', __data: undefined, @@ -35,7 +35,7 @@ module.PouchDBStore = { var PouchDB = module.PouchDB = require('PouchDB') - return (this.__data = new PouchDB(this.__name__)) } + return (this.__data = new PouchDB(this.__path__)) } return this.__data }, set data(value){ this.__data = value },