Skip to content

Commit 5bef635

Browse files
author
EC2 Default User
committed
Remove contains from utils
1 parent d391c80 commit 5bef635

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/ddp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import EventEmitter from 'wolfy87-eventemitter';
66
import Queue from './queue';
77
import Socket from './socket';
8-
import { contains, uniqueId } from './utils';
8+
import { uniqueId } from './utils';
99

1010
const DDP_VERSION = '1';
1111
const PUBLIC_EVENTS = [
@@ -79,7 +79,7 @@ export default class DDP extends EventEmitter {
7979
// Reply with a `pong` message to prevent the server from
8080
// closing the connection
8181
this.socket.send({ msg: 'pong', id: message.id });
82-
} else if (contains(PUBLIC_EVENTS, message.msg)) {
82+
} else if (PUBLIC_EVENTS.includes(message.msg)) {
8383
this.emit(message.msg, message);
8484
}
8585
});

lib/utils.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ export function uniqueId() {
66
return (i++).toString();
77
}
88

9-
export function contains(array, element) {
10-
return array.indexOf(element) !== -1;
11-
}
12-
139
export function hashPassword(password) {
1410
return {
1511
digest: SHA256(password).toString(),

0 commit comments

Comments
 (0)