Created
April 24, 2019 09:24
-
-
Save zindel/f7184133a20d1ad9e0233df9bdba6985 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let resolve = | |
( | |
~fullMetadata=false, | |
~name: string, | |
~spec: option(VersionSpec.t)=?, | |
resolver: t, | |
) => | |
RunAsync.Syntax.( | |
switch (Resolutions.find(resolver.resolutions, name)) { | |
| Some(resolution) => | |
/* increment usage counter for that resolution so that we know it was used */ | |
markResolutionAsUsed(resolver, resolution); | |
return([resolution]); | |
| None => | |
let spec = | |
switch (spec) { | |
| None => | |
if (InstallManifest.isOpamPackageName(name)) { | |
VersionSpec.Opam([[OpamPackageVersion.Constraint.ANY]]); | |
} else { | |
VersionSpec.Npm([[SemverVersion.Constraint.ANY]]); | |
} | |
| Some(spec) => spec | |
}; | |
resolve'(~fullMetadata, ~name, ~spec, resolver); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment