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

bufrw

Package Overview
Dependencies
Maintainers
5
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bufrw - npm Package Compare versions

Comparing version 0.9.25 to 0.9.26

lib/can-require.js

16

annotated_buffer.js

@@ -23,6 +23,12 @@ // Copyright (c) 2015 Uber Technologies, Inc.

var canRequire = require('./lib/can-require.js');
var hex = null;
// istanbul ignore if
if (canRequire('hexer')) {
hex = require('hexer');
}
var color = require('ansi-color').set;
var stripColor = require('./lib/strip_color.js');
var extend = require('xtend');
var hex = require('hexer');
var stripColor = require('hexer/render').stripColor;
var inspect = require('util').inspect;

@@ -294,2 +300,8 @@

var self = this;
// istanbul ignore if
if (!hex) {
return self.buffer.toString('hex');
}
options = extend(options, {

@@ -296,0 +308,0 @@ emptyHuman: ' ',

10

error_highlighter.js

@@ -24,3 +24,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

var color = require('ansi-color').set;
var render = require('hexer/render');
var stripColor = require('./lib/strip_color.js');

@@ -48,8 +48,8 @@ module.exports = errorHighlighter;

within = totalOffset !== err.endOffset-1;
return errColor(render.stripColor(str));
return errColor(stripColor(str));
} else if (totalOffset === err.endOffset-1) {
within = false;
return errColor(render.stripColor(str));
return errColor(stripColor(str));
} else if (within) {
return errColor(render.stripColor(str));
return errColor(stripColor(str));
} else {

@@ -62,3 +62,3 @@ return str;

if (totalOffset === err.offset) {
return errColor(render.stripColor(str));
return errColor(stripColor(str));
} else {

@@ -65,0 +65,0 @@ return str;

@@ -23,3 +23,9 @@ // Copyright (c) 2015 Uber Technologies, Inc.

var hex = require('hexer');
var canRequire = require('./lib/can-require.js');
var hex = null;
// istanbul ignore if
if (canRequire('hexer')) {
hex = require('hexer');
}
var util = require('util');

@@ -181,2 +187,7 @@ var Result = require('./result');

function formatBufferColored(err, options) {
// istanbul ignore else
if (!hex) {
return err.buffer.toString('hex');
}
options = options || {};

@@ -195,2 +206,7 @@ var opts = options.hexerOptions ? Object.create(options.hexerOptions) : {};

function formatBufferUncolored(err, options) {
// istanbul ignore else
if (!hex) {
return err.buffer.toString('hex');
}
options = options || {};

@@ -197,0 +213,0 @@

{
"name": "bufrw",
"version": "0.9.25",
"version": "0.9.26",
"description": "Buffer Reading and Writing",

@@ -22,4 +22,2 @@ "keywords": [],

"error": "^7.0.0",
"hexer": "^1.4.3",
"readable-stream": "1.0.33",
"xtend": "^4.0.0"

@@ -26,0 +24,0 @@ },

@@ -24,3 +24,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

var inherits = require('util').inherits;
var Transform = require('readable-stream').Transform;
var Transform = require('stream').Transform;
var ReadMachine = require('./read_machine');

@@ -27,0 +27,0 @@

@@ -25,3 +25,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

var inspect = require('util').inspect;
var Transform = require('readable-stream').Transform;
var Transform = require('stream').Transform;
var WrappedError = require('error/wrapped');

@@ -28,0 +28,0 @@

@@ -23,3 +23,9 @@ // Copyright (c) 2015 Uber Technologies, Inc.

var hexdiff = require('hexer/diff');
var canRequire = require('./lib/can-require.js');
var hexdiff = null;
// istanbul ignore if
if (canRequire('hexer')) {
hexdiff = require('hexer/diff');
}
var util = require('util');

@@ -127,4 +133,7 @@ var formatError = require('./interface').formatError;

// TODO: re-run write with an annotated buffer
self.assert.comment('expected v actual:\n' +
hexdiff(buf, got, {colored: true}));
// istanbul ignore if
if (hexdiff) {
self.assert.comment('expected v actual:\n' +
hexdiff(buf, got, {colored: true}));
}
self.assert.fail(desc);

@@ -131,0 +140,0 @@ } else {

@@ -23,3 +23,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

var PassThrough = require('readable-stream').PassThrough;
var PassThrough = require('stream').PassThrough;
var util = require('util');

@@ -26,0 +26,0 @@

@@ -23,3 +23,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

var PassThrough = require('readable-stream').PassThrough;
var PassThrough = require('stream').PassThrough;
var util = require('util');

@@ -26,0 +26,0 @@

@@ -79,4 +79,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

'write error BangError: bang');
assert.equal(results[3],
'00\x1b[36m:\x1b[0m \x1b[31m\x1b[1m00\x1b[0m \x1b[31m\x1b[1m.\x1b[0m');
assert.equal(results[3], '00');

@@ -88,4 +87,3 @@ assert.equal(results[4].name, 'no read error', 'expected "no read error"');

'read error Error: bork');
assert.equal(results[6],
'00\x1b[36m:\x1b[0m \x1b[31m\x1b[1m00\x1b[0m \x1b[31m\x1b[1m.\x1b[0m');
assert.equal(results[6], '00');

@@ -92,0 +90,0 @@ assert.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