shieldStatusForRoom: avoid deprecated MatrixClient methods (#10944)
Update this method to use modern crypto methods
This commit is contained in:
parent
606eaa5274
commit
cc842aac8a
3 changed files with 22 additions and 6 deletions
|
@ -319,7 +319,7 @@ export const concat = (...arrays: Uint8Array[]): Uint8Array => {
|
|||
/**
|
||||
* Async version of Array.every.
|
||||
*/
|
||||
export async function asyncEvery<T>(values: T[], predicate: (value: T) => Promise<boolean>): Promise<boolean> {
|
||||
export async function asyncEvery<T>(values: Iterable<T>, predicate: (value: T) => Promise<boolean>): Promise<boolean> {
|
||||
for (const value of values) {
|
||||
if (!(await predicate(value))) return false;
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ export async function asyncEvery<T>(values: T[], predicate: (value: T) => Promis
|
|||
/**
|
||||
* Async version of Array.some.
|
||||
*/
|
||||
export async function asyncSome<T>(values: T[], predicate: (value: T) => Promise<boolean>): Promise<boolean> {
|
||||
export async function asyncSome<T>(values: Iterable<T>, predicate: (value: T) => Promise<boolean>): Promise<boolean> {
|
||||
for (const value of values) {
|
||||
if (await predicate(value)) return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue