MCPcopy
hub / github.com/colinhacks/zod / makeData

Function makeData

packages/bench/benchUtil.ts:27–34  ·  view source on GitHub ↗
(count: number, factory: object | (() => any))

Source from the content-addressed store, hash-verified

25}
26
27export function makeData(count: number, factory: object | (() => any)): any[] {
28 return Array.from({ length: count }, () => {
29 // clone non primitive data
30 if (typeof factory === "object") return { ...factory };
31 if (typeof factory === "function") return factory();
32 throw new Error("Invalid factory");
33 });
34}
35
36export function formatNumber(val: number): string {
37 if (val >= 1e12) {

Callers 11

object-setup.tsFile · 0.85
error-handling.tsFile · 0.85
instanceof.tsFile · 0.85
boolean.tsFile · 0.85
array.tsFile · 0.85
number.tsFile · 0.85
string.tsFile · 0.85
jit-union.tsFile · 0.85
datetime.tsFile · 0.85
libs.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected