tests
This commit is contained in:
parent
3a7254708e
commit
b63e58784c
41 changed files with 5762 additions and 4477 deletions
|
|
@ -22,18 +22,18 @@ export class SimplePostgresClient {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (match) return row;
|
||||
if (match) {return row;}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async find(table: string, where: any): Promise<any[]> {
|
||||
const rows = this.tables.get(table) || [];
|
||||
if (Object.keys(where).length === 0) return rows;
|
||||
if (Object.keys(where).length === 0) {return rows;}
|
||||
|
||||
return rows.filter(row => {
|
||||
for (const [key, value] of Object.entries(where)) {
|
||||
if (row[key] !== value) return false;
|
||||
if (row[key] !== value) {return false;}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
|
@ -72,7 +72,7 @@ export class SimplePostgresClient {
|
|||
const rows = this.tables.get(table) || [];
|
||||
const remaining = rows.filter(row => {
|
||||
for (const [key, value] of Object.entries(where)) {
|
||||
if (row[key] !== value) return true;
|
||||
if (row[key] !== value) {return true;}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue