Don't remove root Tags when empty

It unnecessarily complicates things.
This commit is contained in:
Zaid Abdulla committed 2017-07-30 04:54:55 -07:00
1 parent 0ca44d7ffb
commit 306193e6e9
2 files changed
+3 -9

No files matched your search

+3 -2
View File
@@ -333,8 +333,9 @@ fetchDevice = (id, timestamp, patterns, callback) ->
{object: [timestamp, 0], writable: [timestamp, 0], value: [timestamp, [v, 'xsd:string']]}])
delete device[k]
when '_tags'
res.push([['Tags'], timestamp,
{object: [timestamp, 1], writable: [timestamp, 0]}])
if v.length
res.push([['Tags'], timestamp,
{object: [timestamp, 1], writable: [timestamp, 0]}])
for t in v
t = t.replace(/[^a-zA-Z0-9\-]+/g, '_')
res.push([['Tags', t], timestamp,