1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Simplifying serialisation of base items

This commit is contained in:
Laurent Cozic
2018-10-07 20:11:33 +01:00
parent 127dce1cd6
commit 124a959c8d
8 changed files with 20 additions and 43 deletions

View File

@ -236,7 +236,12 @@ class BaseItem extends BaseModel {
return propValue;
}
static async serialize(item, type = null, shownKeys = null) {
static async serialize(item, shownKeys = null) {
if (shownKeys === null) {
shownKeys = this.itemClass(item).fieldNames();
shownKeys.push('type_');
}
item = this.filter(item);
let output = {};