@109cafe/label / resolve
resolve<
F
,T
>(from
,to
):F
&T
Resolve a label from another label
• F extends Label
• T extends Partial
<Label
>
• from: F
the label to resolve from
• to: T
the label to resolve to
F
& T
import { resolve } from "@109cafe/label";
resolve({ package: "foo" }, { package: "bar" }); // { package: "foo/bar" }
resolve({ package: "foo" }, { scope: "", package: "bar" }); // { package: "//bar" }
resolve({ package: "foo" }, { package: "bar", target: "baz" }); // { package: "foo/bar", target: "baz" }
resolve({ package: "foo", target: "bar" }, { includeSubPackages: true }); // { package: "foo", includeSubPackages: true, target: "bar" }
CannotResolveFromSubPackages if the from
label includes subpackages