MCPcopy Create free account
hub / github.com/microsoft/typescript-go / GetPackageJsonInfo

Method GetPackageJsonInfo

internal/compiler/program.go:146–153  ·  view source on GitHub ↗

GetPackageJsonInfo implements checker.Program.

(pkgJsonPath string)

Source from the content-addressed store, hash-verified

144
145// GetPackageJsonInfo implements checker.Program.
146func (p *Program) GetPackageJsonInfo(pkgJsonPath string) *packagejson.InfoCacheEntry {
147 directory := tspath.GetDirectoryPath(pkgJsonPath)
148 scoped := p.resolver.GetPackageScopeForPath(directory)
149 if scoped != nil && scoped.Exists() && scoped.PackageDirectory == directory {
150 return scoped
151 }
152 return nil
153}
154
155// PackageJsonCacheEntries iterates on all package json cache entries.
156func (p *Program) PackageJsonCacheEntries(f func(key tspath.Path, value *packagejson.InfoCacheEntry) bool) {

Callers 1

GetSymlinkCacheMethod · 0.95

Calls 3

GetDirectoryPathFunction · 0.92
ExistsMethod · 0.45

Tested by

no test coverage detected