bin-protocol
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -417,3 +417,6 @@ 'use strict'; | ||
} | ||
if (Buffer.isBuffer(value) || typeof value === 'string') { | ||
if (typeof value === 'string') { | ||
value = new Buffer(value, 'utf8'); | ||
} | ||
if (Buffer.isBuffer(value)) { | ||
this | ||
@@ -420,0 +423,0 @@ .UVarint(value.length) |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"main": "./lib/index.js", | ||
@@ -12,0 +12,0 @@ "keywords": ["buffer", "raw", "binary", "protocol", "parser", "reader", "builder"], |
@@ -279,2 +279,8 @@ 'use strict'; | ||
it('bytes - UTF8 string', function () { | ||
var str = '人人生而自由,在尊嚴和權利上一律平等。'; | ||
var encoded = protocol.write().bytes(str).result; | ||
protocol.read(encoded).bytes().result.toString('utf8').should.be.eql(str); | ||
}); | ||
it('bytes - zero length', function () { | ||
@@ -281,0 +287,0 @@ var buf = new Buffer(0); |
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
136867
2088