fix(i18n): catch and remove remaining t-shadow reduce callback
cx
This commit is contained in:
1 parent
3b1f6b59d4
commit
8b7a2dd6e6
2 files changed
+3
-3
No files matched your search
@@ -24,10 +24,10 @@ check_pattern "template each-loop shadowing (as t)" '\{#each[^\n]* as t\b'
|
|||||||
|
|
||||||
# Dangerous callbacks in files using $t(...).
|
# Dangerous callbacks in files using $t(...).
|
||||||
while IFS= read -r file; do
|
while IFS= read -r file; do
|
||||||
if rg -q '\b(map|forEach|filter|find|some|every|reduce)\(\s*t\s*=>' "${file}"; then
|
if rg -q '\b(map|forEach|filter|find|some|every|reduce)\(\s*t\s*=>|\b(map|forEach|filter|find|some|every|reduce)\(\s*\([^)]*,\s*t\s*\)\s*=>' "${file}"; then
|
||||||
echo
|
echo
|
||||||
echo "Found callback shadowing in file using \$t(...): ${file}"
|
echo "Found callback shadowing in file using \$t(...): ${file}"
|
||||||
rg -n '\b(map|forEach|filter|find|some|every|reduce)\(\s*t\s*=>' "${file}"
|
rg -n '\b(map|forEach|filter|find|some|every|reduce)\(\s*t\s*=>|\b(map|forEach|filter|find|some|every|reduce)\(\s*\([^)]*,\s*t\s*\)\s*=>' "${file}"
|
||||||
had_issues=1
|
had_issues=1
|
||||||
fi
|
fi
|
||||||
done < <(rg -l --glob '*.svelte' '\$t\(' "${SRC_DIR}")
|
done < <(rg -l --glob '*.svelte' '\$t\(' "${SRC_DIR}")
|
||||||
|
|||||||
@@ -509,7 +509,7 @@
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// Update duration
|
// Update duration
|
||||||
playlist.duration = qobuzTracks.reduce((sum, t) => sum + t.duration, 0);
|
playlist.duration = qobuzTracks.reduce((sum, track) => sum + track.duration, 0);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to load Qobuz tracks for pending playlist:', err);
|
console.error('Failed to load Qobuz tracks for pending playlist:', err);
|
||||||
tracks = [];
|
tracks = [];
|
||||||
|
|||||||
Reference in new issue
Block a user