document-drive 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/storage/filesystem.ts +12 -7
package/package.json
CHANGED
|
@@ -9,12 +9,6 @@ import sanitize from 'sanitize-filename';
|
|
|
9
9
|
import { isDocumentDrive } from '../utils';
|
|
10
10
|
import { IDriveStorage } from './types';
|
|
11
11
|
|
|
12
|
-
function ensureDir(dir: string) {
|
|
13
|
-
if (!existsSync(dir)) {
|
|
14
|
-
mkdirSync(dir, { recursive: true });
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
12
|
type FSError = {
|
|
19
13
|
errno: number;
|
|
20
14
|
code: string;
|
|
@@ -22,8 +16,19 @@ type FSError = {
|
|
|
22
16
|
path: string;
|
|
23
17
|
};
|
|
24
18
|
|
|
19
|
+
function ensureDir(dir: string) {
|
|
20
|
+
if (!existsSync(dir)) {
|
|
21
|
+
mkdirSync(dir, { recursive: true });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
25
|
function lockFile(path: string) {
|
|
26
|
-
return lock(path, {
|
|
26
|
+
return lock(path, {
|
|
27
|
+
fs,
|
|
28
|
+
retries: 3,
|
|
29
|
+
realpath: false,
|
|
30
|
+
onCompromised: () => {}
|
|
31
|
+
});
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
export class FilesystemStorage implements IDriveStorage {
|