babel-plugin-aff-mock
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -14,3 +14,4 @@ const fs = require("fs"); | ||
const comments = path.node.leadingComments || []; | ||
const comment = comments.filter((item) => item.value.includes("aff-mock:"))[0]; | ||
const affMockComments = comments.filter((item) => item.value.includes("aff-mock:")); | ||
let comment = affMockComments[0]; | ||
@@ -21,4 +22,13 @@ if (!comment) { | ||
const data = comment.value.split(":"); | ||
let data = comment.value.split(":"); | ||
const index = Number(data[data.length - 1]) || 1; | ||
comment = affMockComments[index - 1]; | ||
if (!comment) { | ||
return; | ||
} | ||
data = comment.value.split(":"); | ||
const pathUrl = data[1].trim(); | ||
@@ -25,0 +35,0 @@ if (!fs.existsSync(pathLib.join(process.cwd(), pathUrl))) { |
{ | ||
"name": "babel-plugin-aff-mock", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "AFF Mock", | ||
@@ -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
2620
51