ts-json-schema-generator
Version:
Generate JSON schema from your Typescript sources
11 lines • 505 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.preserveAnnotation = preserveAnnotation;
const AnnotatedType_js_1 = require("../Type/AnnotatedType.js");
function preserveAnnotation(originalType, newType) {
if (originalType instanceof AnnotatedType_js_1.AnnotatedType) {
return new AnnotatedType_js_1.AnnotatedType(newType, originalType.getAnnotations(), originalType.isNullable());
}
return newType;
}
//# sourceMappingURL=preserveAnnotation.js.map