diff --git a/package-lock.json b/package-lock.json index 8950b4903..a2cab8fc0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2113,6 +2113,21 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "devOptional": true }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", diff --git a/server/libs/jwa/buffer-equal-constant-time/index.js b/server/libs/jwa/buffer-equal-constant-time/index.js index 07c142662..56a7252c1 100644 --- a/server/libs/jwa/buffer-equal-constant-time/index.js +++ b/server/libs/jwa/buffer-equal-constant-time/index.js @@ -28,14 +28,19 @@ function bufferEq(a, b) { } bufferEq.install = function () { - Buffer.prototype.equal = SlowBuffer.prototype.equal = function equal(that) { + Buffer.prototype.equal = function equal(that) { return bufferEq(this, that); }; + if (SlowBuffer && SlowBuffer.prototype) { + SlowBuffer.prototype.equal = Buffer.prototype.equal; + } }; var origBufEqual = Buffer.prototype.equal; -var origSlowBufEqual = SlowBuffer.prototype.equal; +var origSlowBufEqual = SlowBuffer && SlowBuffer.prototype ? SlowBuffer.prototype.equal : undefined; bufferEq.restore = function () { Buffer.prototype.equal = origBufEqual; - SlowBuffer.prototype.equal = origSlowBufEqual; + if (SlowBuffer && SlowBuffer.prototype) { + SlowBuffer.prototype.equal = origSlowBufEqual; + } };