From fbf9997805d08a512f6beaa9309b741e14fb9223 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Tue, 28 Jun 2022 15:43:34 +0100 Subject: [PATCH] Refactor --- packages/bbui/src/Table/ArrayRenderer.svelte | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/bbui/src/Table/ArrayRenderer.svelte b/packages/bbui/src/Table/ArrayRenderer.svelte index 6c1df3b982..3755850666 100644 --- a/packages/bbui/src/Table/ArrayRenderer.svelte +++ b/packages/bbui/src/Table/ArrayRenderer.svelte @@ -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" - } {#each badges as badge}