chore: add some notes

This commit is contained in:
vben
2020-11-18 22:41:59 +08:00
parent 815250ed34
commit 46e0875374
87 changed files with 926 additions and 728 deletions

View File

@@ -50,10 +50,6 @@ export function isArray(val: unknown): val is Array<any> {
return val && Array.isArray(val);
}
export const isClient = () => {
return typeof window !== 'undefined';
};
export const isWindow = (val: any): val is Window => {
return typeof window !== 'undefined' && is(val, 'Window');
};
@@ -64,6 +60,8 @@ export const isElement = (val: unknown): val is Element => {
export const isServer = typeof window === 'undefined';
export const isClient = typeof window !== 'undefined';
export function isImageDom(o: Element) {
return o && ['IMAGE', 'IMG'].includes(o.tagName);
}