From ab4ae0d48a992289346339d8e538e14944b16615 Mon Sep 17 00:00:00 2001 From: Zach Bloomquist Date: Mon, 8 Nov 2021 15:17:08 -0500 Subject: [PATCH] chore: patch `winston` to suppress `padLevels` warning --- patches/winston+2.4.4.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 patches/winston+2.4.4.patch diff --git a/patches/winston+2.4.4.patch b/patches/winston+2.4.4.patch new file mode 100644 index 000000000000..a62afd1ee724 --- /dev/null +++ b/patches/winston+2.4.4.patch @@ -0,0 +1,16 @@ +diff --git a/node_modules/winston/lib/winston/common.js b/node_modules/winston/lib/winston/common.js +index 8ed9973..ecc59f8 100644 +--- a/node_modules/winston/lib/winston/common.js ++++ b/node_modules/winston/lib/winston/common.js +@@ -32,7 +32,10 @@ exports.setLevels = function (target, past, current, isDefault) { + } + + target.levels = current || config.npm.levels; +- if (target.padLevels) { ++ // Check if `padLevels` exists to suppress a warning about accessing ++ // a non-existing property on `exports`. ++ // @see https://github.com/winstonjs/winston/issues/1882 ++ if (target.hasOwnProperty('padLevels') && target.padLevels) { + target.levelLength = exports.longestElement(Object.keys(target.levels)); + } +