From 8d38bf2be89d6abba0c2f660ead673cbf0962ef5 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 24 Nov 2018 11:26:58 -0500 Subject: [PATCH] remove unused helper --- src/utils/getStaticAttributeValue.ts | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 src/utils/getStaticAttributeValue.ts diff --git a/src/utils/getStaticAttributeValue.ts b/src/utils/getStaticAttributeValue.ts deleted file mode 100644 index 40ef4a1ec5..0000000000 --- a/src/utils/getStaticAttributeValue.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Node } from '../interfaces'; - -export default function getStaticAttributeValue(node: Node, name: string) { - const attribute = node.attributes.find( - (attr: Node) => attr.type === 'Attribute' && attr.name.toLowerCase() === name - ); - - if (!attribute) return null; - - if (attribute.value === true) return true; - if (attribute.value.length === 0) return ''; - - if (attribute.value.length === 1 && attribute.value[0].type === 'Text') { - return attribute.value[0].data; - } - - return null; -}