1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-06 12:02:40 +03:00

Lint pass 1

This commit is contained in:
Travis Ralston
2021-06-01 21:03:17 -06:00
parent a1a6ec6dfa
commit 5c55dce13e
6 changed files with 31 additions and 22 deletions

View File

@@ -15,7 +15,7 @@ limitations under the License.
*/
import { MatrixClient } from "./client";
import {MatrixEvent} from "./models/event";
import { MatrixEvent } from "./models/event";
export type EventMapper = (obj: any) => MatrixEvent;
@@ -27,6 +27,7 @@ export interface MapperOpts {
export function eventMapperFor(client: MatrixClient, options: MapperOpts): EventMapper {
const preventReEmit = Boolean(options.preventReEmit);
const decrypt = options.decrypt !== false;
function mapper(plainOldJsObject) {
const event = new MatrixEvent(plainOldJsObject);
if (event.isEncrypted()) {
@@ -44,5 +45,6 @@ export function eventMapperFor(client: MatrixClient, options: MapperOpts): Event
}
return event;
}
return mapper;
}