diff options
author | theia | 2023-02-02 09:46:23 -0500 |
---|---|---|
committer | theia | 2023-02-02 09:46:23 -0500 |
commit | e88fae3261abea5522c1f8560b33e6e23fb1d1fd (patch) | |
tree | d3b428591b799256f4eb81830202017b6918f1f5 | |
parent | 161e34c96c81b7cf20f0c4d86e297f4a7110c6f0 (diff) |
filter null tags
-rw-r--r-- | graffiti.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/graffiti.js b/graffiti.js index ad456b1..9c5b188 100644 --- a/graffiti.js +++ b/graffiti.js @@ -230,6 +230,7 @@ export default class { } objectsByTags(...tags) { + tags = tags.filter(tag=> tag!=null) for (const tag of tags) { if (!(tag in this.tagMap)) { throw `You are not subscribed to '${tag}'` @@ -245,6 +246,7 @@ export default class { } async subscribe(...tags) { + tags = tags.filter(tag=> tag!=null) // Look at what is already subscribed to const subscribingTags = [] for (const tag of tags) { @@ -267,6 +269,7 @@ export default class { } async unsubscribe(...tags) { + tags = tags.filter(tag=> tag!=null) // Decrease the count of each tag, // removing and marking if necessary const unsubscribingTags = [] |