/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
    return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} email
 * @returns {Boolean}
 */
export function validEmail(email) {
    return /^([a-zA-Z0-9])(\w|\-|\.)+@([a-zA-Z0-9]+[-.])+([a-zA-Z]{2,4})$/.test(email)
}

/**
 * @param {string} mobile
 * @returns {Boolean}
 */
export function validMobile(mobile) {
    return /^1[3456789]\d{9}$/.test(mobile)
}

/**
 * @param {string} code
 * @returns {Boolean}
 */
export function validCode(code) {
    return /^[0-9]{6}$/.test(code)
}

/**
 * @param {string} name
 * @returns {Boolean}
 */
export function validName(name) {
    return !/[\@]|\s/g.test(name)
}

/**
 * @param {string} pwd
 * @returns {Boolean}
 */
export function validPwd(pwd) {
    return /^[\w]{6,18}$/.test(pwd)
}