@effect/schema
Advanced tools
Comparing version 0.68.11 to 0.68.12
@@ -1989,3 +1989,20 @@ /** | ||
/** @internal */ | ||
export const preserveAnnotations = annotationIds => annotated => { | ||
let out = undefined; | ||
for (const id of annotationIds) { | ||
if (Object.prototype.hasOwnProperty.call(annotated.annotations, id)) { | ||
if (out === undefined) { | ||
out = {}; | ||
} | ||
out[id] = annotated.annotations[id]; | ||
} | ||
} | ||
return out; | ||
}; | ||
/** @internal */ | ||
export const getJSONIdentifier = annotated => Option.orElse(getJSONIdentifierAnnotation(annotated), () => getIdentifierAnnotation(annotated)); | ||
// To generate a JSON Schema from a recursive schema, an `identifier` annotation | ||
// is required. So, when we calculate the encodedAST, we need to preserve the | ||
// annotation in the form of an internal custom annotation that acts as a | ||
// surrogate for the identifier, which the JSON Schema compiler can then read. | ||
const createJSONIdentifierAnnotation = annotated => Option.match(getJSONIdentifier(annotated), { | ||
@@ -1992,0 +2009,0 @@ onNone: () => undefined, |
{ | ||
"name": "@effect/schema", | ||
"version": "0.68.11", | ||
"version": "0.68.12", | ||
"description": "Modeling the schema of data structures as first-class values", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"effect": "^3.4.4" | ||
"effect": "^3.4.5" | ||
}, | ||
@@ -19,0 +19,0 @@ "publishConfig": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2440593
40645