types: using unknown instead of any (#8152)

* types: using unknown instead of any

* chore: UnknownProp
This commit is contained in:
neverland
2021-02-14 12:37:02 +08:00
committed by GitHub
parent 393b2a256f
commit 08e928111b
23 changed files with 81 additions and 56 deletions
+5
View File
@@ -1,8 +1,13 @@
import { PropType } from 'vue';
// eslint-disable-next-line @typescript-eslint/no-empty-function
export function noop() {}
export const inBrowser = typeof window !== 'undefined';
// unknown type for Vue prop
export const UnknownProp = (null as unknown) as PropType<unknown>;
export function isDef<T>(val: T): val is NonNullable<T> {
return val !== undefined && val !== null;
}