-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathconfig.js
24 lines (24 loc) · 854 Bytes
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadGenericAbi = exports.loadConfig = void 0;
const fs_1 = require("fs");
const debug = require("debug")("tx2uml");
const loadConfig = async (fileName = "./tx.config.json") => {
let config = {};
if ((0, fs_1.existsSync)(fileName)) {
config = JSON.parse((0, fs_1.readFileSync)(fileName, "utf-8"));
debug(`Loaded config file ${fileName}`);
}
return config;
};
exports.loadConfig = loadConfig;
const loadGenericAbi = async (fileName = "./tx.abi.json") => {
let abi = [];
if ((0, fs_1.existsSync)(fileName)) {
abi = JSON.parse((0, fs_1.readFileSync)(fileName, "utf-8"));
debug(`loaded generic abi file ${fileName}`);
}
return abi;
};
exports.loadGenericAbi = loadGenericAbi;
//# sourceMappingURL=config.js.map