Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Spec #9

Merged
merged 17 commits into from
May 13, 2024
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,9 @@ These helper methods are designed to allow for determining the static public exp
imports of a module, but do not give information about the internal module identifiers or dynamic
import.

### `ModuleSource.prototype.metadata()`
### `AbstractModuleSource.prototype.imports()`

Returns metadata about the modular structure of the module:

```ts
interface ModuleMetadata {
imports: Import[],
hasDynamicImport: bool,
hasImportMeta: bool,
hasTopLevelAwait: bool,
}
```

where `Import` is deifned by:
Returns a list of the imports of the module of the form `Import[]` defined by:

```ts
interface Import {
Expand All @@ -145,10 +134,17 @@ interface Import {
}
```

* `hasDynamicImport` is *true* if and only if there is usage of dynamic import.
* `hasImportMeta` is *true* if and only if there is usage of import meta.
* `hasTopLevelAwait` is *true* if and only if there is usage of top-level await in the module.
### `AbstractModuleSource.prototype.hasDynamicImport`

A boolean property indicating if the module may call dynamic import.
guybedford marked this conversation as resolved.
Show resolved Hide resolved

### `AbstractModuleSource.prototype.hasImportMeta`

A boolean property indicating if the module accesses the module `import.meta`.

### `AbstractModuleSource.prototype.hasTopLevelAwait`

A boolean property indicating if the module contains use of top-level await.

### Dynamic Import

Expand Down
Loading
Loading