# 基础工具方法

function _typeOf(obj) {
    var val = Object.prototype.toString.call(obj);
    return val.match(/\[object (.*?)\]/)[1].toLowerCase()
}

1
2
3
4
5
import { parse } from 'querystring';

function getPageQuery(){ 
  return  parse(window.location.href.split('?')[1])
};
1
2
3
4
5
const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
function isUrl = (path: string): boolean => reg.test(path);
1
2
最后更新时间: 3/27/2023, 5:34:04 PM