use all values of ExractResult

This commit is contained in:
2018-09-27 16:40:05 +08:00
parent 33945e49ac
commit df809f6e60
2 changed files with 4 additions and 1 deletions

View File

@ -28,7 +28,7 @@ async function getData(itemsSelector, fieldSelectors, ...args) {
if (arg instanceof Array) { if (arg instanceof Array) {
urls = arg; urls = arg;
} else if (arg instanceof ExractResult) { } else if (arg instanceof ExractResult) {
urls = arg.column(0); urls = arg.squash().filter(v=>!!v);
} else { } else {
let urlTempl = arg; let urlTempl = arg;
if (urlTempl) { if (urlTempl) {

View File

@ -11,6 +11,9 @@ class ExractResult {
i => this._data[i][index] i => this._data[i][index]
); );
} }
squash() {
return this._data.reduce((p, c) => p.concat(c), []);
}
get data() { get data() {
return this._data; return this._data;
} }