html-select
Advanced tools
Comparing version 1.1.4 to 1.2.0
13
index.js
@@ -29,3 +29,3 @@ var inherits = require('inherits'); | ||
Writable.call(this, { objectMode: true }); | ||
this.cb = cb; | ||
this.selector = parseSelector(sel); | ||
@@ -35,2 +35,3 @@ this.stack = []; | ||
this.streams = []; | ||
if (cb) this.on('match', cb); | ||
} | ||
@@ -72,2 +73,3 @@ | ||
streams: [], | ||
tags: [], | ||
index: this.stack.length | ||
@@ -91,2 +93,3 @@ }; | ||
var t = this._fromTag(tag); | ||
row.tags.push(t); | ||
t.on('stream', function (s) { | ||
@@ -98,3 +101,3 @@ s._row = row; | ||
this.cb(t); | ||
this.emit('match', t); | ||
break; | ||
@@ -111,2 +114,3 @@ } | ||
var t = this._fromTag(tag); | ||
row.tags.push(t); | ||
t.on('stream', function (s) { | ||
@@ -117,3 +121,3 @@ s._row = row; | ||
}); | ||
this.cb(t); | ||
this.emit('match', t); | ||
} | ||
@@ -143,2 +147,5 @@ else { | ||
} | ||
for (var i = 0; i < s.tags.length; i++) { | ||
s.tags[i]._close(); | ||
} | ||
}; | ||
@@ -145,0 +152,0 @@ |
@@ -13,2 +13,6 @@ var inherits = require('inherits'); | ||
Tag.prototype._close = function () { | ||
this.emit('close'); | ||
}; | ||
Tag.prototype.createReadStream = function (opts) { | ||
@@ -15,0 +19,0 @@ var r = new Readable; |
{ | ||
"name": "html-select", | ||
"version": "1.1.4", | ||
"version": "1.2.0", | ||
"description": "match a tokenized html stream with css selectors", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
49815
26
851
168