pankod/superplate

View on GitHub
src/Helper/url/index.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { isUri } from "valid-url";

export const UrlHelper = {
    IsUrl: (path: string): boolean => {
        return !!isUri(path);
    },
    GetGitUrl: (path: string): string => {
        if (path.slice(-4) === ".git") return path;
        return path + ".git";
    },
};