fix(utils): add type remove the ts error (#3406)

* fix(utils): add type remove the ts error

* fix: optional chaining operator replace non-nullish assertion

* chore: try again test
This commit is contained in:
btea 2021-09-15 08:30:30 +08:00 committed by GitHub
parent a3f01b0f23
commit 9d142ae129
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -22,7 +22,7 @@ export default function (): number {
outer.appendChild(inner)
const widthWithScroll = inner.offsetWidth
outer.parentNode.removeChild(outer)
outer.parentNode?.removeChild(outer)
scrollBarWidth = widthNoScroll - widthWithScroll
return scrollBarWidth

View File

@ -111,9 +111,10 @@ export const getNormalizedProps = (node: VNode) => {
debugWarn(SCOPE, 'value must be a VNode')
return
}
const raw = node.props || {}
const type = (node.type as any).props || {}
const props = {}
const props = {} as any
Object.keys(type).forEach((key) => {
if (hasOwn(type[key], 'default')) {