From 356ba76394df4491af67698cc167b7f2e859d6a3 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Wed, 15 Mar 2023 17:50:05 +0100 Subject: [PATCH] remove unnecessary test/exposure of function --- src/compiler/compile/utils/__test__.ts | 16 ---------------- src/compiler/compile/utils/contenteditable.ts | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/compiler/compile/utils/__test__.ts b/src/compiler/compile/utils/__test__.ts index 1340a52aab..caca048581 100644 --- a/src/compiler/compile/utils/__test__.ts +++ b/src/compiler/compile/utils/__test__.ts @@ -2,7 +2,6 @@ import * as assert from 'assert'; import get_name_from_filename from './get_name_from_filename'; import { is_contenteditable, - is_input_or_textarea, is_attr_contenteditable, has_contenteditable_attr, is_name_contenteditable, @@ -54,21 +53,6 @@ describe('contenteditable', () => { }); }); - describe('is_input_or_textarea', () => { - it('returns true if node is input', () => { - const node = { name: 'input' } as Element; - assert.equal(is_input_or_textarea(node), true); - }); - it('returns true if node is textarea', () => { - const node = { name: 'textarea' } as Element; - assert.equal(is_input_or_textarea(node), true); - }); - it('returns false if node is not input or textarea', () => { - const node = { name: 'div' } as Element; - assert.equal(is_input_or_textarea(node), false); - }); - }); - describe('is_attr_contenteditable', () => { it('returns true if attribute is contenteditable', () => { const attr = { name: 'contenteditable' } as Attribute; diff --git a/src/compiler/compile/utils/contenteditable.ts b/src/compiler/compile/utils/contenteditable.ts index 7a8b2b806b..337d53b3fb 100644 --- a/src/compiler/compile/utils/contenteditable.ts +++ b/src/compiler/compile/utils/contenteditable.ts @@ -12,7 +12,7 @@ export const CONTENTEDITABLE_BINDINGS = [ * Returns true if node is an 'input' or 'textarea'. * @param {Element} node The element to be checked */ -export function is_input_or_textarea(node: Element): boolean { +function is_input_or_textarea(node: Element): boolean { return node.name === 'textarea' || node.name === 'input'; }