babel-plugin-jsdoc-closure
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -7,3 +7,7 @@ const parseComment = require('comment-parser'); | ||
function parseModules(type) { | ||
return type.match(/module\:[^ \|\}\>,=\n]+/g); | ||
return type.match(/module\:[^ \|\}\>\),=\n]+/g).map(match => { | ||
// Strip incomplete type applications (e.g. `.<T`) from comment-parser. | ||
//TODO Fix this with a custom parser instead. | ||
return match.replace(/\.?\<.*$/, ''); | ||
}); | ||
} | ||
@@ -10,0 +14,0 @@ |
{ | ||
"name": "babel-plugin-jsdoc-closure", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Transpiles JSDoc types from namepaths to types for Closure Compiler", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -81,2 +81,16 @@ const babel = require('babel-core'); | ||
it('transforms a type with type application of module paths', function() { | ||
test( | ||
'/** @module module2/types */\n' + | ||
'/** @type {module:types~foo.<module:types~bar>} */\n' + | ||
'let foo;\n', | ||
'/** @module module2/types */\n' + | ||
'/** @type {_types_foo.<_types_bar>} */\n' + | ||
'let foo;' + '\n' + | ||
'const _types_foo = require(\'../types\').foo;\n' + | ||
'const _types_bar = require(\'../types\').bar;', | ||
'./test/module2/types.js' | ||
); | ||
}); | ||
it('resolves path correctly for index.js files', function() { | ||
@@ -83,0 +97,0 @@ test( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17556
351