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

babel-plugin-jsdoc-closure

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-jsdoc-closure - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

6

index.js

@@ -123,2 +123,8 @@ const parseComment = require('comment-parser');

comment = babel.transform(`/*${newComment}*/`).ast.comments[0];
if (path.parent && path.parent.type == 'ReturnStatement') {
const parenthesized = babel.types.parenthesizedExpression(node);
parenthesized.comments = path.parent.argument.comments;
delete path.parent.argument.comments;
path.parent.argument = parenthesized;
}
comments[i] = comment;

@@ -125,0 +131,0 @@ } else {

2

package.json
{
"name": "babel-plugin-jsdoc-closure",
"version": "1.3.2",
"version": "1.3.3",
"description": "Transpiles JSDoc types from namepaths to types for Closure Compiler",

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

@@ -42,2 +42,20 @@ const babel = require('babel-core');

it('transforms a type cast with an imported module in a return statement', function() {
// requires recast, and causes line break changes unfortunately
const source =
'/** @module module2/types */\n' +
'function getFoo() {\n' +
' return /** @type {module:module1/Bar} */ (bar.getBar());\n' +
'}';
const expected =
'/** @module module2/types */\n' +
'function getFoo() {\n' +
' return (\n /** @type {module1$Bar} */\n (bar.getBar())\n );\n' +
'}\n' +
'const module1$Bar = require(\'../module1/Bar\');';
const filename = './test/module2/types.js';
const got = babel.transform(source, Object.assign({filename}, recastOptions));
assert.equal(got.code, expected);
});
it('transforms a type with an imported default export', function() {

@@ -44,0 +62,0 @@ test(

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