mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-19 00:42:28 -05:00
Add auto-import for the package.json imports field (#55015)
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com> Co-authored-by: Andrew Branch <andrew@wheream.io>
This commit is contained in:
@@ -915,6 +915,11 @@ export function isPackageJsonInfo(entry: PackageJsonInfoCacheEntry | undefined):
|
||||
return !!(entry as PackageJsonInfo | undefined)?.contents;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function isMissingPackageJsonInfo(entry: PackageJsonInfoCacheEntry | undefined): entry is MissingPackageJsonInfo {
|
||||
return !!entry && !(entry as PackageJsonInfo).contents;
|
||||
}
|
||||
|
||||
export interface PackageJsonInfoCache {
|
||||
/** @internal */ getPackageJsonInfo(packageJsonPath: string): PackageJsonInfoCacheEntry | undefined;
|
||||
/** @internal */ setPackageJsonInfo(packageJsonPath: string, info: PackageJsonInfoCacheEntry): void;
|
||||
|
||||
Reference in New Issue
Block a user