no-mistakes-postgres-engine 0.109.131

PostgreSQL embedded SQL extraction, schema catalog, and replay-safety analysis for no-mistakes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()
}