Skip to content

Documentation / @etherfold/core / moduleReferencesOf

Function: moduleReferencesOf() ​

moduleReferencesOf(bundle): readonly string[]

Defined in: packages/core/src/processorArtifact.ts:117

EVERY MODULE A BUNDLE STILL NAMES, in the order it carries them and each named once. Which of them a runtime can RESOLVE from bytes is that runtime's answer, not this one's: Node resolves its builtins (unresolvedImportsOf, @etherfold/utils, filters them out), and a browser resolves none, so there every entry is an unresolved import.

It reads TEXT and is not a parser, so what it can get wrong is bounded by where each half of MODULE_REFERENCE is strict -- read it, because the asymmetry is the argument. A bundle embedding JavaScript source in a string literal can be reported for an import that is not one: the safe direction, since a refusal names the specifier and the author can see exactly what was matched. A COMPUTED dynamic specifier (import(name)) is invisible to it, as it would be to anything static.

Parameters ​

bundle ​

Uint8Array

Returns ​

readonly string[]