Socket
Socket
Sign inDemoInstall

binary-extract

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

6

History.md
0.1.1 / 2014-05-28
==================
* always return arrays when fed arrays
* refactor
0.1.0 / 2014-05-19

@@ -3,0 +9,0 @@ ==================

5

index.js

@@ -34,3 +34,4 @@

function extract(buf, keys){
if (!Array.isArray(keys)) keys = [keys];
var multi = Array.isArray(keys);
if (!multi) keys = [keys];

@@ -90,3 +91,3 @@ var values = [];

return keys.length != 1
return multi
? values

@@ -93,0 +94,0 @@ : values[0];

2

package.json
{
"name": "binary-extract",
"description": "Extract values from a binary json blob",
"version": "0.1.0",
"version": "0.1.1",
"repository": "segmentio/binary-extract",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -15,2 +15,6 @@

})
it('should always return arrays when fed arrays', function(){
var buf = toBuf({ foo: 'bar' });
equal(extract(buf, ['foo']), ['bar']);
})
it('should end on ,', function(){

@@ -17,0 +21,0 @@ var buf = toBuf({ foo: 'bar', bar: 'baz' });

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc