harsta
Version:
Harsta is a contract development tool based on Hardhat, designed to streamline the development, testing, and referencing of contracts, addresses, ABIs, and contract instances.
13 lines (11 loc) • 461 B
text/typescript
import path from 'pathe'
import { userRoot } from '../constants'
export function resolveUserPath(targetPath?: string, defaultPath?: string): string | undefined
export function resolveUserPath(targetPath: string, defaultPath: string): string
export function resolveUserPath(targetPath = '', defaultPath?: string) {
return targetPath
? path.isAbsolute(targetPath)
? targetPath
: path.resolve(userRoot, targetPath)
: defaultPath as string
}