primea-objects
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -222,3 +222,9 @@ const crypto = require('crypto') | ||
static fromJSON (data) { | ||
return new ModuleRef(ID.fromJSON(data.id), data.modType, data.exports, data.persist, Buffer.from(data.code.slice(2), 'hex')) | ||
return new ModuleRef( | ||
ID.fromJSON(data.id), | ||
data.modType, | ||
data.exports, | ||
data.persist.map(p => p == null ? undefined : p), | ||
Buffer.from(data.code.slice(2), 'hex') | ||
) | ||
} | ||
@@ -225,0 +231,0 @@ |
{ | ||
"name": "primea-objects", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Object helper classes for Primea's system Objects", | ||
@@ -20,3 +20,3 @@ "main": "index.js", | ||
"borc": "^2.0.3", | ||
"events": "^2.0.0", | ||
"events": "^3.0.0", | ||
"safe-buffer": "^5.1.2" | ||
@@ -26,5 +26,5 @@ }, | ||
"coveralls": "^3.0.0", | ||
"documentation": "^6.3.2", | ||
"documentation": "^7.0.0", | ||
"minimist": "^1.2.0", | ||
"nyc": "^11.7.1", | ||
"nyc": "^12.0.1", | ||
"standard": "^11.0.1", | ||
@@ -31,0 +31,0 @@ "tape": "^4.9.0" |
@@ -83,3 +83,3 @@ const Buffer = require('safe-buffer').Buffer | ||
const id2 = new objects.ID(Buffer.from([0x2])) | ||
const modRef = new objects.ModuleRef(id, 1, {'name': ['i32']}, [], Buffer.from('0061736d01000000', 'hex')) | ||
const modRef = new objects.ModuleRef(id, 1, {'name': ['i32']}, [undefined, [], undefined, []], Buffer.from('0061736d01000000', 'hex')) | ||
const obj = [ | ||
@@ -97,8 +97,8 @@ modRef, | ||
const json = utils.toJSON(obj) | ||
t.deepEquals(JSON.stringify(json), '[{"type":"modref","id":"0x01","modType":1,"code":"0x0061736d01000000","exports":{"name":["i32"]},"persist":[]},{"type":"actorref","id":"0x02","modref":{"type":"modref","id":"0x01","modType":1,"code":"0x0061736d01000000","exports":{"name":["i32"]},"persist":[]}},{"type":"funcref","actorId":"0x02","private":false,"name":"main","gas":100,"params":["i32"]},"0x01020304"]') | ||
t.deepEquals(JSON.stringify(json), '[{"type":"modref","id":"0x01","modType":1,"code":"0x0061736d01000000","exports":{"name":["i32"]},"persist":[null,[],null,[]]},{"type":"actorref","id":"0x02","modref":{"type":"modref","id":"0x01","modType":1,"code":"0x0061736d01000000","exports":{"name":["i32"]},"persist":[null,[],null,[]]}},{"type":"funcref","actorId":"0x02","private":false,"name":"main","gas":100,"params":["i32"]},"0x01020304"]') | ||
const jsonPartial = utils.toJSON(obj, false) | ||
t.deepEquals(JSON.stringify(jsonPartial), '[{"type":"modref","id":"0x01","modType":1,"code":"0x0061736d...","exports":{"name":["i32"]},"persist":[]},{"type":"actorref","id":"0x02","modref":{"type":"modref","id":"0x01","modType":1,"code":"0x0061736d...","exports":{"name":["i32"]},"persist":[]}},{"type":"funcref","actorId":"0x02","private":false,"name":"main","gas":100},"0x01020304"]') | ||
t.deepEquals(JSON.stringify(jsonPartial), '[{"type":"modref","id":"0x01","modType":1,"code":"0x0061736d...","exports":{"name":["i32"]},"persist":[null,[],null,[]]},{"type":"actorref","id":"0x02","modref":{"type":"modref","id":"0x01","modType":1,"code":"0x0061736d...","exports":{"name":["i32"]},"persist":[null,[],null,[]]}},{"type":"funcref","actorId":"0x02","private":false,"name":"main","gas":100},"0x01020304"]') | ||
const modRefPartial = new objects.ModuleRef(id, 1, {'name': ['i32']}, [], Buffer.from('0061736d', 'hex')) | ||
const modRefPartial = new objects.ModuleRef(id, 1, {'name': ['i32']}, [undefined, [], undefined, []], Buffer.from('0061736d', 'hex')) | ||
const objPartial = [ | ||
@@ -105,0 +105,0 @@ modRefPartial, |
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
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
44316
457
+ Addedevents@3.3.0(transitive)
- Removedevents@2.1.0(transitive)
Updatedevents@^3.0.0