UNPKG

locklift

Version:

Node JS framework for working with Ever contracts. Inspired by Truffle and Hardhat. Helps you to build, test, run and maintain your smart contracts.

16 lines (12 loc) 455 B
import dirTree from "directory-tree"; import { flatDirTree } from "../cli/builder/utils"; import path from "path"; export const getContractsTree = (pathToContractsFolder: string) => { const contractsNestedTree = dirTree(pathToContractsFolder, { extensions: /\.(sol|tsol)/, }); return flatDirTree(contractsNestedTree); }; export const getContractNameFromAbiPath = (pathToAbi: string) => { return path.parse(pathToAbi).name.split(".")[0]; };