mattermost-mobile/app/utils/types.ts
Mattermost Build 68aa016921
Fix MM-61710 (#8368) (#8382)
(cherry picked from commit f911a29e4c)

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2024-11-28 08:52:28 +02: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;
}