StreamBuilder.ratePerSecond(val: number | bigint) (src/builder.ts) accepts either a number or a bigint. build() runs the config through bigintSafeStringify(), which only converts values whose typeof is 'bigint' to strings — a plain number value passes through unchanged. But build()'s return is force-cast with as { ...; ratePerSecond?: string }, so calling .ratePerSecond(500).build() (a valid call per the method's own signature) produces an object whose ratePerSecond is the runtime number 500, while the TypeScript type asserts it's a string. Any caller trusting the declared type (e.g. doing .trim() or string concatenation on it) hits a runtime error TypeScript can't catch.
StreamBuilder.ratePerSecond(val: number | bigint)(src/builder.ts) accepts either anumberor abigint.build()runs the config throughbigintSafeStringify(), which only converts values whosetypeofis'bigint'to strings — a plainnumbervalue passes through unchanged. Butbuild()'s return is force-cast withas { ...; ratePerSecond?: string }, so calling.ratePerSecond(500).build()(a valid call per the method's own signature) produces an object whoseratePerSecondis the runtime number500, while the TypeScript type asserts it's astring. Any caller trusting the declared type (e.g. doing.trim()or string concatenation on it) hits a runtime error TypeScript can't catch.