reformat all ts code via prettier

This commit is contained in:
david_bai
2025-06-22 21:34:54 +08:00
parent 8baf16ee8c
commit f09452ac2a
78 changed files with 2779 additions and 2307 deletions
+12 -10
View File
@@ -1,18 +1,20 @@
export const slugifyTag = (tag: string): string => {
// Use encodeURIComponent to handle Chinese and special characters
return encodeURIComponent(tag
.trim()
.replace(/\s+/g, '-') // Replace spaces with hyphens
.replace(/\-\-+/g, '-') // Replace multiple hyphens with a single one
.replace(/^-+/, '') // Remove leading hyphens
.replace(/-+$/, '') // Remove trailing hyphens
return encodeURIComponent(
tag
.trim()
.replace(/\s+/g, "-") // Replace spaces with hyphens
.replace(/\-\-+/g, "-") // Replace multiple hyphens with a single one
.replace(/^-+/, "") // Remove leading hyphens
.replace(/-+$/, "") // Remove trailing hyphens
);
};
export const unslugifyTag = (slug: string): string => {
// Decode URL-encoded tags
return decodeURIComponent(slug
.replace(/-/g, ' ') // Replace hyphens back with spaces
.trim()
return decodeURIComponent(
slug
.replace(/-/g, " ") // Replace hyphens back with spaces
.trim()
);
};
};