From db4d125613bb3fc67438c0f140dcfbc4049458fd Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Tue, 7 Oct 2025 18:10:26 -0700 Subject: [PATCH] feat: no flatten at all, let the analytic server handle that --- package.json | 1 - pnpm-lock.yaml | 10 ---------- src/index.ts | 11 +++++++---- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index fbb3ec1..7230550 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "discord.js": "^14.0.0" }, "dependencies": { - "flat": "6.0.1", "node-schedule": "2.1.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8e53e7..b678a52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,9 +14,6 @@ importers: discord.js: specifier: ^14.0.0 version: 14.22.1 - flat: - specifier: 6.0.1 - version: 6.0.1 node-schedule: specifier: 2.1.1 version: 2.1.1 @@ -1130,11 +1127,6 @@ packages: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} - flat@6.0.1: - resolution: {integrity: sha512-/3FfIa8mbrg3xE7+wAhWeV+bd7L2Mof+xtZb5dRDKZ+wDvYJK4WDYeIOuOhre5Yv5aQObZrlbRmk3RTSiuQBtw==} - engines: {node: '>=18'} - hasBin: true - flatted@3.3.3: resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} @@ -3376,8 +3368,6 @@ snapshots: flatted: 3.3.3 keyv: 4.5.4 - flat@6.0.1: {} - flatted@3.3.3: {} for-each@0.3.5: diff --git a/src/index.ts b/src/index.ts index 371baed..c3009a5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,6 @@ * @author Naomi Carrigan */ -import { flatten } from "flat"; import { scheduleJob, type Job } from "node-schedule"; import type { Logger } from "@nhcarrigan/logger"; import type { Events, Client } from "discord.js"; @@ -23,8 +22,7 @@ export class DiscordAnalytics { public constructor( private readonly client: Client, private readonly logger: Logger, - ) { - } + ) {} /** * Starts a CRON job to run at midnight (system time) daily. @@ -88,6 +86,11 @@ export class DiscordAnalytics { event: Events, payload: Record, ): Promise { - await this.logger.metric(event, 1, flatten(payload, { delimiter: "_" })); + await this.logger.metric( + event, + 1, + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- We want to cast this to a specific type. + payload as Record, + ); } }