chore(lazyload): remove some legecy code (#8650)

This commit is contained in:
neverland
2021-05-02 11:49:32 +08:00
committed by GitHub
parent 819018ef68
commit 721ecb6e76
4 changed files with 4 additions and 36 deletions
-22
View File
@@ -57,17 +57,6 @@ function remove(arr, item) {
if (index > -1) return arr.splice(index, 1);
}
function some(arr, fn) {
let has = false;
for (let i = 0, len = arr.length; i < len; i++) {
if (fn(arr[i])) {
has = true;
break;
}
}
return has;
}
function getBestSelectionFromSrcset(el, scale) {
if (el.tagName !== 'IMG' || !el.getAttribute('data-srcset')) return;
@@ -290,15 +279,6 @@ function isObject(obj) {
return obj !== null && typeof obj === 'object';
}
function ArrayFrom(arrLike) {
const len = arrLike.length;
const list = [];
for (let i = 0; i < len; i++) {
list.push(arrLike[i]);
}
return list;
}
function noop() {}
class ImageCache {
@@ -331,10 +311,8 @@ export {
inBrowser,
CustomEvent,
remove,
some,
find,
noop,
ArrayFrom,
_,
isObject,
throttle,