mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Add schema utils
This commit is contained in:
@@ -67,6 +67,7 @@ import {
|
||||
SIGNED_PRE_KEY_ID_KEY,
|
||||
} from './textsecure/AccountManager';
|
||||
import { formatGroups, groupWhile } from './util/groupWhile';
|
||||
import { parseUnknown } from './util/schemas';
|
||||
|
||||
const TIMESTAMP_THRESHOLD = 5 * 1000; // 5 seconds
|
||||
const LOW_KEYS_THRESHOLD = 25;
|
||||
@@ -99,7 +100,7 @@ const identityKeySchema = z.object({
|
||||
|
||||
function validateIdentityKey(attrs: unknown): attrs is IdentityKeyType {
|
||||
// We'll throw if this doesn't match
|
||||
identityKeySchema.parse(attrs);
|
||||
parseUnknown(identityKeySchema, attrs);
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user