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

babel-plugin-transform-safely

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-safely - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

9

lib/index.js

@@ -28,8 +28,4 @@ module.exports = function ({ types: t }) {

path.replaceWith(t.logicalExpression('||', node, t.assignmentExpression('=', node, isArray ? t.arrayExpression([]) : t.objectExpression([]))))
return path.node
} else if (t.isMemberExpression(node)) {
let ensuredObject = ensureObject(path.get('object'), t.isNumericLiteral(node.property))
if (!ensuredObject) {
// var _gen1 = expr;
}
let objectRef = getObjectReference(path.get('object'))

@@ -39,6 +35,5 @@ path.replaceWith(t.logicalExpression('||',

markAsSafe(t.assignmentExpression('=', markAsSafe(t.memberExpression(objectRef, node.property, node.computed)), isArray ? t.arrayExpression([]) : t.objectExpression([])))))
return path.node
}
// else can't be ensured
// else can't be ensured, just used the referenced expression
return path.node
}

@@ -45,0 +40,0 @@

@@ -21,3 +21,2 @@ {

"name": "babel-plugin-transform-safely",
"readme": "ERROR: No README data found!",
"repository": {

@@ -28,3 +27,3 @@ "type": "git",

"scripts": {},
"version": "0.1.1"
"version": "0.1.2"
}

@@ -37,2 +37,5 @@ var obj = {foo: 'bar'}

}
},
thisAssignment: function() {
safely(this.obj['a'] ='b')
}

@@ -39,0 +42,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