Skip to content

Commit

Permalink
always call host hook for objects, separate metadata methods
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed May 9, 2024
1 parent 25d4c4f commit 6a188c0
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 92 deletions.
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.
### `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

0 comments on commit 6a188c0

Please sign in to comment.