fix any in NetscriptPort

This commit is contained in:
Olivier Gagnon 2022-07-18 03:00:51 -04:00
parent 5c3ecb9a23
commit 610bcd6315

@ -11,10 +11,10 @@ export interface IPort {
} }
export function NetscriptPort(): IPort { export function NetscriptPort(): IPort {
const data: any[] = []; const data: unknown[] = [];
return { return {
write: (value: any): any => { write: (value: unknown): unknown => {
data.push(value); data.push(value);
if (data.length > Settings.MaxPortCapacity) { if (data.length > Settings.MaxPortCapacity) {
return data.shift(); return data.shift();
@ -22,7 +22,7 @@ export function NetscriptPort(): IPort {
return null; return null;
}, },
tryWrite: (value: any): boolean => { tryWrite: (value: unknown): boolean => {
if (data.length >= Settings.MaxPortCapacity) { if (data.length >= Settings.MaxPortCapacity) {
return false; return false;
} }
@ -30,14 +30,14 @@ export function NetscriptPort(): IPort {
return true; return true;
}, },
read: (): any => { read: (): unknown => {
if (data.length === 0) { if (data.length === 0) {
return "NULL PORT DATA"; return "NULL PORT DATA";
} }
return data.shift(); return data.shift();
}, },
peek: (): any => { peek: (): unknown => {
if (data.length === 0) { if (data.length === 0) {
return "NULL PORT DATA"; return "NULL PORT DATA";
} else { } else {