use oxc_ast::ast::Statement;
pub(super) fn declaration_names<'a: 'b, 'b>(
statements: impl Iterator<Item = &'b Statement<'a>>,
) -> Vec<String> {
statements
.filter_map(|statement| match statement {
Statement::FunctionDeclaration(function) => {
function.id.as_ref().map(|id| id.name.to_string())
}
Statement::ClassDeclaration(class) => class.id.as_ref().map(|id| id.name.to_string()),
_ => None,
})
.collect()
}