Remove options from writeJsonFile for YAGNI

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen authored and Sebastian Malton committed 2022-01-31 09:10:23 -05:00
1 parent 5567b0df30
commit b7297e28b2
1 file changed
+1 -8
+1 -8
View File
@@ -13,19 +13,12 @@ interface Dependencies {
ensureDir: (dir: string, options?: EnsureOptions | number) => Promise<void>;
}
const writeJsonFile = ({ writeJson, ensureDir }: Dependencies) => async (filePath: string, content: JsonValue, options?: WriteOptions | BufferEncoding) => {
const writeJsonFile = ({ writeJson, ensureDir }: Dependencies) => async (filePath: string, content: JsonValue) => {
await ensureDir(path.dirname(filePath), { mode: 0o755 });
const resolvedOptions = typeof options === "string"
? {
encoding: options,
}
: options;
await writeJson(filePath, content, {
encoding: "utf-8",
spaces: 2,
...resolvedOptions,
});
};