swc_core::ecma::utils

Trait StmtLikeInjector

pub trait StmtLikeInjector<S>
where S: StmtLike,
{ // Required methods fn prepend_stmt(&mut self, insert_with: S); fn prepend_stmts<I>(&mut self, insert_with: I) where I: IntoIterator<Item = S>; }
Available on crate features __ecma and __utils only.
Expand description

Prepends statements after directive statements.

Required Methods§

fn prepend_stmt(&mut self, insert_with: S)

fn prepend_stmts<I>(&mut self, insert_with: I)
where I: IntoIterator<Item = S>,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl<S> StmtLikeInjector<S> for Vec<S>
where S: StmtLike,

§

fn prepend_stmt(&mut self, insert_with: S)

Note: If there is no directive, use insert instead.

§

fn prepend_stmts<I>(&mut self, insert_with: I)
where I: IntoIterator<Item = S>,

Note: If there is no directive, use splice instead.

Implementors§