| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1027,6 +1027,13 @@ Avoid calling it more than once in an asynchronous context as one call | |||
| 1027 | 1027 | might refresh the temporary directory of a different context, causing | |
| 1028 | 1028 | the test to fail somewhat mysteriously. | |
| 1029 | 1029 | ||
| 1030 | + ### `resolve([...paths])` | ||
| 1031 | + | ||
| 1032 | + * `...paths` [\<string>][<string>] | ||
| 1033 | + * return [\<string>][<string>] | ||
| 1034 | + | ||
| 1035 | + Resolves a sequence of paths into absolute path in the temporary directory. | ||
| 1036 | + | ||
| 1030 | 1037 | ### `hasEnoughSpace(size)` | |
| 1031 | 1038 | ||
| 1032 | 1039 | * `size` [\<number>][<number>] Required size, in bytes. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,6 +55,10 @@ function onexit() { | |||
| 55 | 55 | } | |
| 56 | 56 | } | |
| 57 | 57 | ||
| 58 | + function resolve(...paths) { | ||
| 59 | + return path.resolve(tmpPath, ...paths); | ||
| 60 | + } | ||
| 61 | + | ||
| 58 | 62 | function hasEnoughSpace(size) { | |
| 59 | 63 | const { bavail, bsize } = fs.statfsSync(tmpPath); | |
| 60 | 64 | return bavail >= Math.ceil(size / bsize); | |
@@ -64,4 +68,5 @@ module.exports = { | |||
| 64 | 68 | path: tmpPath, | |
| 65 | 69 | refresh, | |
| 66 | 70 | hasEnoughSpace, | |
| 71 | + resolve, | ||
| 67 | 72 | }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments