mattermost-mobile/app/utils/types.ts
Daniel Espino García f911a29e4c
Fix MM-61710 (#8368)
2024-11-27 16:18:08 +01:00

6 lines
311 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export function secureGetFromRecord<T>(v: Record<string, T> | undefined, key: string) {
return typeof v === 'object' && v && Object.prototype.hasOwnProperty.call(v, key) ? v[key] : undefined;
}