search in desc, input and output

This commit is contained in:
codetypes committed 2024-04-27 21:41:56 +08:00
1 parent 5e6f177132
commit 4022f268e5
5 files changed
+69 -12

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import * as fs from "fs";
export const readJson = (path: string) => {
const str = fs.readFileSync(path, "utf-8");
return JSON.parse(str);
};
export const writeJson = (path: string, data: any) => {
const str = JSON.stringify(data, undefined, 2);
fs.writeFileSync(path, str, "utf-8");
};
export function mergeClassNames(...cls: string[]): string {
return cls.filter((v) => !!v).join(" ");
}