diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-12-18 11:52:11 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-12-18 11:52:11 -0800 |
commit | 9395d467120c3a6ef2d0b50d19a9bf46d0f7fa7d (patch) | |
tree | 575c618d3737ffdff3ada45b7e999c19793227ee /ext/bg/js/util.js | |
parent | e5275560cecc839930c4fdad52dc96df512212e1 (diff) |
WIP
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r-- | ext/bg/js/util.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index f44ffbc8..a0fca270 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -103,6 +103,14 @@ function buildTag(name, meta) { tag[prop] = meta[symbol][prop]; } + return sanitizeTag(tag); +} + +function sanitizeTag(tag) { + tag.name = tag.name || 'untitled'; + tag.category = tag.category || 'default'; + tag.notes = tag.notes || ''; + tag.order = tag.order || 0; return tag; } |