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

primea-objects

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

primea-objects - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

8

index.js

@@ -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 @@

8

package.json
{
"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,

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