Skip to content

Commit

Permalink
fix: fixes lost punctiation in display formatting (#270)
Browse files Browse the repository at this point in the history
fixes #266
  • Loading branch information
ssilve1989 authored May 16, 2024
1 parent e7fda08 commit 9eb9ac7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@sentry/cli": "^2.31.2",
"@sentry/node": "^7.113.0",
"@sentry/profiling-node": "^7.113.0",
"change-case": "^5.4.4",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"dayjs": "^1.11.11",
Expand All @@ -48,6 +47,7 @@
"pino-pretty": "^11.0.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"title-case": "^4.3.1",
"ts-pattern": "^5.1.1",
"tslib": "^2.6.2"
},
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/commands/lookup/lookup.command-handler.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Logger } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
import { capitalCase } from 'change-case';
import { plainToInstance } from 'class-transformer';
import { CommandInteractionOptionResolver, EmbedBuilder } from 'discord.js';
import { titleCase } from 'title-case';
import { EncounterFriendlyDescription } from '../../encounters/encounters.consts.js';
import { SignupCollection } from '../../firebase/collections/signup.collection.js';
import { SignupDocument } from '../../firebase/models/signup.model.js';
Expand Down Expand Up @@ -32,7 +32,7 @@ class LookupCommandHandler implements ICommandHandler<LookupCommand> {
({ world, character, encounter, availability }) => [
{
name: 'Character',
value: `${capitalCase(character)} @ ${capitalCase(world)}`,
value: `${titleCase(character)} @ ${titleCase(world)}`,
inline: true,
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/commands/signup/signup-command.handler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Logger } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs';
import { capitalCase } from 'change-case';
import { plainToInstance } from 'class-transformer';
import { ValidationError, validate } from 'class-validator';
import {
Expand All @@ -12,6 +11,7 @@ import {
DiscordjsErrorCodes,
EmbedBuilder,
} from 'discord.js';
import { titleCase } from 'title-case';
import { P, match } from 'ts-pattern';
import { isSameUserFilter } from '../../common/collection-filters.js';
import {
Expand Down Expand Up @@ -186,11 +186,11 @@ class SignupCommandHandler implements ICommandHandler<SignupCommand> {
.addFields([
{
name: 'Character',
value: capitalCase(character),
value: titleCase(character),
inline: true,
},
{ name: '\u200B', value: '\u200B', inline: true },
{ name: 'Home World', value: capitalCase(world), inline: true },
{ name: 'Home World', value: titleCase(world), inline: true },
{ name: 'Availability', value: availability, inline: true },
{ name: '\u200B', value: '\u200B', inline: true },
{ name: 'Role', value: role, inline: true },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Logger } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
import { capitalCase } from 'change-case';
import { EmbedBuilder } from 'discord.js';
import { titleCase } from 'title-case';
import { MissingChannelException } from '../../../../discord/discord.exceptions.js';
import { DiscordService } from '../../../../discord/discord.service.js';
import { EncounterFriendlyDescription } from '../../../../encounters/encounters.consts.js';
Expand Down Expand Up @@ -92,11 +92,11 @@ class SendSignupReviewCommandHandler
},
{
name: 'Character',
value: capitalCase(character),
value: titleCase(character),
inline: true,
},
{ name: '\u200B', value: '\u200B', inline: true },
{ name: 'Home World', value: capitalCase(world), inline: true },
{ name: 'Home World', value: titleCase(world), inline: true },
{ name: 'Availability', value: availability, inline: true },
{ name: 'Job', value: role, inline: true },
{ name: 'Prog Point', value: progPointRequested, inline: true },
Expand Down
4 changes: 2 additions & 2 deletions src/sheets/sheets.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { sheets_v4 } from '@googleapis/sheets';
import { Inject, Injectable, Logger } from '@nestjs/common';
import { ConfigType } from '@nestjs/config';
import * as Sentry from '@sentry/node';
import { capitalCase } from 'change-case';
import { titleCase } from 'title-case';
import { AsyncQueue } from '../common/async-queue/async-queue.js';
import { PartyType, SignupDocument } from '../firebase/models/signup.model.js';
import { SignupCompositeKeyProps } from '../firebase/models/signup.model.js';
Expand Down Expand Up @@ -422,7 +422,7 @@ class SheetsService {
role,
progPoint = '',
}: SignupDocument) {
return [capitalCase(character), capitalCase(world), role, progPoint];
return [titleCase(character), titleCase(world), role, progPoint];
}
}

Expand Down

0 comments on commit 9eb9ac7

Please sign in to comment.