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

hapi-no-var

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-no-var - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

5

lib/index.js

@@ -28,4 +28,5 @@ // Based on https://github.com/eslint/eslint/blob/master/lib/rules/no-var.js

if (node.parent.parent.type === 'TryStatement' ||
node.parent.parent.type === 'CatchClause') {
if (node.parent.parent &&
(node.parent.parent.type === 'TryStatement' ||
node.parent.parent.type === 'CatchClause')) {

@@ -32,0 +33,0 @@ const variables = context.getDeclaredVariables(node);

2

package.json
{
"name": "hapi-no-var",
"version": "1.0.0",
"version": "1.0.1",
"description": "ESLint rule to enforce the usage of var declarations only in try-catch scope",

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

@@ -26,3 +26,4 @@ 'use strict';

'function test() { try { var bf = 2; if (bf) { console.log(bf); } } catch (err) {} }',
'function test() { try { if (true) { var bf = 2; } console.log(bf); } catch (err) {} }'
'function test() { try { if (true) { var bf = 2; } console.log(bf); } catch (err) {} }',
'var a = 1; try {} catch (err) {}'
];

@@ -49,3 +50,4 @@

'function test() { try {} catch (err) { var cf = 3; } console.log(cf); }',
'function test() { a = 1; try { var a = 2; } catch (err) {} }'
'function test() { a = 1; try { var a = 2; } catch (err) {} }',
'try { var a = 1; } catch (err) {} console.log(a);'
];

@@ -52,0 +54,0 @@

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