mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Change property checks to TypeScript 3.9
This commit is contained in:
parent
4f8c515fb6
commit
6e2b475dac
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user