babel-plugin-transform-react-pug
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -24,4 +24,22 @@ 'use strict'; | ||
var code = _ref.code; | ||
var t = babel.types; | ||
var types = babel.types; | ||
var baseLine = path.node.loc.start.line; | ||
var lastLine = 0; | ||
var t = {}; | ||
function getFn(key) { | ||
return function () { | ||
var res = types[key].apply(types, arguments); | ||
var loc = { line: baseLine + lastLine, column: 0 }; | ||
res.loc = { start: loc, end: loc }; | ||
return res; | ||
}; | ||
} | ||
for (var key in types) { | ||
if (/^is|^assert/.test(key)) { | ||
t[key] = types[key]; | ||
} else { | ||
t[key] = getFn(key); | ||
} | ||
} | ||
var nodes = t.identifier('pug_nodes'); | ||
@@ -343,2 +361,3 @@ function withString(node, stringLiteral) { | ||
if (typeof this['visit' + node.type] === 'function') { | ||
lastLine = node.line; | ||
return this['visit' + node.type](node, mode, block); | ||
@@ -345,0 +364,0 @@ } else { |
{ | ||
"name": "babel-plugin-transform-react-pug", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "A plugin for transpiling pug templates to jsx", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29364
665
0