diff --git a/src/Netscript/APIWrapper.ts b/src/Netscript/APIWrapper.ts index c70b09c6f..428550a89 100644 --- a/src/Netscript/APIWrapper.ts +++ b/src/Netscript/APIWrapper.ts @@ -65,17 +65,18 @@ function wrapFunction( }); } -export function wrapAPI( - workerScript: WorkerScript, - namespace: object, - args: ScriptArg[] -): NSFull { - const wrappedAPI = wrapAPILayer({},workerScript,namespace); - wrappedAPI.args=args; +export function wrapAPI(workerScript: WorkerScript, namespace: object, args: ScriptArg[]): NSFull { + const wrappedAPI = wrapAPILayer({}, workerScript, namespace); + wrappedAPI.args = args; return wrappedAPI as unknown as NSFull; } -export function wrapAPILayer(wrappedAPI:ExternalAPI,workerScript:WorkerScript,namespace:object,...tree:string[]){ +export function wrapAPILayer( + wrappedAPI: ExternalAPI, + workerScript: WorkerScript, + namespace: object, + ...tree: string[] +) { for (const [key, value] of Object.entries(namespace)) { if (typeof value === "function") { wrapFunction(wrappedAPI, workerScript, value, ...tree, key);