Skip to content

Commit

Permalink
Fixed require.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Feb 26, 2024
1 parent 6405b40 commit 0ea40d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions databases/dirty_git_db.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import AbstractDatabase, {Settings} from '../lib/AbstractDatabase';

import {dirname} from 'node:path'
import {simpleGit} from 'simple-git'
/**
* 2011 Peter 'Pita' Martischka
*
Expand Down Expand Up @@ -62,8 +63,8 @@ export default class extends AbstractDatabase {

set(key:string, value: string, callback: ()=>{}) {
this.db.set(key, value, callback);
const databasePath = require('path').dirname(this.settings.filename);
require('simple-git')(databasePath)
const databasePath = dirname(this.settings.filename!);
simpleGit(databasePath)
.silent(true)
.add('./*.db')
.commit('Automated commit...')
Expand Down
2 changes: 1 addition & 1 deletion lib/CacheAndBufferLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* overwriden by the driver and by the module user.
*/

const util = require('util');
import util from 'util';

/**
* Cache with Least Recently Used eviction policy.
Expand Down
2 changes: 1 addition & 1 deletion test/lib/databases.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const os = require('os');
import os from 'os';

type DatabaseType ={
[key:string]:any
Expand Down

0 comments on commit 0ea40d9

Please sign in to comment.