File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
test/library-tests/PackageExports Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,16 @@ bindingset[path]
13
13
private int countSlashes ( string path ) { result = count ( path .splitAt ( "/" ) ) - 1 }
14
14
15
15
/**
16
- * Gets the topmost package.json that appears in the project.
16
+ * Gets the topmost named package.json that appears in the project.
17
17
*
18
18
* There can be multiple results if the there exists multiple package.json that are equally deeply nested in the folder structure.
19
19
* Results are limited to package.json files that are at most nested 2 directories deep.
20
20
*/
21
21
PackageJSON getTopmostPackageJSON ( ) {
22
22
result =
23
23
min ( PackageJSON j |
24
- countSlashes ( j .getFile ( ) .getRelativePath ( ) ) <= 3
24
+ countSlashes ( j .getFile ( ) .getRelativePath ( ) ) <= 3 and
25
+ exists ( j .getPackageName ( ) )
25
26
|
26
27
j order by countSlashes ( j .getFile ( ) .getRelativePath ( ) )
27
28
)
Original file line number Diff line number Diff line change 1
1
getTopmostPackageJSON
2
- | absent_main/package.json:1:1:3:1 | {\\n " ... t.js"\\n} |
3
- | esmodules/package.json:1:1:3:1 | {\\n " ... n.js"\\n} |
4
- | lib1/package.json:1:1:3:1 | {\\n " ... n.js"\\n} |
5
2
getAValueExportedBy
6
3
| absent_main/package.json:1:1:3:1 | {\\n " ... t.js"\\n} | absent_main/index.js:1:1:1:0 | this |
7
4
| absent_main/package.json:1:1:3:1 | {\\n " ... t.js"\\n} | absent_main/index.js:1:1:1:14 | module.exports |
You can’t perform that action at this time.
0 commit comments