From 38768de87cf81fbcd282b0c8d8312774e95b1173 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Thu, 17 Jul 2025 09:01:33 -0500 Subject: [PATCH] Add string comments --- src/photo/db/index.ts | 1 + src/utility/string.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/photo/db/index.ts b/src/photo/db/index.ts index 7bfa9335..e3149217 100644 --- a/src/photo/db/index.ts +++ b/src/photo/db/index.ts @@ -7,6 +7,7 @@ import { APP_DEFAULT_SORT_BY, SortBy } from '../sort'; export const GENERATE_STATIC_PARAMS_LIMIT = 1000; export const PHOTO_DEFAULT_LIMIT = 100; +// These must mirror utility/string.ts parameterization const CHARACTERS_TO_REMOVE = [',', '/']; const CHARACTERS_TO_REPLACE = ['+', '&', '|', ' ']; diff --git a/src/utility/string.ts b/src/utility/string.ts index a552f7dc..00b073ec 100644 --- a/src/utility/string.ts +++ b/src/utility/string.ts @@ -27,6 +27,7 @@ export const parameterize = ( // Remove punctuation .replaceAll(/['"!@#$%^*()=[\]{};:/?,<>\\/`~]/gi, '') // Removes non-alphanumeric characters, if configured + // (breaks i18m) .replaceAll( shouldRemoveNonAlphanumeric ? /([^a-z0-9-])/gi