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

@webassemblyjs/helper-flatten-ast

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webassemblyjs/helper-flatten-ast - npm Package Compare versions

Comparing version 1.11.1 to 1.11.3

14

esm/index.js

@@ -1,3 +0,13 @@

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
import { traverse, isInstruction } from "@webassemblyjs/ast";

@@ -44,3 +54,3 @@ export function flatten(ast) {

if (isInstruction(arg) === false) {
return _toConsumableArray(acc).concat([arg]);
return [].concat(_toConsumableArray(acc), [arg]);
}

@@ -47,0 +57,0 @@

@@ -10,4 +10,14 @@ "use strict";

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function flatten(ast) {

@@ -53,3 +63,3 @@ /**

if ((0, _ast.isInstruction)(arg) === false) {
return _toConsumableArray(acc).concat([arg]);
return [].concat(_toConsumableArray(acc), [arg]);
}

@@ -56,0 +66,0 @@

12

package.json
{
"name": "@webassemblyjs/helper-flatten-ast",
"version": "1.11.1",
"version": "1.11.3",
"description": "Flatten an AST helper",

@@ -17,10 +17,10 @@ "main": "lib/index.js",

"dependencies": {
"@webassemblyjs/ast": "1.11.1"
"@webassemblyjs/ast": "1.11.3"
},
"devDependencies": {
"@webassemblyjs/helper-test-framework": "1.11.1",
"@webassemblyjs/wast-parser": "1.11.1",
"@webassemblyjs/wast-printer": "1.11.1"
"@webassemblyjs/helper-test-framework": "1.11.3",
"@webassemblyjs/wast-parser": "1.11.3",
"@webassemblyjs/wast-printer": "1.11.3"
},
"gitHead": "3f07e2db2031afe0ce686630418c542938c1674b"
"gitHead": "5fd2425602b752576bbe8089c343d5d70ebc861c"
}

@@ -64,3 +64,3 @@ // @flow

CallInstruction: CallInstructionVisitor,
Instr: InstrVisitor
Instr: InstrVisitor,
});

@@ -67,0 +67,0 @@ }

@@ -5,3 +5,3 @@ const { parse } = require("@webassemblyjs/wast-parser");

getFixtures,
compareWithExpected
compareWithExpected,
} = require("@webassemblyjs/helper-test-framework");

@@ -13,5 +13,5 @@

const testSuites = getFixtures(__dirname, "fixtures", "**/actual.wast");
const pre = f => print(flatten(parse(f)));
const pre = (f) => print(flatten(parse(f)));
compareWithExpected(testSuites, pre, "expected.wast");
});
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