Skip to content

Commit 3e28d90

Browse files
committed
Undo regex
1 parent 8041b00 commit 3e28d90

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/engine/src/modules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function createExecutionScope(context: TypeCellContext<any>) {
8888

8989
export function getModulesFromTypeCellCode(compiledCode: string, scope: any) {
9090
// Checks if define([], function) like code is already present
91-
if (!compiledCode.match(/^\s+(define\((".*", )?\[.*\], )function/gm)) {
91+
if (!compiledCode.match(/(define\((".*", )?\[.*\], )function/gm)) {
9292
// file is not a module (no exports). Create module-like code manually
9393
compiledCode = `define([], function() { ${compiledCode}; });`;
9494
}

packages/engine/src/tests/utils/helpers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,5 @@ export function toAMDFormat(code: string) {
4545
}
4646

4747
export function buildMockedModel(name: string, code: string) {
48-
const umdFormat = toAMDFormat(code);
49-
return new CodeModelMock("javascript", name, umdFormat);
48+
return new CodeModelMock("javascript", name, toAMDFormat(code));
5049
}

0 commit comments

Comments
 (0)