Comparing version 3.0.0 to 3.0.1
@@ -21,2 +21,16 @@ import * as path from "path"; | ||
test("analyze line-report directory", async () => { | ||
const directory = path.resolve(__dirname, "../fixtures/line-report"); | ||
const analysis = await analyze({ | ||
directory, | ||
relativePaths: true, | ||
components: ["div"], | ||
prop: "id", | ||
}); | ||
expect(analysis).toMatchSnapshot({ | ||
directory: expect.any(String), | ||
elapsedTime: expect.any(Number), | ||
}); | ||
}); | ||
test("analyze basic directory", async () => { | ||
@@ -23,0 +37,0 @@ const directory = path.resolve(__dirname, "../fixtures/basic"); |
@@ -0,1 +1,5 @@ | ||
# v3.0.1 | ||
- Fixes a bug where most props were ignored when searching by prop | ||
# v3.0.0 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "jsx-info", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "displays a report of JSX component and prop usage", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/api.js", |
@@ -0,0 +0,0 @@ import { ParserPlugin } from "@babel/parser"; |
@@ -114,14 +114,17 @@ "use strict"; | ||
if (wantPropKey && prop.propName !== wantPropKey) { | ||
return; | ||
continue; | ||
} | ||
if (!match(prop.propValue)) { | ||
return; | ||
continue; | ||
} | ||
reporter.addProp(componentName, prop.propName, { | ||
propCode: prop.propCode, | ||
startLoc: prop.startLoc, | ||
endLoc: prop.endLoc, | ||
prettyCode: formatPrettyCode(code, prop.startLoc.line, prop.endLoc.line), | ||
filename: processFilename(filename), | ||
}); | ||
if ((!wantPropKey || prop.propName === wantPropKey) && | ||
match(prop.propValue)) { | ||
reporter.addProp(componentName, prop.propName, { | ||
propCode: prop.propCode, | ||
startLoc: prop.startLoc, | ||
endLoc: prop.endLoc, | ||
prettyCode: formatPrettyCode(code, prop.startLoc.line, prop.endLoc.line), | ||
filename: processFilename(filename), | ||
}); | ||
} | ||
} | ||
@@ -128,0 +131,0 @@ } |
export declare function assertNever(value: never): never; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ParserPlugin } from "@babel/parser"; |
@@ -0,0 +0,0 @@ "use strict"; |
#!/usr/bin/env node | ||
export {}; |
@@ -0,0 +0,0 @@ #!/usr/bin/env node |
export declare function main(): Promise<void>; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import ora from "ora"; |
@@ -0,0 +0,0 @@ "use strict"; |
export declare function sleep(): Promise<void>; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "jsx-info", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "displays a report of JSX component and prop usage", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/api.js", |
@@ -174,18 +174,23 @@ import { parse as babelParse, ParserPlugin } from "@babel/parser"; | ||
if (wantPropKey && prop.propName !== wantPropKey) { | ||
return; | ||
continue; | ||
} | ||
if (!match(prop.propValue)) { | ||
return; | ||
continue; | ||
} | ||
reporter.addProp(componentName, prop.propName, { | ||
propCode: prop.propCode, | ||
startLoc: prop.startLoc, | ||
endLoc: prop.endLoc, | ||
prettyCode: formatPrettyCode( | ||
code, | ||
prop.startLoc.line, | ||
prop.endLoc.line | ||
), | ||
filename: processFilename(filename), | ||
}); | ||
if ( | ||
(!wantPropKey || prop.propName === wantPropKey) && | ||
match(prop.propValue) | ||
) { | ||
reporter.addProp(componentName, prop.propName, { | ||
propCode: prop.propCode, | ||
startLoc: prop.startLoc, | ||
endLoc: prop.endLoc, | ||
prettyCode: formatPrettyCode( | ||
code, | ||
prop.startLoc.line, | ||
prop.endLoc.line | ||
), | ||
filename: processFilename(filename), | ||
}); | ||
} | ||
} | ||
@@ -192,0 +197,0 @@ } |
Sorry, the diff of this file is not supported yet
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
104052
42
2054