1
0
Fork 0
mirror of synced 2024-06-26 10:00:41 +12:00
This commit is contained in:
Mel O'Hagan 2022-06-28 15:43:34 +01:00
parent de30ebb60d
commit fbf9997805

View file

@ -5,12 +5,8 @@
const displayLimit = 5
$: badges = isValidType() ? value?.slice(0, displayLimit) : []
$: badges = Array.isArray(value) ? value.slice(0, displayLimit) : []
$: leftover = (value?.length ?? 0) - badges.length
function isValidType() {
return Array.isArray(value) || typeof value === "string"
}
</script>
{#each badges as badge}