Merge branch 'dev' into next

This commit is contained in:
chenjiahan
2020-09-07 20:41:50 +08:00
8 changed files with 20 additions and 22 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ export function noop() {}
export const inBrowser = typeof window !== 'undefined';
export function isDef(val: unknown): boolean {
export function isDef<T>(val: T): val is NonNullable<T> {
return val !== undefined && val !== null;
}
@@ -28,7 +28,7 @@ export function get(object: any, path: string): any {
let result = object;
keys.forEach((key) => {
result = isDef(result[key]) ? result[key] : '';
result = result[key] ?? '';
});
return result;