mirror of
https://github.com/xitanggg/open-resume
synced 2024-11-03 09:19:21 +01:00
Fix a getTextWithHighestFeatureScore bug introduced at #34 to return empty string
This commit is contained in:
parent
4337e968c3
commit
b5d3bc441b
@ -70,8 +70,9 @@ export const getTextWithHighestFeatureScore = (
|
||||
if (returnEmptyStringIfHighestScoreIsNotPositive && highestScore <= 0)
|
||||
return ["", textScores] as const;
|
||||
|
||||
// Note: If textItems is an empty array, textsWithHighestFeatureScore[0] is undefined, so we default it to empty string
|
||||
const text = !returnConcatenatedStringForTextsWithSameHighestScore
|
||||
? textsWithHighestFeatureScore[0]
|
||||
? textsWithHighestFeatureScore[0] ?? ""
|
||||
: textsWithHighestFeatureScore.map((s) => s.trim()).join(" ");
|
||||
|
||||
return [text, textScores] as const;
|
||||
|
Loading…
Reference in New Issue
Block a user