in src/common-core/message.ts [132:146]
static isBufferConvertible(obj: any): boolean {
/*Codes_SRS_NODE_IOTHUB_MESSAGE_18_001: [`isBufferConvertible` shall return `true` if `obj` is a `Buffer`, a `string`, an `Array`, or an `ArrayBuffer`.]*/
if (Buffer.isBuffer(obj)) {
return true;
} else if (typeof obj === 'string') {
return true;
} else if (obj instanceof Array) {
return true;
} else if (obj instanceof ArrayBuffer) {
return true;
} else {
/*Codes_SRS_NODE_IOTHUB_MESSAGE_18_002: [`isBufferConvertible` shall return `false` if `obj` is any other type.]*/
return false;
}
}