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

Function parseSampleRate

scripts/profiler/helpers/args.ts:43–57  ·  view source on GitHub ↗
(value: string | undefined)

Source from the content-addressed store, hash-verified

41}
42
43export function parseSampleRate(value: string | undefined): number {
44 if (value === undefined) {
45 return DEFAULT_SAMPLE_RATE_HZ;
46 }
47
48 const rate = Number(value);
49
50 if (!Number.isInteger(rate) || rate < 1 || rate > 100_000) {
51 throw new Error(
52 `--sample-rate must be an integer between 1 and 100000; got "${value}"`,
53 );
54 }
55
56 return rate;
57}

Callers 2

resolveAndValidateArgsFunction · 0.90
args.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected