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

babel-plugin-treat

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-treat - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [1.1.0](https://github.com/seek-oss/treat/tree/master/packages/babel-plugin-treat/compare/v1.0.4...v1.1.0) (2019-09-16)
### Features
* **babel-plugin:** Support anonymous calls in arrays/objects ([#57](https://github.com/seek-oss/treat/tree/master/packages/babel-plugin-treat/issues/57)) ([ec52adb](https://github.com/seek-oss/treat/tree/master/packages/babel-plugin-treat/commit/ec52adb))
## [1.0.4](https://github.com/seek-oss/treat/tree/master/packages/babel-plugin-treat/compare/v1.0.3...v1.0.4) (2019-08-06)

@@ -8,0 +19,0 @@

43

index.js

@@ -18,2 +18,26 @@ const { dirname, basename } = require('path');

const getDebugIdent = (t, path, fileIdentifier) => {
const { parent } = path;
if (
t.isObjectProperty(parent) ||
t.isReturnStatement(parent) ||
t.isArrayExpression(parent) ||
t.isSpreadElement(parent)
) {
const names = [];
path.findParent(({ node: parentNode }) => {
const name = extractName(t, parentNode, fileIdentifier);
if (name) {
names.unshift(name);
}
});
return names.join('_');
} else {
return extractName(t, parent, fileIdentifier);
}
};
module.exports = function({ types: t }) {

@@ -51,22 +75,7 @@ return {

) {
const { parent, node } = path;
const { node } = path;
if (node.arguments.length === 1) {
let debugIdent;
const debugIdent = getDebugIdent(t, path, this.fileIdentifier);
if (t.isObjectProperty(parent) || t.isReturnStatement(parent)) {
const names = [];
path.findParent(({ node: parentNode }) => {
const name = extractName(t, parentNode);
if (name) {
names.unshift(name);
}
});
debugIdent = names.join('_');
} else {
debugIdent = extractName(t, parent, this.fileIdentifier);
}
if (debugIdent) {

@@ -73,0 +82,0 @@ node.arguments.push(t.stringLiteral(debugIdent));

{
"name": "babel-plugin-treat",
"description": "Babel plugin for treat",
"version": "1.0.4",
"version": "1.1.0",
"main": "index.js",

@@ -12,3 +12,3 @@ "author": "SEEK",

],
"gitHead": "f2af678997d1b69750c73ec79ab277e87c74e5ad"
"gitHead": "61f94e3c0253f20ee44256c011f7733e4337f51e"
}
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