From 834c03eabc1938bbd05bcf812a45c475248f2632 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 12 Jul 2024 16:11:33 -0400 Subject: [PATCH] removed NodeJS dependency from common.js --- src/common.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/common.js b/src/common.js index d125339..6cc7e1c 100644 --- a/src/common.js +++ b/src/common.js @@ -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