Skip to content

Commit fc0be9c

Browse files
committed
fix staging
1 parent 9e6a2f8 commit fc0be9c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

packages/engine/src/executor.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async function resolveDependencyArray(
1010
context: TypeCellContext<any>,
1111
resolveImport: (module: string) => any,
1212
exports: any,
13-
userDisposes: Array<() => void>
13+
userDisposes: Array<() => void>,
1414
) {
1515
return await Promise.all(
1616
dependencyArray.map((arg) => {
@@ -22,7 +22,7 @@ async function resolveDependencyArray(
2222
return resolveImport(
2323
// cell,
2424
// eslint-disable-next-line prefer-rest-params
25-
arguments[0][0]
25+
arguments[0][0],
2626
// eslint-disable-next-line prefer-rest-params
2727
).then(arguments[1], arguments[2]);
2828
};
@@ -49,7 +49,7 @@ async function resolveDependencyArray(
4949
};
5050
}
5151
return resolveImport(arg);
52-
})
52+
}),
5353
);
5454
}
5555

@@ -66,7 +66,7 @@ export async function runModule(
6666
beforeExecuting: () => void,
6767
onExecuted: (exports: any) => void,
6868
onError: (error: any) => void,
69-
previousVariableDisposer?: (newExportsToKeep: any) => void
69+
previousVariableDisposer?: (newExportsToKeep: any) => void,
7070
): Promise<ModuleExecution> {
7171
let cleanVariablesFromContext: Array<(newExports: any) => void> = [];
7272
let disposeEveryRun: Array<() => void> = [];
@@ -77,7 +77,7 @@ export async function runModule(
7777
context,
7878
resolveImport,
7979
exports,
80-
disposeEveryRun
80+
disposeEveryRun,
8181
);
8282

8383
let initialRun = true;
@@ -92,9 +92,12 @@ export async function runModule(
9292
let detectedLoop = false;
9393

9494
const hostname = window.location.hostname.toLowerCase();
95-
if (hostname.includes("typecell.org") || hostname.includes("typecell.com")) {
95+
if (
96+
hostname.includes("www.typecell.org") ||
97+
hostname.includes("www.typecell.com")
98+
) {
9699
throw new Error(
97-
"failed security check, executor can not be running on these domains"
100+
"failed security check, executor can not be running on these domains",
98101
);
99102
}
100103

@@ -122,7 +125,7 @@ export async function runModule(
122125
try {
123126
executionPromise = mod.factoryFunction.apply(
124127
undefined,
125-
argsToCallFunctionWith
128+
argsToCallFunctionWith,
126129
); // TODO: what happens with disposers if a rerun of this function is slow / delayed?
127130
} finally {
128131
// Hooks are only installed for sync code. Ideally, we'd want to run it for all code, but then we have the chance hooks will affect other parts of the TypeCell (non-user) code
@@ -199,7 +202,7 @@ export async function runModule(
199202

200203
if (detectedLoop) {
201204
throw new Error(
202-
"loop detected (parent run). Are you referencing an exported variable with $ in the same cell?"
205+
"loop detected (parent run). Are you referencing an exported variable with $ in the same cell?",
203206
);
204207
}
205208
onExecuted(exports);

0 commit comments

Comments
 (0)