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

Method mayDeclare

ark/aot/graph.ts:4182–4194  ·  view source on GitHub ↗
(
		cls: Located,
		name: unknown,
		seen = new Set<Node>()
	)

Source from the content-addressed store, hash-verified

4180 }
4181
4182 private mayDeclare(
4183 cls: Located,
4184 name: unknown,
4185 seen = new Set<Node>()
4186 ): boolean {
4187 if (fieldValuesOf(cls.node)[name as string] || seen.has(cls.node))
4188 return true
4189 seen.add(cls.node)
4190 const superClass = "superClass" in cls.node && cls.node.superClass
4191 if (!superClass) return false
4192 const parent = this.classOf(superClass, cls.module, cls.kindOfKey)
4193 return !parent || this.mayDeclare(parent, name, seen)
4194 }
4195
4196 // e.g. data for `opts.db` given `route({ db, input: type(...) })`, or
4197 // `$setup.User` in a Vue render function

Callers 1

fieldKindInMethod · 0.95

Calls 4

classOfMethod · 0.95
fieldValuesOfFunction · 0.85
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected