Load all types not no types from Npm Package when no types are specified
This commit is contained in:
parent
83f608597a
commit
957e9fe7cc
|
@ -550,9 +550,18 @@ 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))
|
||||
res.addAll(folder.types.get(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;
|
||||
|
|
Loading…
Reference in New Issue