emit_document
Stable function · Document I/O
Tier: stable · Kind: function · Topic: Document I/O
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
| not exported | emitDocument | emit_document | not exported | not exported |
Julia
Julia does not export this function.
TypeScript
function emitDocument(rawSource: unknown, basePath: string, options?: TemplateResolveOptions): JsonObject
Produce the reference-preserving, self-contained emitted document (esm-spec
§9.6.4 rule 5, RFC out-of-line-expression-templates §7.5) from a source
document rawSource (a fixture, or an already-emitted document for the
idempotency property; relative import refs resolve against basePath). Loads
rawSource under Option B, then materializes each component’s surviving
reference closure into its expression_templates block, drops consumed
imports, and version-stamps esm: 0.9.0 when any reference/materialized entry
remains (§9.6.4 rule 8). emitEsmString ∘ emitDocument is a byte-wise fixed
point under reload. Mirrors the Julia reference emit_document.
rawSource passes the same wire boundary a load applies
(prepareDocumentOps), on a copy: a removed op is refused, and a
deprecated neg / pow is rewritten with the deprecated_op warning, so
neither spelling survives into the emitted document (esm-spec §4.2).
Python
emit_document(raw_source: Any, base_path: str) -> dict
Produce the reference-preserving, self-contained emitted document
(esm-spec §9.6.4 rule 5, RFC out-of-line-expression-templates §7.5) from a
source document (a fixture, or an already-emitted document for the
idempotency property). Loads raw_source under Option B, then for every
component builds its emitted expression_templates block — authored
match-less entries first in authored order, then the materialized transitive
closure of its surviving references (match-less), lexicographically sorted —
drops consumed expression_template_imports, and version-stamps
esm: 0.9.0 when any surviving reference or materialized entry remains
(§9.6.4 rule 8). emit_esm_string ∘ emit_document is a byte-wise fixed
point under reload.
raw_source passes the same wire boundary a load applies
(earthsci_ast.parse.prepare_document_ops), on a copy: a removed op
is refused, and a deprecated neg / pow is rewritten with the
deprecated_op warning, so neither spelling survives into the emitted
document (esm-spec §4.2).
Rust
Rust does not export this function.
Go
Go does not export this function.