sodesu-comment
Version:
Comment system with SolidJS
16 lines (12 loc) • 323 B
text/typescript
export const decodePath = (path: string): string => {
try {
path = decodeURI(path);
} catch {
// ignore error
}
return path;
};
export const removeEndingSplash = (content = ''): string =>
content.replace(/\/$/u, '');
export const isLinkHttp = (link: string): boolean =>
/^(https?:)?\/\//.test(link);