module-from-string
Advanced tools
Comparing version 2.2.2 to 2.3.0
@@ -18,3 +18,3 @@ import path from 'path' | ||
const res = await importFromString( | ||
`import { default as greet } from '${modulePath}'\nexport { greet }` | ||
`export { default as greet } from '${modulePath}'` | ||
) | ||
@@ -60,3 +60,3 @@ expect(res.greet).toBe('hi') | ||
const res = importFromStringSync( | ||
`import { default as greet } from '${modulePath}'\nexport { greet }` | ||
`export { default as greet } from '${modulePath}'` | ||
) | ||
@@ -63,0 +63,0 @@ expect(res.greet).toBe('hi') |
@@ -54,4 +54,4 @@ import path from 'path' | ||
err.stack.search(/module-from-string\/__tests__\/require\.test\.ts:50:5/) | ||
).toBeGreaterThan(-1) | ||
).toBeGreaterThan(0) | ||
} | ||
}) |
@@ -13,3 +13,3 @@ import { Module } from 'module'; | ||
const contextModule = new Module(nanoid()); | ||
runInNewContext(code, Object.assign({ exports: contextModule.exports, module: contextModule, require }, globals)); | ||
runInNewContext(code, Object.assign({ exports: contextModule.exports, module: contextModule, require }, globals), { microtaskMode: 'afterEvaluate' }); | ||
return contextModule.exports; | ||
@@ -16,0 +16,0 @@ }; |
@@ -17,3 +17,3 @@ 'use strict'; | ||
const contextModule = new module$1.Module(nanoid.nanoid()); | ||
vm.runInNewContext(code, Object.assign({ exports: contextModule.exports, module: contextModule, require }, globals)); | ||
vm.runInNewContext(code, Object.assign({ exports: contextModule.exports, module: contextModule, require }, globals), { microtaskMode: 'afterEvaluate' }); | ||
return contextModule.exports; | ||
@@ -20,0 +20,0 @@ }; |
{ | ||
"name": "module-from-string", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"description": "Load module from string, require and import.", | ||
@@ -41,17 +41,17 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"esbuild": "0.10.2", | ||
"nanoid": "3.1.22" | ||
"esbuild": "0.12.15", | ||
"nanoid": "3.1.23" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-typescript": "8.2.1", | ||
"@types/jest": "26.0.22", | ||
"@types/node": "14.14.37", | ||
"jest": "26.6.3", | ||
"rollup": "2.43.0", | ||
"rollup-plugin-dts": "3.0.1", | ||
"ts-jest": "26.5.4", | ||
"ts-standardx": "0.7.4", | ||
"tslib": "2.1.0", | ||
"typescript": "4.2.3" | ||
"@types/jest": "26.0.24", | ||
"@types/node": "16.0.1", | ||
"jest": "27.0.6", | ||
"rollup": "2.52.8", | ||
"rollup-plugin-dts": "3.0.2", | ||
"ts-jest": "27.0.3", | ||
"ts-standardx": "0.7.6", | ||
"tslib": "2.3.0", | ||
"typescript": "4.3.5" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16328
+ Addedesbuild@0.12.15(transitive)
+ Addednanoid@3.1.23(transitive)
- Removedesbuild@0.10.2(transitive)
- Removednanoid@3.1.22(transitive)
Updatedesbuild@0.12.15
Updatednanoid@3.1.23