mirror of
https://github.com/pawelmalak/flame.git
synced 2026-02-28 09:23:12 +08:00
Fetch and use custom search queries
This commit is contained in:
@@ -3,7 +3,7 @@ const fs = require('fs');
|
||||
class File {
|
||||
constructor(path) {
|
||||
this.path = path;
|
||||
this.content = '';
|
||||
this.content = null;
|
||||
}
|
||||
|
||||
read() {
|
||||
@@ -16,10 +16,13 @@ class File {
|
||||
}
|
||||
}
|
||||
|
||||
write(data) {
|
||||
write(data, isJSON) {
|
||||
this.content = data;
|
||||
fs.writeFileSync(this.path, this.content);
|
||||
fs.writeFileSync(
|
||||
this.path,
|
||||
isJSON ? JSON.stringify(this.content) : this.content
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = File;
|
||||
module.exports = File;
|
||||
|
||||
Reference in New Issue
Block a user