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

Function buildRealtimeCountryFilter

packages/trpc/src/routers/realtime.ts:57–67  ·  view source on GitHub ↗
(
  locations: z.infer<typeof realtimeLocationSchema>[]
)

Source from the content-addressed store, hash-verified

55}
56
57function buildRealtimeCountryFilter(
58 locations: z.infer<typeof realtimeLocationSchema>[]
59) {
60 const countries = [
61 ...new Set(locations.map((location) => location.country ?? '')),
62 ];
63
64 return `coalesce(country, '') IN (${countries
65 .map((country) => sqlstring.escape(country))
66 .join(', ')})`;
67}
68
69function buildRealtimeCityFilter(
70 locations: z.infer<typeof realtimeLocationSchema>[]

Callers 2

buildRealtimeCityFilterFunction · 0.85

Calls 2

joinMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected