Amend shapeshifter to allow use of dynamic import

This commit is contained in:
DEBRIS APRON 2022-08-03 17:01:35 -07:00
parent 688a3d29fd
commit 130fb9c217
2 changed files with 20 additions and 2 deletions

View file

@ -11,4 +11,10 @@ describe('shapeshifter', () => {
it('Should shift simple double quote string', () => {
assert.equal(shapeshifter('"c3"'), '(async()=>{return mini("c3").withMiniLocation([1,0,15],[1,4,19])})()');
});
it('Should handle dynamic imports', () => {
assert.equal(
shapeshifter('const { default: foo } = await import(\'https://bar.com/foo.js\');"c3"'),
'(async()=>{const{default:foo}=await import("https://bar.com/foo.js");return mini("c3").withMiniLocation([1,64,79],[1,68,83])})()',
);
});
});