Skip to content

Commit b4c4bca

Browse files
⚡ Update types
1 parent 6308668 commit b4c4bca

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/class/HTMLCodeBlockElement.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@ export default class HTMLCodeBlockElement extends HTMLElement {
126126
return this.#value;
127127
}
128128

129-
set value(src: string) {
130-
if (/\n$/.test(src)) {
131-
this.#value = `${src}\n`;
129+
set value(src: any) {
130+
const _src = String(src);
131+
132+
if (/\n$/.test(_src)) {
133+
this.#value = `${_src}\n`;
132134
} else {
133-
this.#value = src;
135+
this.#value = _src;
134136
}
135137

136138
this.#render();
@@ -144,7 +146,7 @@ export default class HTMLCodeBlockElement extends HTMLElement {
144146
return this.#label;
145147
}
146148

147-
set label(value: string) {
149+
set label(value: any) {
148150
if (value === null) {
149151
this.#label = '';
150152
this.removeAttribute('label');

0 commit comments

Comments
 (0)