Comparing version 2.8.1 to 2.8.2
@@ -352,3 +352,3 @@ /*! | ||
function utf16leWrite (buf, string, offset, length) { | ||
var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length) | ||
var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length, 2) | ||
return charsWritten | ||
@@ -1037,3 +1037,4 @@ } | ||
function blitBuffer (src, dst, offset, length) { | ||
function blitBuffer (src, dst, offset, length, unitSize) { | ||
if (unitSize) length -= length % unitSize; | ||
for (var i = 0; i < length; i++) { | ||
@@ -1040,0 +1041,0 @@ if ((i + offset >= dst.length) || (i >= src.length)) |
{ | ||
"name": "buffer", | ||
"description": "Node.js Buffer API, for the browser", | ||
"version": "2.8.1", | ||
"version": "2.8.2", | ||
"author": { | ||
@@ -46,3 +46,3 @@ "name": "Feross Aboukhadijeh", | ||
"scripts": { | ||
"test": "npm run test-node && npm run test-browser", | ||
"test": "node ./bin/test.js", | ||
"test-browser": "zuul -- test/*.js", | ||
@@ -49,0 +49,0 @@ "test-browser-local": "zuul --local -- test/*.js", |
@@ -36,1 +36,10 @@ var B = require('../').Buffer | ||
}) | ||
test('do not write partial utf16 code units', function(t) { | ||
var f = new B([0, 0, 0, 0, 0]) | ||
t.equal(f.length, 5) | ||
var size = f.write('あいうえお', 'utf16le') | ||
t.equal(size, 4) | ||
t.deepEqual(f, new B([0x42, 0x30, 0x44, 0x30, 0x00])) | ||
t.end() | ||
}) |
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
68589
21
1655
13
1