The goal of the task is to be able to provide a custom SourceParser to the runASTAnalysis function (if not provided it will take the default JsSourceParser for example).
The idea behind that is to allow anyone to extend/add a new Parsing mechanism (to support TypeScript source for example).
The goal of the task is to be able to provide a custom SourceParser to the runASTAnalysis function (if not provided it will take the default JsSourceParser for example).
The idea behind that is to allow anyone to extend/add a new Parsing mechanism (to support TypeScript source for example).
In my mind I see two build-in class:
https://github.com/NodeSecure/js-x-ray/blob/d26eafcf92d8da424bdf7cfdcbc590045d8527ee/src/SourceParser.js#L18-L36
https://github.com/NodeSecure/js-x-ray/blob/master/src/SourceParser.js#L50
If someone want to re-implement his own, it would look like this;