bidirectional-resolve
Version:
Resolve a package entry point to a file path (like require.resolve/import.meta.resolve) OR a file path to a package entry point
11 lines • 383 B
TypeScript
import type { PackageJson } from 'type-fest';
import type { SubpathMappings } from "./resolvers.js";
/**
* Flatten entry points within a `package.json` `imports`/`exports` map into a
* one dimensional array of subpath-target mappings.
*/
export declare function flattenPackageJsonSubpathMap({
map
}: {
map: PackageJson['exports'] | PackageJson['imports'];
}): SubpathMappings;