License detector for UglifyJS that identifies and preserves license comments during minification
Overall
score
98%
A tool that automatically detects and identifies license-related comments in JavaScript source code without requiring any configuration.
Build a comment analysis function that examines JavaScript comments and determines whether they contain license-related information. The function should work without any configuration or setup from the user.
@generates
/**
* Determines whether a comment should be preserved based on license-related heuristics.
* Works automatically without requiring any configuration.
*
* @param {Object} node - AST node from the parser
* @param {Object} comment - Comment information object
* @param {string} comment.file - Current file path being processed
* @param {string} comment.type - Comment type ('comment1' for line comment, 'comment2' for block comment)
* @param {string} comment.value - The text content of the comment
* @param {number} comment.line - Line number where the comment appears
* @returns {boolean} true if the comment should be preserved, false otherwise
*/
function shouldPreserveComment(node, comment) {
// IMPLEMENTATION HERE
}
module.exports = shouldPreserveComment;Provides automatic license comment detection and preservation logic for use with minification tools.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-uglify-save-licensedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10