From bbf612cb9e3cd8cddc2f1ffb6f81d2b3963ffba6 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 21 Sep 2021 11:03:28 +0100 Subject: [PATCH] Replace use of deprecated util.inherits --- lib/constructor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/constructor.js b/lib/constructor.js index 711221f2..9299682e 100644 --- a/lib/constructor.js +++ b/lib/constructor.js @@ -288,7 +288,8 @@ const Sharp = function (input, options) { this.options.input = this._createInputDescriptor(input, options, { allowStream: true }); return this; }; -util.inherits(Sharp, stream.Duplex); +Object.setPrototypeOf(Sharp.prototype, stream.Duplex.prototype); +Object.setPrototypeOf(Sharp, stream.Duplex); /** * Take a "snapshot" of the Sharp instance, returning a new instance.