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

compare-ast

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compare-ast - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

3

lib/compare.js

@@ -40,2 +40,5 @@ var parse = require('esprima').parse;

if (Array.isArray(actual)) {
if (actual.length !== expected.length) {
throw new Errors.MatchError(actualAst, expectedAst);
}
actual.forEach(function(_, i) {

@@ -42,0 +45,0 @@ _bind(actual[i], expected[i]);

2

package.json
{
"name": "compare-ast",
"version": "0.1.1",
"version": "0.1.2",
"description": "Determine if two strings of JavaScript have equivalent abstract syntax trees.",

@@ -5,0 +5,0 @@ "main": "lib/compare.js",

@@ -83,2 +83,7 @@ var compareAst = require('..');

test('unmatched statements', function() {
noMatch(['', 'var x = 0;'], 3);
noMatch(['var x = 0;', ''], 3);
});
test('parse failure', function() {

@@ -85,0 +90,0 @@ noMatch(['var a = !;', 'var a = !;'], 1);

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