Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

htmljs-parser

Package Overview
Dependencies
Maintainers
2
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmljs-parser - npm Package Compare versions

Comparing version 2.2.4 to 2.2.5

test/autotest-1.x/new-attr-prefix/expected.html

28

operators.js

@@ -18,3 +18,2 @@ var operators = exports.operators = [

'in',
'new',
// 'from', -- as in <import x from './file'/>

@@ -39,2 +38,8 @@ // 'typeof', -- would need to look behind, not ahead

var unary = [
'typeof',
'new',
'void'
];
// Look for longest operators first

@@ -45,11 +50,10 @@ operators.sort(function(a, b) {

var requiresWhitespace = exports.requiresWhitespace = {
'instanceof':true,
'in':true,
'typeof':true
};
exports.longest = operators.sort((a, b) => b.length-a.length)[0].length+1;
exports.patternNext = new RegExp('^\\s*('+operators.map(escapeOperator).join('|')+')\\s*(?!-)');
exports.patternPrev = new RegExp('[^-+](?:'+operators.concat(unary).map(escapeOperator).join('|')+')(\\s*)$');
var escapedOperators = operators.map(o => {
if(requiresWhitespace[o]) {
return '\\s'+escapeNonAlphaNumeric(o)+'\\s';
function escapeOperator(o) {
if(/^[A-Z]+$/i.test(o)) {
return '\\b'+escapeNonAlphaNumeric(o)+'\\b';
}

@@ -60,10 +64,6 @@ if(o === '/') {

return escapeNonAlphaNumeric(o);
});
}
exports.longest = operators.sort((a, b) => b.length-a.length)[0].length+1;
exports.patternNext = new RegExp('^\\s*('+escapedOperators.join('|')+')\\s*(?!-)');
exports.patternPrev = new RegExp('[^-+](?:'+escapedOperators.join('|')+')(\\s*)$');
function escapeNonAlphaNumeric(str) {
return str.replace(/([^\w\d])/g, '\\$1');
}

@@ -41,3 +41,3 @@ {

},
"version": "2.2.4"
"version": "2.2.5"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc