Skip to content
Merged
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
2 changes: 1 addition & 1 deletion data-migration/src/utils/dataLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async function loadData(dataDir, fileName, isElasticsearch = false, sinceDate =

if (suspiciousReason) {
if (invalidDateBehavior.warn) {
console.warn(`${fileName}: record ${recordIdentifier} has ${suspiciousReason.replace('|', ' & ')} (${parsedDate.toISOString()}); strategy=${invalidDateBehavior.strategy}`);
console.warn(`${fileName}: record ${recordIdentifier} has ${suspiciousReason.replace(/\|/g, ' & ')} (${parsedDate.toISOString()}); strategy=${invalidDateBehavior.strategy}`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The use of suspiciousReason.replace(/\|/g, ' & ') correctly replaces all occurrences of the pipe character. Ensure that suspiciousReason is always a string to avoid runtime errors. Consider adding a check or conversion to string if there's any chance suspiciousReason could be non-string.

}
if (!invalidDateBehavior.include) {
invalidDateSkippedCount += 1;
Expand Down