1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-25 04:37:40 +00:00

Add a function to check whether a tiddler has a given field

This commit is contained in:
Jeremy Ruston
2012-10-16 19:12:09 +01:00
parent f0974740db
commit a832338bb6
2 changed files with 5 additions and 1 deletions

View File

@@ -16,6 +16,10 @@ exports.hasTag = function(tag) {
return this.fields.tags && this.fields.tags.indexOf(tag) !== -1;
};
exports.hasField = function(field) {
return $tw.utils.hop(this.fields,field);
};
exports.getFieldString = function(field) {
var value = this.fields[field];
// Check for a missing field