Skip to content

Commit

Permalink
feat(ast): add TSModuleDeclarationName::binding_identifier()
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Sep 24, 2024
1 parent 5238027 commit f03d407
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/oxc_ast/src/ast_impl/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ impl<'a> TSModuleDeclarationName<'a> {
Self::StringLiteral(lit) => lit.value.clone(),
}
}

pub fn binding_identifier(&self) -> Option<&BindingIdentifier<'a>> {
match self {
Self::Identifier(ident) => Some(ident),
Self::StringLiteral(_) => None,
}
}
}

impl<'a> fmt::Display for TSModuleDeclarationName<'a> {
Expand Down

0 comments on commit f03d407

Please sign in to comment.