MCPcopy Create free account
hub / github.com/Effect-TS/effect / exportedTarget

Function exportedTarget

packages/tools/api-diff/src/Discovery.ts:36–50  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

34const decodePackageManifest = Schema.decodeUnknownEffect(Schema.fromJsonString(PackageManifest))
35
36const exportedTarget = (value: unknown): string | null | undefined => {
37 if (value === null || typeof value === "string") {
38 return value
39 }
40 if (typeof value !== "object" || value === null) {
41 return undefined
42 }
43 for (const condition of ["types", "import", "default", "node", "browser"]) {
44 const target = exportedTarget(Reflect.get(value, condition))
45 if (target !== undefined) {
46 return target
47 }
48 }
49 return undefined
50}
51
52const matchPattern = (pattern: string, value: string): string | undefined => {
53 const star = pattern.indexOf("*")

Callers 1

DiscoveryClass · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected