Commit 44e4ae44 authored by alexandre's avatar alexandre

Merge branch 'master' of gitlab.constantvzw.org:osp/work.w

parents 360664e7 83ec8cbf
......@@ -64,6 +64,30 @@ window.W = window.W || {};
return depthOf(json.mainline || json.sublines);
},
parse: function (data) {
function trimStrings(v) {
if (typeof v === "string") {
return v.trim();
} else if (typeof v === "number") {
return v;
} else if (v === null) {
return v;
} else if (Array.isArray(v)) {
return _.map(v, trimStrings);
} else if (typeof v === "object") {
return _.mapObject(v, trimStrings);
}
return v;
}
// console.log(data);
data = trimStrings(data);
// console.log(data);
return data;
},
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment