Change property checks to TypeScript 3.9

This commit is contained in:
Kirk Scheibelhut 2020-05-12 20:11:56 -07:00
parent 4f8c515fb6
commit 6e2b475dac
2 changed files with 6 additions and 6 deletions

View File

@ -760,11 +760,11 @@ export function stdout() {
export function stdpipe(stream: WriteStream | ReadStream | ReadWriteStream) {
const promises = [];
if ((stream as ReadStream).pipeTo) {
promises.push((stream as ReadStream).pipeTo(stdout()));
if ('pipeTo' in stream) {
promises.push(stream.pipeTo(stdout()));
}
if ((stream as WriteStream | ReadStream & {write: undefined}).write) {
promises.push(stdin().pipeTo(stream as WriteStream));
if ('write' in stream) {
promises.push(stdin().pipeTo(stream));
}
return Promise.all(promises);
}

View File

@ -71,8 +71,8 @@ export const commands: ChatCommands = {
if (room.modchat && room.modchat.length <= 1 && Config.groupsranking.indexOf(room.modchat as GroupSymbol) > threshold) {
return this.errorReply(`/modchat - Access denied for changing a setting higher than ${Config.groupsranking[threshold]}.`);
}
if ((room as GameRoom).requestModchat) {
const error = (room as GameRoom).requestModchat(user);
if ('requestModchat' in room) {
const error = room.requestModchat(user);
if (error) return this.errorReply(error);
}