Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PrefixMapUriResolver

Basic, import-map like UriResolver.

Resolves uris basing on exact or prefix match of key from definitions.

In definitions, key is matched against input uri with following strategy:

  • key without trailing / -> key and input uri must be identical
  • key with trailing /, -> key is treated as "package prefix", so uri must start with key

Example:

{
    "local://poiMasterList": "/assets/poiMasterList.json"
       // will match only 'local://poiMasterList' and resolve `/assets/poiMasterList.json`
    "local://icons/": "/assets/icons/"
       // will match only 'local://icons/ANYPATH' (and similar) and resolve to
       // `/assets/icons/ANYPATH
}

Inspired by WICG import maps proposal.

Hierarchy

  • PrefixMapUriResolver

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Readonly definitions

Methods

resolveUri

  • resolveUri(uri: string): string

Generated using TypeDoc