This commit is contained in:
Mel O'Hagan 2022-06-28 15:43:34 +01:00
parent de30ebb60d
commit fbf9997805
1 changed files with 1 additions and 5 deletions

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}