diff options
Diffstat (limited to 'lib/internal/crypto/diffiehellman.js')
-rw-r--r-- | lib/internal/crypto/diffiehellman.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js index 8466df2f79..95b689df94 100644 --- a/lib/internal/crypto/diffiehellman.js +++ b/lib/internal/crypto/diffiehellman.js @@ -2,6 +2,7 @@ const { Buffer } = require('buffer'); const errors = require('internal/errors'); +const { isArrayBufferView } = require('internal/util/types'); const { getDefaultEncoding, toBuf @@ -25,7 +26,7 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) { if (typeof sizeOrKey !== 'number' && typeof sizeOrKey !== 'string' && - !ArrayBuffer.isView(sizeOrKey)) { + !isArrayBufferView(sizeOrKey)) { throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'sizeOrKey', ['number', 'string', 'Buffer', 'TypedArray', 'DataView']); |