feat: add db.debug for debug related functions

This commit is contained in:
thecodrr
2021-09-15 11:47:10 +05:00
parent ed2624a918
commit c77bdcd3ce
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
export default class Debug {
strip(item) {
return JSON.stringify({
type: item.type,
notebooks: item.notebooks,
tags: item.tags,
id: item.id,
contentId: item.contentId,
dateEdited: item.dateEdited,
dateDeleted: item.dateDeleted,
dateCreated: item.dateCreated,
});
}
}

View File

@@ -19,6 +19,7 @@ import UserManager from "./user-manager";
import http from "../utils/http"; import http from "../utils/http";
import Monographs from "./monographs"; import Monographs from "./monographs";
import Offers from "./offers"; import Offers from "./offers";
import Debug from "./debug";
/** /**
* @type {EventSource} * @type {EventSource}
@@ -74,6 +75,7 @@ class Database {
this.outbox = new Outbox(this); this.outbox = new Outbox(this);
this.monographs = new Monographs(this); this.monographs = new Monographs(this);
this.offers = new Offers(); this.offers = new Offers();
this.debug = new Debug();
// collections // collections
/** @type {Notes} */ /** @type {Notes} */