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

Function classExposesMembers

ark/aot/usage.ts:1875–1895  ·  view source on GitHub ↗
(
	cls: Extract<Node, { type: "ClassDeclaration" | "ClassExpression" }>,
	module: SourceModule,
	ctx: ThisReadsContext
)

Source from the content-addressed store, hash-verified

1873}
1874
1875const classExposesMembers = (
1876 cls: Extract<Node, { type: "ClassDeclaration" | "ClassExpression" }>,
1877 module: SourceModule,
1878 ctx: ThisReadsContext
1879): boolean => {
1880 const clsBinding =
1881 cls.type === "ClassDeclaration" ?
1882 cls.id && module.scopes.bindingsById.get(cls.id)
1883 : (() => {
1884 const [op, parent] = operatorOf(cls)
1885 return (
1886 parent?.type === "VariableDeclarator" &&
1887 parent.init === op &&
1888 parent.id.type === "Identifier"
1889 ) ?
1890 module.scopes.bindingsById.get(parent.id)
1891 : undefined
1892 })()
1893 if (!clsBinding || clsBinding.writes.length > 0) return true
1894 return classBindingExposes(clsBinding, module, ctx, new Set(), new Set())
1895}
1896
1897const classBindingExposes = (
1898 binding: Binding,

Callers 2

computeSkippedFunctionFunction · 0.85
classBindingExposesFunction · 0.85

Calls 3

operatorOfFunction · 0.90
classBindingExposesFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected