Skip to content

Commit

Permalink
added utils.js
Browse files Browse the repository at this point in the history
  • Loading branch information
zotya committed Mar 3, 2023
1 parent dfae19e commit fdb33c3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/ItemView/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const OBSOLETE_KEYS = ['obsolete', 'superseded'];

export const isObsolete = (status) => {
let obsolete = false;
if (status) {
if (Array.isArray(status)) {
if (
status.filter((stat) => OBSOLETE_KEYS.includes(stat?.key)).length > 0
) {
obsolete = true;
}
} else {
if (OBSOLETE_KEYS.includes(status?.key)) {
obsolete = true;
}
}
}
return obsolete;
};

0 comments on commit fdb33c3

Please sign in to comment.