mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-18 23:49:20 +01:00
Use protopiler for protocol buffers
Co-authored-by: Jamie Kyle <jamie@signal.org>
This commit is contained in:
9
ts/util/isKnownProtoEnumMember.std.ts
Normal file
9
ts/util/isKnownProtoEnumMember.std.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Copyright 2026 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export function isKnownProtoEnumMember<E extends number>(
|
||||
enum_: Record<string | `${E}`, E | string>,
|
||||
value: unknown
|
||||
): value is E {
|
||||
return typeof value === 'number' && Object.hasOwn(enum_, value);
|
||||
}
|
||||
Reference in New Issue
Block a user