Skip to content

Commit 3decc57

Browse files
chore: remove unnecessary type assertions (#8386)
1 parent 13b7231 commit 3decc57

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

packages/compiler-dom/src/decodeHtmlBrowser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export function decodeHtmlBrowser(raw: string, asAttr = false): string {
88
}
99
if (asAttr) {
1010
decoder.innerHTML = `<div foo="${raw.replace(/"/g, '&quot;')}">`
11-
return decoder.children[0].getAttribute('foo') as string
11+
return decoder.children[0].getAttribute('foo')!
1212
} else {
1313
decoder.innerHTML = raw
14-
return decoder.textContent as string
14+
return decoder.textContent!
1515
}
1616
}

packages/reactivity/src/ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
342342

343343
get value() {
344344
const val = this._object[this._key]
345-
return val === undefined ? (this._defaultValue as T[K]) : val
345+
return val === undefined ? this._defaultValue! : val
346346
}
347347

348348
set value(newVal) {

packages/runtime-core/src/renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ function baseCreateRenderer(
584584
slotScopeIds: string[] | null,
585585
optimized: boolean
586586
) => {
587-
isSVG = isSVG || (n2.type as string) === 'svg'
587+
isSVG = isSVG || n2.type === 'svg'
588588
if (n1 == null) {
589589
mountElement(
590590
n2,

packages/runtime-core/src/vnode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ export function cloneVNode<T extends RendererNode, U extends RendererElement>(
681681
if (__COMPAT__) {
682682
defineLegacyVNodeProperties(cloned as VNode)
683683
}
684-
return cloned as any
684+
return cloned
685685
}
686686

687687
/**

0 commit comments

Comments
 (0)