Skip to content

@saflib/imports


Function: matchExportPattern()

matchExportPattern(importKey, patternKey, patternTarget): null | string

Match a Node.js package.json exports subpath pattern.

Node allows one * per pattern key and target. The * is string substitution: the capture may include / (nested subpaths).

Parameters

ParameterType
importKeystring
patternKeystring
patternTargetstring

Returns

null | string

See

https://nodejs.org/api/packages.html#subpath-patterns