buffer-to-uint8array
Advanced tools
Comparing version 1.0.0 to 1.1.0
module.exports = function (buf) { | ||
if (!buf) return undefined; | ||
if (buf.constructor.name === 'Uint8Array' | ||
|| buf.constructor === Uint8Array) { | ||
return buf; | ||
} | ||
if (typeof buf === 'string') buf = Buffer(buf); | ||
@@ -3,0 +8,0 @@ var a = new Uint8Array(buf.length); |
{ | ||
"name": "buffer-to-uint8array", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "convert a buffer (or string) to a Uint8Array", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3767
8
46
38