|
@ -18,8 +18,8 @@ module.exports = { |
|
|
argumentName = argumentName || '(unknown name)'; |
|
|
argumentName = argumentName || '(unknown name)'; |
|
|
if (_.isString(type)) { |
|
|
if (_.isString(type)) { |
|
|
if (type === 'Buffer') { |
|
|
if (type === 'Buffer') { |
|
|
var BufferUtil = require('./buffer'); |
|
|
var buffer = require('buffer'); // './buffer' fails on cordova & RN
|
|
|
if (!BufferUtil.isBuffer(argument)) { |
|
|
if (!buffer.Buffer.isBuffer(argument)) { |
|
|
throw new errors.InvalidArgumentType(argument, type, argumentName); |
|
|
throw new errors.InvalidArgumentType(argument, type, argumentName); |
|
|
} |
|
|
} |
|
|
} else if (typeof argument !== type) { |
|
|
} else if (typeof argument !== type) { |
|
|