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

struct

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

struct - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

60

index.js

@@ -1,2 +0,1 @@

var Proxy = require('node-proxy');

@@ -291,35 +290,28 @@ function byteField(p, offset) {

this.fields = Proxy.create({
hasOwn : function(name) {
return (priv.fields.hasOwnProperty(name));
},
get : function(r, name) {
var res;
if (priv.fields.hasOwnProperty(name))
res = self.get(name);
else
return undefined;
if ( res instanceof Struct)
return res.fields
else
return res;
},
set : function(r, name, value) {
self.set(name, value);
return true;
},
enumerate : function() {
var result = [];
for (var name in priv.fields) {
result.push(name);
};
return result;
},
keys : function() {
var result = [];
for (var name in priv.fields) {
result.push(name);
};
return result;
}
function getFields(){
var fields = {};
Object.keys(priv.fields).forEach(function(key){
Object.defineProperty(fields,key,{
get: function(){
var res = self.get(key);
if (res instanceof Struct) return res.fields;
else return res;
},
set: function(newVal){
self.set(key,newVal);
},
enumerable : true
});
});
return fields;
};
var _fields;
Object.defineProperty(this,'fields',{
get: function(){
if(_fields) return _fields;
return (_fields = getFields());
},
enumerable : true,
configurable : true
});

@@ -326,0 +318,0 @@

{ "name" : "struct"
, "version" : "v0.0.4"
, "version" : "v0.0.5"
, "description" : "Pack/Unpack multibyte binary values from/to buffers "

@@ -13,5 +13,3 @@ , "author": "Denys Khanzhiyev"

, "licenses" : [ { "type" : "MIT" } ]
, "dependencies" : {
"node-proxy" : ">=0.5.1"
}
, "dependencies" : {}
, "repositories" :

@@ -23,4 +21,4 @@ [ { "type" : "git"

, "engines": {
"node": ">0.4.0"
"node": ">0.6.0"
}
}
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