export instantiation of util class

This commit is contained in:
Triston Armstrong 2023-12-25 22:42:33 -06:00
parent 08f828b955
commit cf93ff3231

View File

@ -8,8 +8,14 @@ import fs from "fs";
const dirTree = require("directory-tree");
export class Util {
_counter = 0;
class Util {
_counter;
cachedSlugMap;
constructor() {
this._counter = 0;
this.cachedSlugMap = this.getSlugHashMap();
}
getContent(slug) {
let currentFilePath = toFilePath(slug)
@ -54,7 +60,6 @@ export class Util {
}
toFilePath(slug) {
const cachedSlugMap = getSlugHashMap()
return cachedSlugMap[slug]
}
@ -263,3 +268,4 @@ export class Util {
}
}
export default new Util()