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

ref

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ref - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

test/reinterpretUntilZeros.js

7

History.md
0.3.1 / 2014-06-09
==================
* src: allow Buffers returned from `reinterpretUntilZeros()` up to `kMaxLength` bytes
* test: move the reinterpretUntilZeros() tests to their own file
* test: fix `Buffer#inspect()` test on Windows
0.3.0 / 2014-06-08

@@ -3,0 +10,0 @@ ==================

2

package.json

@@ -20,3 +20,3 @@ {

],
"version": "0.3.0",
"version": "0.3.1",
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",

@@ -23,0 +23,0 @@ "repository": {

@@ -47,3 +47,3 @@

it('should overwrite the default Buffer#inspect() to print the memory address', function () {
assert(buf.inspect().indexOf(buf.address().toString(16)) !== -1)
assert(buf.inspect().indexOf(buf.hexAddress()) !== -1)
})

@@ -50,0 +50,0 @@

@@ -45,24 +45,2 @@

describe('reinterpretUntilZeros()', function () {
it('should return a new Buffer instance up until the first 0', function () {
var buf = new Buffer('hello\0world')
var buf2 = buf.reinterpretUntilZeros(1)
assert.equal(buf2.length, 'hello'.length)
assert.equal(buf2.toString(), 'hello')
})
it('should return a new Buffer instance up until the first 2-byte sequence of 0s', function () {
var str = 'hello world'
var buf = new Buffer(50)
var len = buf.write(str, 'ucs2')
buf.writeInt16LE(0, len) // NULL terminate the string
var buf2 = buf.reinterpretUntilZeros(2)
assert.equal(str.length, buf2.length / 2)
assert.equal(buf2.toString('ucs2'), str)
})
})
})

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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