105 lines
2.3 KiB
JavaScript
105 lines
2.3 KiB
JavaScript
// Metro module 12143 (f12144).
|
|
import * as _objectWithoutProperties from "./_objectWithoutProperties";
|
|
import * as _classCallCheck from "./_classCallCheck";
|
|
import * as __createClass from "./_createClass";
|
|
import * as _initializeContext from "./initializeContext";
|
|
import { initializeContext, extractDefs, finalize } from "./initializeContext";
|
|
import { allProcessors } from "./Module12142";
|
|
let env8376 = {};
|
|
const _excluded = ["~standard"];
|
|
const JSONSchemaGenerator = function JSONSchemaGenerator(a0) {
|
|
_classCallCheck(this, JSONSchemaGenerator);
|
|
let target = a0?.target;
|
|
if (target == null) {
|
|
target = "draft-2020-12";
|
|
}
|
|
if (target === "draft-4") {
|
|
target = "draft-04";
|
|
}
|
|
if (target === "draft-7") {
|
|
target = "draft-07";
|
|
}
|
|
this.ctx = initializeContext({
|
|
processors: allProcessors,
|
|
target,
|
|
...a0?.metadata && {
|
|
metadata: a0.metadata
|
|
},
|
|
...a0?.unrepresentable && {
|
|
unrepresentable: a0.unrepresentable
|
|
},
|
|
...a0?.override && {
|
|
override: a0.override
|
|
},
|
|
...a0?.io && {
|
|
io: a0.io
|
|
}
|
|
});
|
|
};
|
|
exports.JSONSchemaGenerator = __createClass(JSONSchemaGenerator, [{
|
|
key: "metadataRegistry",
|
|
get: function get() {
|
|
return this.ctx.metadataRegistry;
|
|
}
|
|
}, {
|
|
key: "target",
|
|
get: function get() {
|
|
return this.ctx.target;
|
|
}
|
|
}, {
|
|
key: "unrepresentable",
|
|
get: function get() {
|
|
return this.ctx.unrepresentable;
|
|
}
|
|
}, {
|
|
key: "override",
|
|
get: function get() {
|
|
return this.ctx.override;
|
|
}
|
|
}, {
|
|
key: "io",
|
|
get: function get() {
|
|
return this.ctx.io;
|
|
}
|
|
}, {
|
|
key: "counter",
|
|
get: function get() {
|
|
return this.ctx.counter;
|
|
},
|
|
set: function set(a0) {
|
|
this.ctx.counter = a0;
|
|
}
|
|
}, {
|
|
key: "seen",
|
|
get: function get() {
|
|
return this.ctx.seen;
|
|
}
|
|
}, {
|
|
key: "process",
|
|
value: function process(a0, r4 = {
|
|
path: [],
|
|
schemaPath: []
|
|
}) {
|
|
return (0, _initializeContext.process)(a0, this.ctx, r4);
|
|
}
|
|
}, {
|
|
key: "emit",
|
|
value: function emit(a0, a1) {
|
|
if (a1) {
|
|
if (a1.cycles) {
|
|
this.ctx.cycles = a1.cycles;
|
|
}
|
|
if (a1.reused) {
|
|
this.ctx.reused = a1.reused;
|
|
}
|
|
if (a1.external) {
|
|
this.ctx.external = a1.external;
|
|
}
|
|
}
|
|
(0, extractDefs)(this.ctx, a0);
|
|
const r25 = (0, finalize)(this.ctx, a0);
|
|
r25["~standard"];
|
|
return _objectWithoutProperties(r25, _excluded);
|
|
}
|
|
}]);
|