Files
liberama/server/db/JembaDb/TableFlag.js
2021-11-24 14:15:09 +07:00

22 lines
398 B
JavaScript

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;