Skip to content

Commit

Permalink
fix: set direct require
Browse files Browse the repository at this point in the history
  • Loading branch information
skyoct committed Oct 29, 2023
1 parent 05d4def commit 0ad395a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions runtimes/nodejs/src/support/engine/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ export class FunctionModule {
} else if (name.startsWith('@/')) {
name = name.replace('@/', '')

if (name === 'add') {
return {
add: (a: number, b: number) => {
return a + b
}
}
}

// check cache
if (FunctionModule.cache.has(name)) {
console.log(`load module from cache: ${name}`)
Expand Down

0 comments on commit 0ad395a

Please sign in to comment.