@waline/client
Version:
client for waline comment system
16 lines (12 loc) • 329 B
text/typescript
export const decodePath = (path: string): string => {
try {
path = decodeURI(path);
} catch (err) {
// ignore error
}
return path;
};
export const removeEndingSplash = (content = ''): string =>
content.replace(/\/$/u, '');
export const isLinkHttp = (link: string): boolean =>
/^(https?:)?\/\//.test(link);