Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buffer

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer - npm Package Compare versions

Comparing version 2.8.1 to 2.8.2

bin/test.js

5

index.js

@@ -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))

4

package.json
{
"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()
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc