refactor(client): split client to cms/mobile/party
Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
19
client/cms/src/lib/utils.ts
Normal file
19
client/cms/src/lib/utils.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { ClassValue } from 'clsx';
|
||||
// eslint-disable-next-line unicorn/prefer-node-protocol
|
||||
import { Buffer } from 'buffer';
|
||||
import { clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
export function base64ToUtf8(base64: string): string {
|
||||
return new TextDecoder('utf-8').decode(
|
||||
Uint8Array.from(Buffer.from(base64, 'base64')),
|
||||
);
|
||||
}
|
||||
|
||||
export function utf8ToBase64(utf8: string): string {
|
||||
return Buffer.from(utf8, 'utf-8').toString('base64');
|
||||
}
|
||||
Reference in New Issue
Block a user