Refactor fsHelper
This commit is contained in:
parent
738cd98618
commit
ca880154bf
|
@ -1,6 +1,9 @@
|
|||
import * as fs from "fs";
|
||||
|
||||
export const saveJsonToDisk = (content: {}) => {
|
||||
const outputPath = `../database.json`;
|
||||
fs.writeFileSync(outputPath, JSON.stringify(content));
|
||||
}
|
||||
const JELLYFIN_CONTENT_PATH = "../jellyfin_content.json";
|
||||
const WISHLIST_PATH = "../wishlist.json";
|
||||
|
||||
const saveToDisk = (path: string, content: any) => fs.writeFileSync(path, JSON.stringify(content));
|
||||
|
||||
export const saveJfItemsToDisk = (content: {}) => saveToDisk(JELLYFIN_CONTENT_PATH, content);
|
||||
export const saveWishlistToDisk = (content: {}) => saveToDisk(WISHLIST_PATH, content);
|
||||
|
|
Loading…
Reference in a new issue