minor fix + added .hasTag(..)

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-11-30 18:55:02 +03:00
parent 2288835f5a
commit e54ce63dff

View File

@ -329,8 +329,19 @@ var TagsPrototype = {
.map(function(s){ return [...s[1]] }) .map(function(s){ return [...s[1]] })
.flat())] }, .flat())] },
// Testing...
// XXX can these be faster???
// XXX should these take multiple values???
hasTag: function(tag){
for(var t of this.tags()){
if(this.match(tag, t)){
return true
}
}
return false
},
has: function(value){ has: function(value){
for(var v in Object.values(this.__index)){ for(var v of Object.values(this.__index)){
if(v.has(value)){ if(v.has(value)){
return true return true
} }