Merge branch 'dev' into next
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user