Skip to content

Commit

Permalink
0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ityuany committed Jun 1, 2024
1 parent f94d2fd commit 6688626
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion __test__/fixtures/demo13/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ function A() {

function B() {
return <G>xx</G>
}
}

G.a;
10 changes: 8 additions & 2 deletions __test__/index.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ test('should to be 1 when use React.createElement', async (t) => {
test('should to be 2 when use alias', async (t) => {
const workspace = path.join(__dirname,"fixtures/demo13");
const res = await inspectPackageUsage(workspace,["antd"]);
t.is(res.length, 2);
t.is(res.length, 3);
res.forEach((item)=>{
t.is(item.memberName, "Grid")
});

})

test('should to be 4 when directory name end with .ts', async (t) => {
Expand All @@ -102,4 +106,6 @@ test('should to be 4 when valid UTF-8', async (t) => {
const workspace = path.join(__dirname,"fixtures/demo15");
const res = await inspectPackageUsage(workspace,["antd"]);
t.is(res.length, 0);
})
})


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shined/package-exported-usage",
"version": "0.0.8",
"version": "0.0.9",
"main": "index.js",
"types": "index.d.ts",
"napi": {
Expand Down
4 changes: 2 additions & 2 deletions src/vistor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl<'a> Visit<'a> for ImportVisitor<'a> {
} else {
self.used.push(Location {
lib_name: v.npm_lib_name.to_string(),
member_name: name,
member_name: v.imported_name.to_string(),
start: reference.span.start,
end: reference.span.end,
file_path: self.file_path.to_string(),
Expand All @@ -131,7 +131,7 @@ impl<'a> Visit<'a> for ImportVisitor<'a> {
} else {
self.used.push(Location {
lib_name: v.npm_lib_name.to_string(),
member_name: name,
member_name: v.imported_name.to_string(),
start: reference.span.start,
end: reference.span.end,
file_path: self.file_path.to_string(),
Expand Down

0 comments on commit 6688626

Please sign in to comment.