feat: remove unnecessary check in moduleResolver.ts (#2068)

This commit is contained in:
那些花儿
2019-12-09 17:06:02 +01:00
committed by Franck Abgrall
parent c2bd6ded50
commit bd71e434d9
@@ -212,19 +212,17 @@ class ModuleResolver {
if (req.startsWith('@')) {
const pkg = resolveScopePackage(req)
if (pkg) {
// special handling for default org.
if (this.org && pkg.org === this.org) {
shortcut = pkg.name.startsWith(`${this.type}-`)
? pkg.name.slice(this.typePrefixLength)
: pkg.name
name = `${this.scopePrefix}${shortcut}`
} else {
shortcut = this.getShortcut(pkg.name)
name = `@${pkg.org}/${this.nonScopePrefix}${shortcut}`
}
shortcut = `@${pkg.org}/${shortcut}`
// special handling for default org.
if (this.org && pkg.org === this.org) {
shortcut = pkg.name.startsWith(`${this.type}-`)
? pkg.name.slice(this.typePrefixLength)
: pkg.name
name = `${this.scopePrefix}${shortcut}`
} else {
shortcut = this.getShortcut(pkg.name)
name = `@${pkg.org}/${this.nonScopePrefix}${shortcut}`
}
shortcut = `@${pkg.org}/${shortcut}`
} else {
shortcut = this.getShortcut(req)
name = `${this.nonScopePrefix}${shortcut}`