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

wasm-json-toolkit

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wasm-json-toolkit - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

.nyc_output/1c7826514920db1c45a303de8e526b72.json

23

index.js
/**
* Converts a wasm binary into a json representation
* @param {Buffer}
* @return {Object}
* @return {Array}
*/

@@ -10,3 +10,3 @@ exports.wasm2json = require('./wasm2json')

* Converts a json representation to a wasm binary
* @param {Object}
* @param {Array}
* @return {Buffer}

@@ -30,21 +30,26 @@ */

exports.findSections = function * (array, sectionOrder) {
/**
* iterates thourgh an array of sections returning a subset of sections
* @param {Array}
* @param {Sections}
*/
exports.findSections = function * (array, sections) {
let section = array[0]
let index = 0
const wantedSections = new Set(sectionOrder)
let nextSection = sectionOrder.shift()
const wantedSections = new Set(sections)
let nextSection = sections.shift()
while (section) {
if (!wantedSections.has(section.name)) {
if (!wantedSections.has(section.sectionName || section.name)) {
section = array[++index]
} else {
if (section.name === nextSection) {
if ((section.sectionName || section.name) === nextSection) {
yield section
section = array[++index]
} else {
yield null
yield
}
nextSection = sectionOrder.shift()
nextSection = sections.shift()
}
}
}
{
"name": "wasm-json-toolkit",
"version": "0.2.1",
"version": "0.2.2",
"description": "this convertes wasm binaries to json and json to wasm binaries",

@@ -10,3 +10,3 @@ "main": "index.js",

"lint": "standard",
"test": "node --harmony ./test/index.js"
"test": "node ./test/index.js"
},

@@ -13,0 +13,0 @@ "keywords": [

@@ -20,3 +20,3 @@ const fs = require('fs')

t.equals(results.length, 3)
t.equals(results[1], null)
t.equals(results[1], undefined)
t.equals(results[0].name, 'type')

@@ -23,0 +23,0 @@ t.equals(results[2].name, 'export')

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