Новый движок БД
This commit is contained in:
22
server/db/JembaDb/TableFlag.js
Normal file
22
server/db/JembaDb/TableFlag.js
Normal file
@@ -0,0 +1,22 @@
|
||||
class TableFlag {
|
||||
constructor(checkCode) {
|
||||
this.checkCode = checkCode;
|
||||
this.checkFunc = eval(checkCode);
|
||||
|
||||
this.flag = new Set();
|
||||
}
|
||||
|
||||
add(row) {
|
||||
if (this.checkFunc(row)) {
|
||||
this.flag.add(row.id);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
del(row) {
|
||||
this.flag.delete(row.id);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TableFlag;
|
||||
Reference in New Issue
Block a user