MCPcopy Index your code
hub / github.com/anomalyco/opencode / sameChecks

Function sameChecks

packages/httpapi-codegen/src/index.ts:693–704  ·  view source on GitHub ↗
(left: SchemaAST.Checks | undefined, right: SchemaAST.Checks | undefined)

Source from the content-addressed store, hash-verified

691}
692
693function sameChecks(left: SchemaAST.Checks | undefined, right: SchemaAST.Checks | undefined): boolean {
694 if (left?.length !== right?.length) return false
695 if (left === undefined || right === undefined) return true
696 return left.every((check, index) => {
697 const other = right[index]
698 if (other === undefined || check._tag !== other._tag) return false
699 if (check._tag === "Filter" && other._tag === "Filter") {
700 return check.run === other.run && check.aborted === other.aborted
701 }
702 return check._tag === "FilterGroup" && other._tag === "FilterGroup" && sameChecks(check.checks, other.checks)
703 })
704}
705
706function sameContext(left: SchemaAST.Context | undefined, right: SchemaAST.Context | undefined) {
707 return left?.isOptional === right?.isOptional && left?.isMutable === right?.isMutable

Callers 1

sameEncodingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected