mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Update NetscriptFunctions.ts
Undid removal of writePort data validation
This commit is contained in:
parent
7c846abb65
commit
90ca9407d5
@ -1758,6 +1758,12 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
return res;
|
||||
},
|
||||
writePort: function (port: any, data: any = ""): any {
|
||||
if (typeof data !== "string" && typeof data !== "number") {
|
||||
throw makeRuntimeErrorMsg(
|
||||
"writePort",
|
||||
`Trying to write invalid data to a port: only strings and numbers are valid.`,
|
||||
);
|
||||
}
|
||||
const iport = helper.getValidPort("writePort", port);
|
||||
return Promise.resolve(iport.write(data));
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user