15 lines
343 B
TypeScript
15 lines
343 B
TypeScript
'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);
|