babel-plugin-transform-invariant-location
Advanced tools
Comparing version 1.0.0 to 1.0.1
13
index.js
@@ -14,3 +14,14 @@ const visited = new WeakSet() | ||
const location = `${this.getModuleName()}.js:${path.node.loc.start.line}` | ||
let moduleName = this.getModuleName() | ||
if (moduleName) { | ||
moduleName = t.stringLiteral(moduleName) + '.js' | ||
} else { | ||
try { | ||
moduleName = this.file.opts.filename.replace(`${this.cwd}/`, '') | ||
} catch (err) { | ||
return | ||
} | ||
} | ||
const location = `${moduleName}:${path.node.loc.start.line}` | ||
const message = path.node.arguments.length === 2 ? | ||
@@ -17,0 +28,0 @@ `${path.node.arguments[1].value} -- ${location}` : |
{ | ||
"name": "babel-plugin-transform-invariant-location", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Babel plugin that rewrites invariant calls with their source location", | ||
@@ -5,0 +5,0 @@ "main": "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
3072
5
34