// 判断两个版本号的关系
/*
a > b 返回 >
a < b 返回 <
a = b 返回 =
*/
export const compareVersion = (a: string | number, b: string | number): '>' | '<' | '=' => {
    const aArr: string[] = String(a).split('.')
    const bArr: string[] = String(b).split('.')
    const max: number = Math.max(aArr.length, bArr.length)

    for (let i = 0; i < max; i++) {
        const ai: number = Number(aArr[i]) || 0
        const bi: number = Number(bArr[i]) || 0
        if (ai > bi) {
            return '>'
        } else if (ai < bi) {
            return '<'
        }
    }
    return '='
}