pub trait Resolver {
    fn resolve<'js>(
        &mut self,
        ctx: Ctx<'js>,
        base: &str,
        name: &str
    ) -> Result<String>; }
Available on crate feature loader only.
Expand description

Module resolver interface

Required Methods

Normalize module name

The resolving may looks like:

Ok(if !name.starts_with('.') {
    name.into()
} else {
    let mut split = base.rsplitn(2, '/');
    let path = match (split.next(), split.next()) {
        (_, Some(path)) => path,
        _ => "",
    };
    format!("{}/{}", path, name)
})

Implementations on Foreign Types

Available on crate feature loader only.
Available on crate feature loader only.
Available on crate feature loader only.
Available on crate feature loader only.
Available on crate feature loader only.
Available on crate feature loader only.
Available on crate feature loader only.
Available on crate feature loader only.

Implementors