Socket
Socket
Sign inDemoInstall

trumpet

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trumpet - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

test/multiclass.html

33

lib/select.js

@@ -138,15 +138,15 @@ var Stream = require('stream').Stream;

var m = {
name : s.match(/^([\w-]+|\*)/),
class : s.match(/\.([\w-]+)/),
id : s.match(/#([\w-]+)/),
pseudo : s.match(/:([\w-]+)/),
attribute : s.match(/\[([^\]]+)\]/),
name: s.match(/^([\w-]+|\*)/),
'class': s.match(/\.([\w-]+)/g),
id: s.match(/#([\w-]+)/),
pseudo: s.match(/:([\w-]+)/),
attribute: s.match(/\[([^\]]+)\]/),
};
return {
name : m.name && m.name[1].toUpperCase(),
class : m.class && m.class[1],
id : m.id && m.id[1],
pseudo : m.pseudo && m.pseudo[1],
attribute : m.attribute && m.attribute[1],
name: m.name && m.name[1].toUpperCase(),
'class': m['class'],
id: m.id && m.id[1],
pseudo: m.pseudo && m.pseudo[1],
attribute: m.attribute && m.attribute[1],
};

@@ -176,3 +176,5 @@ }).filter(Boolean);

if (p.name !== '*' && p.name && p.name !== t.name) return false;
if (p.class && p.class !== t.attributes.class) return false;
if (p['class'] && !checkClass(p['class'], t.attributes['class'])) {
return false;
}
if (p.id && p.id !== t.attributes.id) return false;

@@ -216,1 +218,10 @@ return true;

}
function checkClass (wanted, present) {
if (present === undefined) return false;
var classes = present.split(/\s+/);
return wanted.every(function (s) {
var w = s.replace(/^\./, '');
return classes.indexOf(w) >= 0;
});
}
{
"name" : "trumpet",
"version" : "0.3.1",
"version" : "0.3.2",
"description" : "parse and transform streaming html using css selectors",

@@ -5,0 +5,0 @@ "main" : "index.js",

Sorry, the diff of this file is not supported yet

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