Skip to content

Commit 876d2c0

Browse files
committed
fix: removed redundant prtotype, HTMLElement can handle all elements
1 parent 93a9d0e commit 876d2c0

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

src/getValue.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,9 @@ HTMLElement.prototype.getValue = function () {
77
return value;
88
};
99

10-
HTMLInputElement.prototype.getValue = function () {
11-
let value = getValue(this);
12-
return value;
13-
};
14-
15-
HTMLHeadingElement.prototype.getValue = function () {
16-
let value = getValue(this);
17-
return value;
18-
};
19-
2010
// TODO: check if using a a switch case will provide better performance
11+
// return blobs for element.src and for link.href
12+
// pass value type as a param
2113
const getValue = (element) => {
2214
let value = element.value || element.getAttribute("value") || "";
2315
if (

src/setValue.js

-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ HTMLElement.prototype.setValue = function (value, dispatch) {
44
setValue(this, value, dispatch);
55
};
66

7-
HTMLInputElement.prototype.setValue = function (value, dispatch) {
8-
setValue(this, value, dispatch);
9-
};
10-
11-
HTMLHeadingElement.prototype.setValue = function (value, dispatch) {
12-
setValue(this, value, dispatch);
13-
};
14-
157
// TODO: check if using a a switch case will provide better performance
168
const setValue = (el, value, dispatch) => {
179
let bubbles = el.hasAttribute("value-bubbles");

0 commit comments

Comments
 (0)