Skip to content

Commit

Permalink
chore: remove unnecessary type assertions (#8386)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Skyblue committed Jul 10, 2023
1 parent 13b7231 commit 3decc57
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/compiler-dom/src/decodeHtmlBrowser.ts
Expand Up @@ -8,9 +8,9 @@ export function decodeHtmlBrowser(raw: string, asAttr = false): string {
}
if (asAttr) {
decoder.innerHTML = `<div foo="${raw.replace(/"/g, '&quot;')}">`
return decoder.children[0].getAttribute('foo') as string
return decoder.children[0].getAttribute('foo')!
} else {
decoder.innerHTML = raw
return decoder.textContent as string
return decoder.textContent!
}
}
2 changes: 1 addition & 1 deletion packages/reactivity/src/ref.ts
Expand Up @@ -342,7 +342,7 @@ class ObjectRefImpl<T extends object, K extends keyof T> {

get value() {
const val = this._object[this._key]
return val === undefined ? (this._defaultValue as T[K]) : val
return val === undefined ? this._defaultValue! : val
}

set value(newVal) {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/renderer.ts
Expand Up @@ -584,7 +584,7 @@ function baseCreateRenderer(
slotScopeIds: string[] | null,
optimized: boolean
) => {
isSVG = isSVG || (n2.type as string) === 'svg'
isSVG = isSVG || n2.type === 'svg'
if (n1 == null) {
mountElement(
n2,
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/vnode.ts
Expand Up @@ -681,7 +681,7 @@ export function cloneVNode<T extends RendererNode, U extends RendererElement>(
if (__COMPAT__) {
defineLegacyVNodeProperties(cloned as VNode)
}
return cloned as any
return cloned
}

/**
Expand Down

0 comments on commit 3decc57

Please sign in to comment.