use all values of ExractResult
This commit is contained in:
@ -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) {
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user