hagana
hagana copied to clipboard
Non-default export child_process bug
I believe that there is a bug where functions that get extracted from the exports
and not from the default export
object don't get wrapped by Hagana.
e.g: This works:
import { execSync } from 'child_process';
export function run () {
const result = execSync('node -v').toString();
console.log('RESULT=', result);
}
This doesn't:
import childProcess from 'child_process';
export function run () {
const result = childProcess.execSync('node -v').toString();
console.log('RESULT=', result);
}
I'll take a look at this. It should work
Interesting, I tested for a similar case where I checked if:
const {execSync} = require("child_process")
bypasses the protection (it doesn't), but seems that using import bypasses the protection.
This is weird, it's only happening to me occasionally. Do you mind upload a repo with your project structure?