15 lines
314 B
JavaScript
15 lines
314 B
JavaScript
export class QueryWrapper {
|
|
constructor(sql) {
|
|
this.sql = sql.trim();
|
|
this.operation = sql.replace(/[^a-z].*/i, "").toUpperCase();
|
|
}
|
|
|
|
isAnyOf(...operations) {
|
|
for (const op of operations) {
|
|
if(op.toUpperCase() === this.operation) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
} |