MCPcopy Create free account
hub / github.com/arktypeio/arktype / jsonExportOf

Method jsonExportOf

ark/aot/graph.ts:1573–1595  ·  view source on GitHub ↗
(
		target: Extract<ImportTarget, { kind: "json" }>,
		name: string
	)

Source from the content-addressed store, hash-verified

1571 }
1572
1573 private jsonExportOf(
1574 target: Extract<ImportTarget, { kind: "json" }>,
1575 name: string
1576 ): ImportTarget {
1577 return (
1578 name === "default" ? { ...target, name }
1579 : (
1580 hasDomain(target.value, "object") &&
1581 !Array.isArray(target.value) &&
1582 hasOwn(target.value, name)
1583 ) ?
1584 {
1585 kind: "json",
1586 id: target.id,
1587 name,
1588 value: Reflect.get(target.value, name)
1589 }
1590 : {
1591 kind: "unresolved",
1592 message: `${this.pathOf(target.id)} has no export \`${name}\``
1593 }
1594 )
1595 }
1596
1597 arkExportOf(
1598 reference: Reference,

Callers 2

importOfMethod · 0.95
exportOfMethod · 0.95

Calls 4

pathOfMethod · 0.95
hasDomainFunction · 0.90
hasOwnFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected