Update dependency @types/node to v24.9.2 #20

Merged
nemunaire merged 2 commits from renovate/node-24.x-lockfile into master 2025-11-14 12:56:11 +00:00
2 changed files with 33 additions and 16 deletions

View file

@ -659,30 +659,47 @@ func (c *ContentAnalyzer) calculateTextPlainConsistency(plainText, htmlText stri
return 0.0 return 0.0
} }
// Count common words // Count common words by building sets
commonWords := 0 plainWordSet := make(map[string]int)
plainWordSet := make(map[string]bool)
for _, word := range plainWords { for _, word := range plainWords {
plainWordSet[word] = true plainWordSet[word]++
} }
htmlWordSet := make(map[string]int)
for _, word := range htmlWords { for _, word := range htmlWords {
if plainWordSet[word] { htmlWordSet[word]++
commonWords++ }
// Count matches: for each unique word, count minimum occurrences in both texts
commonWords := 0
for word, plainCount := range plainWordSet {
if htmlCount, exists := htmlWordSet[word]; exists {
// Count the minimum occurrences between both texts
if plainCount < htmlCount {
commonWords += plainCount
} else {
commonWords += htmlCount
}
} }
} }
// Calculate ratio (Jaccard similarity approximation) // Calculate ratio using total words from both texts (union approach)
maxWords := len(plainWords) // This provides a balanced measure: perfect match = 1.0, partial overlap = 0.3-0.8
if len(htmlWords) > maxWords { totalWords := len(plainWords) + len(htmlWords)
maxWords = len(htmlWords) if totalWords == 0 {
}
if maxWords == 0 {
return 0.0 return 0.0
} }
return float32(commonWords) / float32(maxWords) // Divide by average word count for better scoring
avgWords := float32(totalWords) / 2.0
ratio := float32(commonWords) / avgWords
// Cap at 1.0 for perfect matches
if ratio > 1.0 {
ratio = 1.0
}
return ratio
} }
// normalizeText normalizes text for comparison // normalizeText normalizes text for comparison

6
web/package-lock.json generated
View file

@ -1352,9 +1352,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "24.9.1", "version": "24.9.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.2.tgz",
"integrity": "sha512-QoiaXANRkSXK6p0Duvt56W208du4P9Uye9hWLWgGMDTEoKPhuenzNcC4vGUmrNkiOKTlIrBoyNQYNpSwfEZXSg==", "integrity": "sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,