Skip to content

Commit

Permalink
Merge pull request #385 from mStirner/dev
Browse files Browse the repository at this point in the history
workin on issues
  • Loading branch information
mStirner authored Dec 29, 2023
2 parents 97c7a42 + 8122b54 commit abc4dfb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions system/component/class.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,12 @@ module.exports = class COMPONENT extends COMMON {
let loop = (target, filter) => {
return Object.keys(filter).every((key) => {

if (key === "labels" && Array.isArray(filter[key])) {
return filter[key].every((label) => {
return item.labels.includes(label);
});
}

if (target[key] instanceof Object) {
return loop(target[key], filter[key]);
} else {
Expand Down
4 changes: 4 additions & 0 deletions system/component/class.labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ module.exports = class Labels extends Array {
});
}

includes(str) {
return Array.prototype.includes.call(this.toJSON(), str);
}

};

0 comments on commit abc4dfb

Please sign in to comment.