MCPcopy Index your code
hub / github.com/dataease/SQLBot / apidom_reference_src_parse

Function apidom_reference_src_parse

frontend/public/swagger-ui-bundle.js:52949–52981  ·  view source on GitHub ↗
(s, o)

Source from the content-addressed store, hash-verified

52947 const rx = class MaximumDereferenceDepthError extends Ow {}
52948 const nx = class MaximumResolveDepthError extends Dw {}
52949 const sx = class UnmatchedResolverError extends Lw {},
52950 apidom_reference_src_parse = async (s, o) => {
52951 const i = new xw({ uri: sanitize(stripHash(s)), mediaType: o.parse.mediaType }),
52952 a = await (async (s, o) => {
52953 const i = o.resolve.resolvers.map((s) => {
52954 const i = Object.create(s)
52955 return Object.assign(i, o.resolve.resolverOpts)
52956 }),
52957 a = await plugins_filter('canRead', [s, o], i)
52958 if (gp(a)) throw new sx(s.uri)
52959 try {
52960 const { result: o } = await run('read', [s], a)
52961 return o
52962 } catch (o) {
52963 throw new Dw(`Error while reading file "${s.uri}"`, { cause: o })
52964 }
52965 })(i, o)
52966 return (async (s, o) => {
52967 const i = o.parse.parsers.map((s) => {
52968 const i = Object.create(s)
52969 return Object.assign(i, o.parse.parserOpts)
52970 }),
52971 a = await plugins_filter('canParse', [s, o], i)
52972 if (gp(a)) throw new sx(s.uri)
52973 try {
52974 const { plugin: i, result: u } = await run('parse', [s, o], a)
52975 return !i.allowEmpty && u.isEmpty
52976 ? Promise.reject(new Cw(`Error while parsing file "${s.uri}". File is empty.`))
52977 : u
52978 } catch (o) {
52979 throw new Cw(`Error while parsing file "${s.uri}"`, { cause: o })
52980 }
52981 })(new xw({ ...i, data: a }), o)
52982 }
52983 class AncestorLineage extends Array {
52984 includesCycle(s) {

Callers 1

toReferenceMethod · 0.85

Calls 8

stripHashFunction · 0.85
plugins_filterFunction · 0.85
runFunction · 0.85
sanitizeFunction · 0.70
createMethod · 0.65
gpFunction · 0.50
mapMethod · 0.45
rejectMethod · 0.45

Tested by

no test coverage detected