v2.0.0
Breaking
- Changed the
resolve
return signature fromstring | undefined
tostring[] | undefined
:
Previouslyresolve.exports
could only return 1 string output. This ignored"imports"
and"exports"
entries that could return multiple resolved locations (aka "alternatives").
Nowresolve.exports
supports arrayable entries and normalizes all outputs into arrays. This makes it easier for consumers to uniformly traverse the output (or simply take the first item).
Features
-
NEW Add
imports
function to resolve"imports"
identifiers: #14 -
NEW Add
exports
function to resolve"exports"
maps exclusively
Note: This is identical to theresolve
function from[email protected]
release. -
Converted the
resolve
function to be a convenience helper.
Note: Its API signature is unchanged. However, it also now accepts import specifiers. If an import identifier (eg,#foo
or<package>/#foo
) is received, then theimports()
function is invoked. Otherwise theexports()
function is called. -
Support array values (#17)
Chores
- Converted source code to strict TypeScript
- Add Node 16.x and 18.x to CI matrix
Full Changelog: v1.1.1...v2.0.0