Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions netlify/functions/batchUpdateMeetingSummariesArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const MAX_CONCURRENT_REQUESTS = 10;

function sanitizeObject(item) {
if (typeof item === 'string') {
// Replace anything outside ASCII printable chars (0x20–0x7E) with '-'
return item.replace(/[^a-zA-Z0-9.,:;!?"'()\-\s]/g, '-');
// Only replace en dash (U+2013) or em dash (U+2014) with ASCII hyphen '-'
return item.replace(/[\u2013\u2014]/g, '-');
}

if (Array.isArray(item)) {
Expand Down Expand Up @@ -109,8 +109,8 @@ async function processAndCommitSummaries() {
const flattenedSummaries = summariesBatches.flat();

if (flattenedSummaries.length === 0) {
//hasMoreSummaries = false;
//break;
hasMoreSummaries = false;
break;
}

groupSummariesByYear(flattenedSummaries, allSummaries);
Expand Down
8 changes: 4 additions & 4 deletions netlify/functions/batchUpdateMeetingSummariesById.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const MAX_CONCURRENT_REQUESTS = 10;

function sanitizeObject(item) {
if (typeof item === 'string') {
// Replace anything outside ASCII printable chars (0x20-0x7E) with '-'
return item.replace(/[^a-zA-Z0-9.,:;!?"'()\-\s]/g, '-');
// Only replace en dash (U+2013) or em dash (U+2014) with ASCII hyphen '-'
return item.replace(/[\u2013\u2014]/g, '-');
}

if (Array.isArray(item)) {
Expand Down Expand Up @@ -115,8 +115,8 @@ async function processAndCommitSummaries() {
const flattenedSummaries = summariesBatches.flat();

if (flattenedSummaries.length === 0) {
//hasMoreSummaries = false;
//break;
hasMoreSummaries = false;
break;
}

flattenedSummaries.forEach(summary => {
Expand Down