Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RozmarinUS committed May 29, 2024
1 parent 3897de7 commit 3ef806e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/stat-reporter/nestcord-stat-reporter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export class NestCordStatReporterService implements OnModuleInit {

private replacePlaceholders(obj: any, replacements: { [key: string]: any }): any {
if (typeof obj === 'string') {
return obj.replace(/{{(.*?)}}/g, (_, key) => replacements[key] ?? _);
const val = obj.replace(/{{(.*?)}}/g, (_, key) => replacements[key] ?? _);

return !isNaN(parseFloat(val)) ? Number(val) : val;
}
if (obj && typeof obj === 'object') {
Object.entries(obj).forEach(([key, value]) => {
Expand Down

0 comments on commit 3ef806e

Please sign in to comment.