1
- const { DeviceLists, RequestType, KeysUploadRequest, KeysQueryRequest } = require ( "@matrix-org/matrix-sdk-crypto-wasm" ) ;
1
+ /*
2
+ Copyright 2022-2025 The Matrix.org Foundation C.I.C.
2
3
3
- function * zip ( ...arrays ) {
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ import { DeviceLists , RequestType , KeysUploadRequest , KeysQueryRequest } from "@matrix-org/matrix-sdk-crypto-wasm" ;
18
+
19
+ export function * zip ( ...arrays ) {
4
20
const len = Math . min ( ...arrays . map ( ( array ) => array . length ) ) ;
5
21
6
22
for ( let nth = 0 ; nth < len ; ++ nth ) {
@@ -10,7 +26,7 @@ function* zip(...arrays) {
10
26
11
27
// Add a machine to another machine, i.e. be sure a machine knows
12
28
// another exists.
13
- async function addMachineToMachine ( machineToAdd , machine ) {
29
+ export async function addMachineToMachine ( machineToAdd : OlmMachine , machine : OlmMachine ) : Promise < void > {
14
30
const toDeviceEvents = JSON . stringify ( [ ] ) ;
15
31
const changedDevices = new DeviceLists ( ) ;
16
32
const oneTimeKeyCounts = new Map ( ) ;
@@ -88,8 +104,3 @@ async function addMachineToMachine(machineToAdd, machine) {
88
104
expect ( marked ) . toStrictEqual ( true ) ;
89
105
}
90
106
}
91
-
92
- module . exports = {
93
- zip,
94
- addMachineToMachine,
95
- } ;
0 commit comments