Load all types not no types from Npm Package when no types are specified

This commit is contained in:
Grahame Grieve 2023-03-11 18:54:23 +11:00
parent 83f608597a
commit 957e9fe7cc
1 changed files with 12 additions and 3 deletions

View File

@ -550,10 +550,19 @@ public class NpmPackage {
public List<String> listResources(String... types) throws IOException {
List<String> res = new ArrayList<String>();
NpmPackageFolder folder = folders.get("package");
for (String s : types) {
if (folder.types.containsKey(s))
if (types.length == 0) {
for (String s : folder.types.keySet()) {
if (folder.types.containsKey(s)) {
res.addAll(folder.types.get(s));
}
}
} else {
for (String s : types) {
if (folder.types.containsKey(s)) {
res.addAll(folder.types.get(s));
}
}
}
Collections.sort(res);
return res;
}