expand_esm_template
Stable function · Other
Tier: stable · Kind: function · Topic: Other
| Python | Julia | Rust |
|---|---|---|
expand_esm_template | expand_esm_template | expand_esm_template |
Python
expand_esm_template(template: str, anchor: _dt.datetime | None = None, substitutions: Mapping[str, str] | None = None) -> str
Expand an esm URL template at anchor (a UTC instant; a naive datetime
is read as UTC) with substitutions. See spec/esm-sources.md §1.
Julia
expand_esm_template(template::AbstractString; ...)
expand_esm_template(template::AbstractString, anchor; substitutions)
expand_esm_template(template, anchor=nothing; substitutions=Dict()) -> String
Expand an esm URL template (spec/esm-sources.md §1) at anchor — a UTC
DateTime, Unix seconds, or nothing — with substitutions (name => string).
Errors are EsmTemplateError
s carrying a §1.3 code.
Rust
pub fn expand_esm_template(template: &str, anchor: Option<OffsetDateTime>, substitutions: &BTreeMap<String, String>) -> Result<String, EsmTemplateError>
Expand an esm URL template (spec/esm-sources.md §1) at anchor (a UTC
instant; an offset is converted to UTC) with substitutions.