// 防抖
function debounce(fn, time) {
    let timer;
    return function (...args) {
        clearTimeout(timer);
        timer = setTimeout(() => {
            fn.apply(this, args);
            clearTimeout(timer);
        }, time);
    };
}
// 节流
function throttle(fn, time) {
    let inThrottle;
    return function (...args) {
        // const context = this;
        // const args = arguments;
        if (!inThrottle) {
            fn.apply(this, args);
            inThrottle = true;
            setTimeout(function () {
                inThrottle = false;
            }, time);
        }
    };
}
// 获取周几
import * as moment from 'moment';
function getWeek(date) {
    let week = moment.default(date).day();
    switch (week) {
        case 1:
            return '周一';
        case 2:
            return '周二';
        case 3:
            return '周三';
        case 4:
            return '周四';
        case 5:
            return '周五';
        case 6:
            return '周六';
        case 0:
            return '周日';
    }
}
function getTeamErrorLogo(team_logo) {
    if (team_logo) {
        return `this.src='${team_logo}';this.onerror=null`;
    }
    else {
        return "this.src='https://img2.ydniu.com/app/images/team_logo.png';this.onerror=null";
    }
}
export { debounce, throttle, getWeek, getTeamErrorLogo };
//# sourceMappingURL=index.js.map