(req: DependencyRequestPattern)
| 621 | } |
| 622 | |
| 623 | resolveToResolution(req: DependencyRequestPattern): ?DependencyRequestPattern { |
| 624 | const {parentNames, pattern} = req; |
| 625 | |
| 626 | if (!parentNames || this.flat) { |
| 627 | return req; |
| 628 | } |
| 629 | |
| 630 | const resolution = this.resolutionMap.find(pattern, parentNames); |
| 631 | |
| 632 | if (resolution) { |
| 633 | const resolutionManifest = this.getResolvedPattern(resolution); |
| 634 | |
| 635 | if (resolutionManifest) { |
| 636 | invariant(resolutionManifest._reference, 'resolutions should have a resolved reference'); |
| 637 | resolutionManifest._reference.patterns.push(pattern); |
| 638 | this.addPattern(pattern, resolutionManifest); |
| 639 | const lockManifest: ?LockManifest = this.lockfile.getLocked(pattern); |
| 640 | if (shouldUpdateLockfile(lockManifest, resolutionManifest._reference)) { |
| 641 | this.lockfile.removePattern(pattern); |
| 642 | } |
| 643 | } else { |
| 644 | this.resolutionMap.addToDelayQueue(req); |
| 645 | } |
| 646 | return null; |
| 647 | } |
| 648 | |
| 649 | return req; |
| 650 | } |
| 651 | } |
no test coverage detected