Skip to content

Commit 81e54ed

Browse files
committed
chore: define priorities
1 parent ce872c9 commit 81e54ed

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as api from 'src/utils/4.api.js';
2+
import Constant from './constant.js';
3+
4+
export default class Priority extends Constant {
5+
static FIRST = new Priority('first', 'top');
6+
static HIGHEST = new Priority('highest');
7+
static HIGH = new Priority('high');
8+
static NORMAL = new Priority('normal');
9+
static LOW = new Priority('low');
10+
static LOWEST = new Priority('lowest');
11+
static LAST = new Priority('last', 'bottom');
12+
13+
static get(value) {
14+
if (value instanceof Priority) return value;
15+
// eslint-disable-next-line no-use-before-define
16+
return values.find((v) => v.equals(value));
17+
}
18+
}
19+
20+
const values = Object.values(Priority);
21+
22+
api.mod.priorities = Object.fromEntries(Object.entries(Priority));

0 commit comments

Comments
 (0)