UNPKG

hardhat

Version:

Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.

67 lines 2.73 kB
/** * @file This file has a set of helpers that depend on the codebase. They * inspect the stack frames to look for known folders, files, or function names. * * As such, they are somewhat fragile and need to be periodically reevaluated, * especially after large refactors to Hardhat's core. */ import { type StackFrame } from "./helpers.js"; /** * Returns true when this package is being executed from the Hardhat monorepo * source tree instead of from an installed `node_modules/hardhat` package. */ export declare function isRunningInsideHardhatMonorepo(): boolean; /** * Matches the Hardhat frame that imports the user's config file. */ export declare function isConfigLoadingBoundaryFrame(frame: StackFrame): boolean; /** * Matches the builtin console task frame that evaluates user input. */ export declare function isConsoleEvaluationBoundaryFrame(frame: StackFrame): boolean; /** * Matches the builtin run task frame that executes a user script. */ export declare function isScriptExecutionBoundaryFrame(frame: StackFrame): boolean; /** * Matches the node:test runner task frame that executes user tests. */ export declare function isNodeTestExecutionBoundaryFrame(frame: StackFrame): boolean; /** * Matches the Mocha runner task frame that executes user tests. */ export declare function isMochaTestExecutionBoundaryFrame(frame: StackFrame): boolean; /** * Matches the resolved-task frame that calls into a task action. */ export declare function isTaskActionBoundaryFrame(frame: StackFrame): boolean; /** * Matches the hook-manager frame that calls into hook handlers. */ export declare function isHookHandlerBoundaryFrame(frame: StackFrame): boolean; /** * Finds the task action frame immediately above the resolved-task boundary. */ export declare function getTaskExecutionFrame(frames: StackFrame[]): StackFrame | undefined; /** * Finds the hook handler frame immediately above the hook-manager boundary. */ export declare function getHookExecutionFrame(frames: StackFrame[]): StackFrame | undefined; /** * Returns true for stack locations owned by packages outside Hardhat. */ export declare function isThirdPartyFrame(location: string): boolean; /** * Returns true for stack locations owned by Hardhat or first-party packages. */ export declare function isFirstPartyPluginFrame(location: string): boolean; /** * Returns true when the error stack appears to come from workspace * initialization. */ export declare function isWorkspaceInitFilesystemFrame(error: Error): boolean; /** * Returns true for stack frames owned by EDR provider or stack-trace code. */ export declare function isEdrFrame(frame: StackFrame): boolean; //# sourceMappingURL=codebase-dependent-helpers.d.ts.map