add empty variables to json seafile

This commit is contained in:
Roy Olav Purser 2021-09-06 09:02:36 +02:00
parent 116d990cb7
commit 2458d6f2f5
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -42,7 +42,14 @@ if(url !== null) {
}
for(let i=0; i<props.length; i++) {
const prop = props[i];
if((prop.key.type === "Identifier") && (prop.value.type === "Literal") && (prop.value.value != "")) {
if((prop.key.type === "Identifier") && (prop.value.type === "Literal")) {
data[prop.key.name] = prop.value.value;
}
}
for(let i=0; i<props.length; i++) {
const prop = props[i];
const valid = (new Boolean(prop.value.value)).valueOf();
if((prop.key.type === "Identifier") && (prop.value.type === "Literal") && valid) {
data[prop.key.name] = prop.value.value;
}
}