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]
1313private int countSlashes ( string path ) { result = count ( path .splitAt ( "/" ) ) - 1 }
1414
1515/**
16- * Gets the topmost package.json that appears in the project.
16+ * Gets the topmost named package.json that appears in the project.
1717 *
1818 * There can be multiple results if the there exists multiple package.json that are equally deeply nested in the folder structure.
1919 * Results are limited to package.json files that are at most nested 2 directories deep.
2020 */
2121PackageJSON getTopmostPackageJSON ( ) {
2222 result =
2323 min ( PackageJSON j |
24- countSlashes ( j .getFile ( ) .getRelativePath ( ) ) <= 3
24+ countSlashes ( j .getFile ( ) .getRelativePath ( ) ) <= 3 and
25+ exists ( j .getPackageName ( ) )
2526 |
2627 j order by countSlashes ( j .getFile ( ) .getRelativePath ( ) )
2728 )
Original file line number Diff line number Diff line change 11getTopmostPackageJSON
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} |
52getAValueExportedBy
63| absent_main/package.json:1:1:3:1 | {\\n " ... t.js"\\n} | absent_main/index.js:1:1:1:0 | this |
74| 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