From 320402c1a18d877fa93c440af17b852612ff7f44 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 4 Aug 2019 15:13:33 +0200 Subject: [PATCH] fs: fix (temporary) for esm package Fix to unblock CITGM. See, https://github.com/standard-things/esm/issues/821. PR-URL: https://github.com/nodejs/node/pull/28957 Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott Reviewed-By: Matteo Collina Reviewed-By: Trivikram Kamat --- lib/internal/fs/utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 24d946edf7288a..e91918a00772cf 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -345,6 +345,10 @@ function Stats(dev, mode, nlink, uid, gid, rdev, blksize, Object.setPrototypeOf(Stats.prototype, StatsBase.prototype); Object.setPrototypeOf(Stats, StatsBase); +// HACK: Workaround for https://github.com/standard-things/esm/issues/821. +// TODO(ronag): Remove this as soon as `esm` publishes a fixed version. +Stats.prototype.isFile = StatsBase.prototype.isFile; + Stats.prototype._checkModeProperty = function(property) { if (isWindows && (property === S_IFIFO || property === S_IFBLK || property === S_IFSOCK)) {