New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.0 to 0.1.1

7

lib/index.js

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

path.traverse(safelyVisitors)
path.replaceWith(node.arguments[0])
if (path.parent.type === 'ArrowFunctionExpression' && path.parent.body && path.parent.body.body && path.parent.body.body[1] && path.parent.body.body[1].argument === node) {
// the node can be moved in an arrow function
path.parent.body.body[1].argument = node.arguments[0]
} else {
path.replaceWith(node.arguments[0])
}
}

@@ -138,0 +143,0 @@ }

2

package.json

@@ -27,3 +27,3 @@ {

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

@@ -45,3 +45,3 @@ # babel-plugin-transform-safely

And of course you can combine any permutation of the above:
And of course you can combine any permutation of the above (with any other valid expression or operator):
```

@@ -48,0 +48,0 @@ safely(empty.b.c = object[a]() || object[b](something.c.d))

@@ -32,6 +32,11 @@ var obj = {foo: 'bar'}

safely(empty.b = obj.foo.bar(func.c))
},
arrow: function() {
return {
get: (row) => safely(row.SelectedOutcome.FieldType)
}
}
}
var test
for (let testName in tests) {
for (var testName in tests) {
var result = require("babel-core").transform('test=' + tests[testName].toString(), {

@@ -38,0 +43,0 @@ plugins: ["transform-safely"]

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