1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Ensure tiddler.getFieldStringBlock uses a deterministic ordering

Makes diffs easier to track
This commit is contained in:
Jermolene 2019-04-14 14:23:49 +01:00
parent 58cdbbf865
commit 0513837228

View File

@ -75,16 +75,16 @@ Get all the fields as a name:value block. Options:
*/
exports.getFieldStringBlock = function(options) {
options = options || {};
var exclude = options.exclude || [];
var fields = [];
for(var field in this.fields) {
if($tw.utils.hop(this.fields,field)) {
if(exclude.indexOf(field) === -1) {
fields.push(field + ": " + this.getFieldString(field));
}
var exclude = options.exclude || [],
fields = Object.keys(this.fields).sort(),
result = [];
for(var t=0; t<fields.length; t++) {
var field = fields[t];
if(exclude.indexOf(field) === -1) {
result.push(field + ": " + this.getFieldString(field));
}
}
return fields.join("\n");
return result.join("\n");
};
exports.getFieldDay = function(field) {