@endo/compartment-mapper
Version:
The compartment mapper assembles Node applications in a sandbox
71 lines (27 loc) • 2.15 kB
JavaScript
/**
* Types for subpath pattern matching.
*
* @module
*/
/**
* Result of a successful pattern match.
*/
/**
* A function that attempts to match a specifier against patterns
* and returns the replacement path (with optional compartment), or null if no match.
*/
/**
* Input format for pattern mappings - either an array of tuples,
* an array of PatternDescriptors, or a record object.
*/
/**
* Internal representation of a parsed pattern entry, split into
* prefix/suffix for efficient matching.
*/
/**
* A pattern descriptor for wildcard-based module resolution.
* The `from` pattern is matched against module specifiers,
* and `to` is the replacement pattern.
*
* Wildcards (`*`) match any substring including `/` (Node.js semantics).
*/