This commit is contained in:
TheMas3212
2022-04-08 10:02:59 +10:00
parent 9b53896732
commit b2e7817a0b
2 changed files with 86 additions and 86 deletions

View File

@@ -11,7 +11,7 @@ type ExternalAPI = {
};
type InternalFunction<F extends (...args: unknown[]) => unknown> = (
ctx: NetscriptContext
ctx: NetscriptContext,
) => (...args: unknown[]) => ReturnType<F>;
export type InternalAPI<API> = {
[Property in keyof API]: API[Property] extends ExternalFunction
@@ -65,7 +65,7 @@ function wrapFunction(
func: (_ctx: NetscriptContext) => (...args: unknown[]) => unknown,
...tree: string[]
): void {
const functionPath = tree.join('.');
const functionPath = tree.join(".");
const functionName = tree.pop();
if (typeof functionName !== "string") {
throw makeRuntimeRejectMsg(workerScript, "Failure occured while wrapping netscript api");
@@ -99,7 +99,7 @@ function wrapFunction(
Object.defineProperty(parent, functionName, {
value: wrappedFunction,
writable: true,
enumerable: true
enumerable: true,
});
}