removed NodeJS dependency from common.js

This commit is contained in:
Tim
2024-07-12 16:11:33 -04:00
parent 0db8b49bde
commit 834c03eabc

View File

@@ -1,5 +1,3 @@
import * as fs from "node:fs";
export function mixin(child, ...parents) {
// child is modified directly, assigning fields from parents that are missing in child. parents fields are
// assigned by parents order, highest priority first
@@ -98,18 +96,6 @@ export class AsyncURLCache extends AsyncAbiCache {
}
export class AsyncFileCache extends AsyncAbiCache {
constructor(pathForKey) {
super(async (key) => {
const path = this.pathForKey(key)
const data = fs.readFileSync(path, 'utf8');
return JSON.parse(data);
})
this.pathForKey = pathForKey
}
}
export class AbiURLCache extends AsyncURLCache {
constructor(baseUrl) {
super((name)=>{
@@ -120,16 +106,6 @@ export class AbiURLCache extends AsyncURLCache {
}
export class AbiFileCache extends AsyncFileCache {
constructor(basePath) {
super((name)=>{
return this.basePath+abiPath(name)
})
this.basePath = basePath.endsWith('/') ? basePath : basePath + '/'
}
}
const files = {
// If a contract is in a file different than its name, put the exception here
// 'IVaultLogic' : 'IVault', // for example