insideFolder<T extends DartElement> static method
Filter<T>
insideFolder<
T extends DartElement>( - String folder, {
- bool includeNested = true,
})
Implementation
static Filter<T> insideFolder<T extends DartElement>(
String folder, {
bool includeNested = true,
}) {
final description;
if (includeNested) {
description = 'are inside folder "$folder"';
} else {
description = 'are directly inside folder "$folder"';
}
return Filter(
(el) {
// The last one will be the file name
final folders = el.location.library.split('/')..removeLast();
if (!includeNested) {
return folders.last == folder;
} else {
return folders.contains(folder);
}
},
description: description,
);
}