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 23, 2024
1 parent 06ce46e commit 8fa9609
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 @@ -193,6 +193,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 8fa9609

Please sign in to comment.