refactoring
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
'server only'
|
||||
import { ReactNode } from "react";
|
||||
import Gens from "./gens";
|
||||
function truncateString(str:string = '', num:number = 255) {
|
||||
if (str.length > num) {
|
||||
return str.slice(0, num) + "...";
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export { Gens, truncateString }
|
||||
export const aifa = (a: ReactNode, b: ReactNode) => (a ? a : b);
|
||||
Reference in New Issue
Block a user