Skip to content

Commit

Permalink
Couple of small structure and plurality fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdavidmills authored May 22, 2024
1 parent 013357c commit 212889d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions files/en-us/web/html/element/script/type/importmap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ You can use the `integrity` key to provide mapping for module [integrity metadat
This enables you to ensure the integrity of dynamically or statically imported modules.
`integrity` also enables you to provide a fallback for top-level or preloaded modules, in case they don't already include an `integrity` attribute.

The map keys represent a module URL. This can be absolute or relative (starting with `/`, `./`, or `../`).
The map values represent integrity metadata, identical to that used as an [`integrity`](/en-US/docs/Web/HTML/Element/script#integrity) attribute value.
The map keys represent module URLs, which can be absolute or relative (starting with `/`, `./`, or `../`).
The map values represent integrity metadata, identical to that used in [`integrity`](/en-US/docs/Web/HTML/Element/script#integrity) attribute values.

For example, the map below defines integrity metadata for the `square.js` module (directly) and its bare specifier (transitively, via the `imports` key).

Expand Down Expand Up @@ -193,6 +193,14 @@ The import map must be a valid JSON object that can define at most two optional
A key with a trailing `/` can be used as a prefix for when mapping (or remapping) modules addresses.
- The object properties' ordering is irrelevant: if multiple keys can match the module specifier, the most specific key is used (in other words, a specifier "olive/branch/" would match before "olive/").

- `integrity` {{optional_inline}}

- : Defines a valid JSON object where the _keys_ are strings containing valid absolute URLs or relative URLs starting with `/`, `./`, or `../`,
and the corresponding _values_ are valid [integrity metadata](/en-US/docs/Web/Security/Subresource_Integrity#using_subresource_integrity).

If the URL of a script importing or preloading a module matches a key in the `integrity` object, the corresponding integrity metadata is applied to the script's fetch options,
unless they already have integrity metadata attached to them.

- `scopes` {{optional_inline}}

- : Scopes define path-specific [module specifier maps](#module_specifier_map), allowing the choice of map to depend on the path of the code importing the module.
Expand All @@ -205,14 +213,6 @@ The import map must be a valid JSON object that can define at most two optional

Note that the scope does not change how an address is resolved; relative addresses are always resolved to the import map base URL.

- `integrity` {{optional_inline}}

- : Defines a valid JSON object where the _keys_ are strings containing either a valid absolute URL or relative URL that starts with `/`, `./`, or `../`,
and the corresponding _values_ are valid [integrity metadata](/en-US/docs/Web/Security/Subresource_Integrity#using_subresource_integrity).

If the URL of a script importing or preloading a module matches a key in the `integrity` object, the corresponding integrity metadata is applied to the script's fetch options,
unless they already have integrity metadata attached to them.

## Specifications

{{Specifications}}
Expand Down

0 comments on commit 212889d

Please sign in to comment.