@@ -38,4 +38,12 @@ 'use strict' | ||
| const dstStat = await fs.stat(dstpath, { bigint: true }) | ||
| if (areIdentical(srcStat, dstStat)) return | ||
| // Following the existing symlink fails with ENOENT if it's broken; in that | ||
| // case fall through so fs.symlink reports EEXIST, rather than leaking the | ||
| // stat ENOENT. Any other error is unexpected, so rethrow it. | ||
| let dstStat | ||
| try { | ||
| dstStat = await fs.stat(dstpath, { bigint: true }) | ||
| } catch (err) { | ||
| if (err.code !== 'ENOENT') throw err | ||
| } | ||
| if (dstStat && areIdentical(srcStat, dstStat)) return | ||
| } | ||
@@ -76,4 +84,12 @@ | ||
| const dstStat = fs.statSync(dstpath, { bigint: true }) | ||
| if (areIdentical(srcStat, dstStat)) return | ||
| // Following the existing symlink fails with ENOENT if it's broken; in that | ||
| // case fall through so fs.symlinkSync reports EEXIST, rather than leaking the | ||
| // stat ENOENT. Any other error is unexpected, so rethrow it. | ||
| let dstStat | ||
| try { | ||
| dstStat = fs.statSync(dstpath, { bigint: true }) | ||
| } catch (err) { | ||
| if (err.code !== 'ENOENT') throw err | ||
| } | ||
| if (dstStat && areIdentical(srcStat, dstStat)) return | ||
| } | ||
@@ -80,0 +96,0 @@ |
+1
-1
| { | ||
| "name": "fs-extra", | ||
| "version": "11.3.6", | ||
| "version": "11.4.0", | ||
| "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.", | ||
@@ -5,0 +5,0 @@ "engines": { |
59299
1.12%1346
1.2%