mirror of
https://github.com/Mail-0/Zero.git
synced 2026-07-01 08:16:28 +00:00
* feat: finish compose dialog persistence functionality * fix: fix merge conflict * fix: eslint warning and errors
19 lines
545 B
TypeScript
19 lines
545 B
TypeScript
import { clsx, type ClassValue } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
import LZString from "lz-string";
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
const MAX_URL_LENGTH = 2000;
|
|
|
|
export const compressText = (text: string): string => {
|
|
const compressed = LZString.compressToEncodedURIComponent(text);
|
|
return compressed.slice(0, MAX_URL_LENGTH);
|
|
};
|
|
|
|
export const decompressText = (compressed: string): string => {
|
|
return LZString.decompressFromEncodedURIComponent(compressed) || "";
|
|
};
|