mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Ensure tiddler.getFieldStringBlock uses a deterministic ordering
Makes diffs easier to track
This commit is contained in:
parent
58cdbbf865
commit
0513837228
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user