import cavar_type from "../cavar_type";
/**
* 功能:判断是否是一个外部链接
* @param {string} path - url链接
* @returns {boolean} - true为是外部链接,false为内部链接
*/
function isExternal(path) {
if (cavar_type(path) === "string") {
return /^(https?:|mailto:|tel:)/.test(path);
}
console.error(new Error("isExternal: path is not String"));
}
export default isExternal;