You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LocalStorageCore does not allow a user to specify an absolute path.
The issue comes from the fact that sanitizeFilename strips the root separator making everything relative to the current directory.
When using pouchdb-adapter-fs this has the effect that the prefix writes everything to the current directory instead of writing from the root directory
I patched my project with a 1 line fix
function LocalStorageCore(dbname) {
var self = this;
/* One line patch. Check if the first character is a '/' and append it */
var filename = (dbname [0] === path.sep ? path.sep : '') + path.join.apply(null, dbname.split(path.sep).map(sanitizeFilename)) + '.json';
/* End patch */
if (dbs.has(dbname)) {
self._db = dbs.get(dbname);
} else {
mkdirp.sync(path.dirname(filename));
self.import(dbname, filename);
}
I wonder if you have a better solution for this?
The sanitize-filename module by definition gets rid of all the path stuff. Optimally it would be nice to be able to set an option to ignore the sanitize and just pass it in as is
The text was updated successfully, but these errors were encountered:
LocalStorageCore does not allow a user to specify an absolute path.
The issue comes from the fact that sanitizeFilename strips the root separator making everything relative to the current directory.
When using pouchdb-adapter-fs this has the effect that the prefix writes everything to the current directory instead of writing from the root directory
I patched my project with a 1 line fix
I wonder if you have a better solution for this?
The sanitize-filename module by definition gets rid of all the path stuff. Optimally it would be nice to be able to set an option to ignore the sanitize and just pass it in as is
The text was updated successfully, but these errors were encountered: