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

Function annotationsPortable

packages/httpapi-codegen/src/index.ts:920–931  ·  view source on GitHub ↗
(annotations: Schema.Annotations.Annotations | undefined)

Source from the content-addressed store, hash-verified

918}
919
920function annotationsPortable(annotations: Schema.Annotations.Annotations | undefined) {
921 if (annotations === undefined) return true
922 return Object.entries(annotations).every(([key, value]) => {
923 if (
924 ["toCodec", "toCodecJson", "toArbitrary", "toFormatter", "toEquivalence", "~effect/Schema/Class"].includes(key)
925 ) {
926 return true
927 }
928 if (key === "generation") return generationPortable(value)
929 return serializable(value)
930 })
931}
932
933function serializable(value: unknown): boolean {
934 if (value === null || ["string", "number", "boolean"].includes(typeof value)) return true

Callers 2

visitCurrentFunction · 0.85
metadataPortableFunction · 0.85

Calls 2

generationPortableFunction · 0.85
serializableFunction · 0.85

Tested by

no test coverage detected