MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / resolveCommand

Function resolveCommand

scripts/profiler/helpers/resolve-command.ts:24–43  ·  view source on GitHub ↗
(
  definition: ScenarioDefinition,
  commandOrName: string,
)

Source from the content-addressed store, hash-verified

22 * exist or be produced via `--prepare`.
23 */
24export function resolveCommand(
25 definition: ScenarioDefinition,
26 commandOrName: string,
27): ResolvedCommand {
28 const commands = definition.benchmark?.commands ?? {};
29
30 for (const [name, config] of Object.entries(commands)) {
31 if ("steps" in config) {
32 for (const [stepName, step] of Object.entries(config.steps)) {
33 if (stepName === commandOrName) {
34 return { command: step.command, resolvedFrom: stepName };
35 }
36 }
37 } else if (name === commandOrName) {
38 return { command: config.command, resolvedFrom: name };
39 }
40 }
41
42 return { command: commandOrName, resolvedFrom: undefined };
43}

Callers 2

runProfileFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected