import slash from "slash2";
export var isLink = function() {
    var url = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : '';
    return /^[a-zA-Z]+:(\/\/)?/i.test(url);
};
export var parsePath = function(path) {
    var m = path.match(/#([^\n]*)/);
    if (m) {
        var hashPart = m[0];
        var hashValue = m[1] || '';
        // 只保留换行符前的路径部分
        var pathWithoutHash = path.replace(hashPart, '').split('\n')[0];
        return {
            path: pathWithoutHash,
            hash: hashValue
        };
    }
    return {
        path: path,
        hash: null
    };
};
export var toUnixPath = function(path) {
    return slash(path);
};
