From 0ea40d9ef0d0be0c4e6adb7ecd3c998aaff7f514 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Mon, 26 Feb 2024 09:04:29 +0100 Subject: [PATCH] Fixed require. --- databases/dirty_git_db.ts | 7 ++++--- lib/CacheAndBufferLayer.ts | 2 +- test/lib/databases.ts | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/databases/dirty_git_db.ts b/databases/dirty_git_db.ts index d3f28323..163bbdb6 100644 --- a/databases/dirty_git_db.ts +++ b/databases/dirty_git_db.ts @@ -1,5 +1,6 @@ import AbstractDatabase, {Settings} from '../lib/AbstractDatabase'; - +import {dirname} from 'node:path' +import {simpleGit} from 'simple-git' /** * 2011 Peter 'Pita' Martischka * @@ -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...') diff --git a/lib/CacheAndBufferLayer.ts b/lib/CacheAndBufferLayer.ts index 187edfb1..be07a6a3 100644 --- a/lib/CacheAndBufferLayer.ts +++ b/lib/CacheAndBufferLayer.ts @@ -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. diff --git a/test/lib/databases.ts b/test/lib/databases.ts index fb42157f..896e992f 100644 --- a/test/lib/databases.ts +++ b/test/lib/databases.ts @@ -1,4 +1,4 @@ -const os = require('os'); +import os from 'os'; type DatabaseType ={ [key:string]:any