Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minified JavaScript files sometimes not parsed correctly #1027

Open
3l73 opened this issue Apr 30, 2024 · 1 comment
Open

Minified JavaScript files sometimes not parsed correctly #1027

3l73 opened this issue Apr 30, 2024 · 1 comment

Comments

@3l73
Copy link

3l73 commented Apr 30, 2024

The parser for minified JavaScript files sometimes calculate the name of the package incorrectly.

This issue seems to occurred in two cases

  1. The format of the comment with the version does not match the expected pattern
  2. Next to the comment with the version, there are more comments, possible matching the pattern

The first case looks like this:

/*! <package>: <description> - updated mm/dd/yyyy (<version>) */

The second case looks like this:

(function(jQuery){

/*! <package>: <description> - updated mm/dd/yyyy (<version>) */
!function(e){ // come code

/*! Another comment */
// more code
});

Both cases leads to the behavior that

  • the extracted version contains more than the version, sometimes even JavaScript code
  • the package name could exceed 255 characters

Example for a version: ")}return e},type:"text"}

This issue is may be related to #723

@prabhu
Copy link
Contributor

prabhu commented Apr 30, 2024

@3l73 thank you for the report. Would appreciate it if you could contribute a PR with some fixes including filtering out problematic components with some warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants