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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
0
16337
335
- Removednode-proxy@>=0.5.1
- Removedbindings@1.5.0(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removednan@2.22.0(transitive)
- Removednode-proxy@1.0.0(transitive)