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

Method isSameType

ark/aot/sameEachRun.ts:242–262  ·  view source on GitHub ↗
(
		binding: Binding,
		module: SourceModule,
		seen: Set<Node>
	)

Source from the content-addressed store, hash-verified

240
241 // a Type is immutable, so it differs only by the functions it holds
242 private isSameType(
243 binding: Binding,
244 module: SourceModule,
245 seen: Set<Node>
246 ): boolean {
247 const value = this.interpreter.valueOfBinding(binding, module)
248 return (
249 isFoldable(value) &&
250 keyOf(value)[1].every(hole => {
251 const standIn =
252 hasDomain(hole, "object") ?
253 this.interpreter.standIns.get(hole)
254 : undefined
255 return (
256 standIn?.closure &&
257 !standIn.closure.env &&
258 this.reads(standIn.closure.node, standIn.module, seen)
259 )
260 })
261 )
262 }
263
264 private locate(
265 binding: Binding,

Callers 1

isSameReadMethod · 0.95

Calls 6

readsMethod · 0.95
isFoldableFunction · 0.90
keyOfFunction · 0.90
hasDomainFunction · 0.90
valueOfBindingMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected