MCPcopy Create free account
hub / github.com/dataease/SQLBot / OpenAPI3_1DereferenceVisitor

Class OpenAPI3_1DereferenceVisitor

frontend/public/swagger-ui-bundle.js:52998–53535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52996 mutationReplacer = (s, o, i, a) => {
52997 Ru(a) ? (a.value = s) : Array.isArray(a) && (a[i] = s)
52998 }
52999 class OpenAPI3_1DereferenceVisitor {
53000 indirections
53001 namespace
53002 reference
53003 options
53004 ancestors
53005 refractCache
53006 allOfDiscriminatorMapping
53007 constructor({
53008 reference: s,
53009 namespace: o,
53010 options: i,
53011 indirections: a = [],
53012 ancestors: u = new AncestorLineage(),
53013 refractCache: _ = new Map(),
53014 allOfDiscriminatorMapping: w = new Map(),
53015 }) {
53016 ;((this.indirections = a),
53017 (this.namespace = o),
53018 (this.reference = s),
53019 (this.options = i),
53020 (this.ancestors = new AncestorLineage(...u)),
53021 (this.refractCache = _),
53022 (this.allOfDiscriminatorMapping = w))
53023 }
53024 toBaseURI(s) {
53025 return resolve(this.reference.uri, sanitize(stripHash(s)))
53026 }
53027 async toReference(s) {
53028 if (this.reference.depth >= this.options.resolve.maxDepth)
53029 throw new nx(
53030 `Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`
53031 )
53032 const o = this.toBaseURI(s),
53033 { refSet: i } = this.reference
53034 if (i.has(o)) return i.find(Ww(o, 'uri'))
53035 const a = await apidom_reference_src_parse(unsanitize(o), {
53036 ...this.options,
53037 parse: { ...this.options.parse, mediaType: 'text/plain' },
53038 }),
53039 u = new mw({ uri: o, value: cloneDeep(a), depth: this.reference.depth + 1 })
53040 if ((i.add(u), this.options.dereference.immutable)) {
53041 const s = new mw({
53042 uri: `immutable://${o}`,
53043 value: a,
53044 depth: this.reference.depth + 1,
53045 })
53046 i.add(s)
53047 }
53048 return u
53049 }
53050 toAncestorLineage(s) {
53051 const o = new Set(s.filter(Cu))
53052 return [new AncestorLineage(...this.ancestors, o), o]
53053 }
53054 OpenApi3_1Element = {
53055 leave: (s, o, i, a, u, _) => {

Callers

nothing calls this directly

Calls 2

cloneShallowFunction · 0.85
setMetaPropertyMethod · 0.80

Tested by

no test coverage detected