Skip to content

Commit

Permalink
Use dirty ts.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Oct 17, 2023
1 parent 1d37bdb commit 58b08a2
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
7 changes: 3 additions & 4 deletions databases/dirty_db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
*/

import AbstractDatabase, {Settings} from '../lib/AbstractDatabase';
// @ts-ignore
import Dirty from 'dirty';
import Dirty from 'dirty-ts';

type DirtyDBCallback = (p?:any, keys?: string[])=>{};

Expand All @@ -49,7 +48,7 @@ export const Database = class extends AbstractDatabase {

init(callback: ()=>{}) {
this.db = new Dirty(this.settings.filename);
this.db.on('load', (err:string) => {
this.db.on('load', () => {
callback();
});
}
Expand All @@ -61,7 +60,7 @@ export const Database = class extends AbstractDatabase {
findKeys(key:string, notKey:string, callback:DirtyDBCallback) {
const keys:string[] = [];
const regex = this.createFindRegex(key, notKey);
this.db.forEach((key:string, val:string) => {
this.db.forEach((key:string) => {
if (key.search(regex) !== -1) {
keys.push(key);
}
Expand Down
45 changes: 40 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"better-sqlite3": "^9.0.0",
"cassandra-driver": "^4.7.2",
"cli-table": "^0.3.11",
"dirty": "^1.1.3",
"dirty-ts": "^1.1.6",
"elasticsearch8": "npm:@elastic/elasticsearch@^8.8.1",
"eslint": "^8.51.0",
"eslint-config-etherpad": "^3.0.22",
Expand Down

0 comments on commit 58b08a2

Please sign in to comment.