Skip to content

Commit

Permalink
chore: add deprecation warnings for legacy runASTAnalysis and `runA…
Browse files Browse the repository at this point in the history
…STAnalysisOnFile`. (#276)

These warnings are added to inform users that these APIs will be removed in v8 and encourage them to use `AstAnalyser` instead.

Fixes #266
  • Loading branch information
fless-lab authored Jun 25, 2024
1 parent a3af86a commit 0612155
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ function runASTAnalysis(
str,
options = Object.create(null)
) {
process.emitWarning(
'The runASTAnalysis API is deprecated and will be removed in v8. Please use the AstAnalyser class instead.',
{
code: 'DeprecationWarning',
detail: 'The runASTAnalysis API is deprecated and will be removed in v8. Please use the AstAnalyser class instead.'
}
);

const {
customParser = new JsSourceParser(),
customProbes = [],
Expand All @@ -28,6 +36,14 @@ async function runASTAnalysisOnFile(
pathToFile,
options = {}
) {
process.emitWarning(
'The runASTAnalysisOnFile API is deprecated and will be removed in v8. Please use the AstAnalyser class instead.',
{
code: 'DeprecationWarning',
detail: 'The runASTAnalysisOnFile API is deprecated and will be removed in v8. Please use the AstAnalyser class instead.'
}
);

const {
customProbes = [],
customParser = new JsSourceParser(),
Expand Down

0 comments on commit 0612155

Please sign in to comment.