MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / generateEvents

Function generateEvents

apps/api/scripts/mock.ts:125–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123}
124
125function generateEvents(): Event[] {
126 const events: Event[] = [];
127
128 domains.forEach(({ domain, clientId, profiles }) => {
129 for (let i = 0; i < profiles.length; i++) {
130 events.push(
131 ...generateScreenViews({
132 domain,
133 clientId,
134 profile: profiles[i % PROFILE_COUNT]!,
135 eventsCount: Math.floor(Math.random() * 10),
136 }),
137 );
138 }
139 });
140
141 return events;
142}
143
144function scrambleEvents(events: Event[]) {
145 return events.sort(() => Math.random() - 0.5);

Callers 1

createMockFunction · 0.85

Calls 2

generateScreenViewsFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected