refactor: fix typo (unsave -> unsafe)
This commit is contained in:
parent
3b11054083
commit
9f411cf6c8
|
@ -24,15 +24,15 @@ const folder = path.dirname(options.path);
|
|||
|
||||
function initDir(): Promise<void> {
|
||||
if (!fs.existsSync(folder)) {
|
||||
return fs.promises.mkdir(folder, { recursive: true }).then(() => writeUnsave());
|
||||
return fs.promises.mkdir(folder, { recursive: true }).then(() => writeUnsafe());
|
||||
}
|
||||
if (!fs.existsSync(options.path)) {
|
||||
return writeUnsave();
|
||||
return writeUnsafe();
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
function writeUnsave(): Promise<void> {
|
||||
function writeUnsafe(): Promise<void> {
|
||||
return fs.writeFile(options.path, JSON.stringify(store));
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ function read(): Promise<void> {
|
|||
|
||||
function write(): Promise<void> {
|
||||
return initDir().then(() =>
|
||||
writeUnsave().then(() => {
|
||||
writeUnsafe().then(() => {
|
||||
synced = false;
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue