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

Method canParse

frontend/public/swagger-ui-bundle.js:52675–52687  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

52673 constructor(s = {}) {
52674 super({ name: 'json-swagger-client', mediaTypes: ['application/json'], ...s })
52675 }
52676 async canParse(s) {
52677 const o = 0 === this.fileExtensions.length || this.fileExtensions.includes(s.extension),
52678 i = this.mediaTypes.includes(s.mediaType)
52679 if (!o) return !1
52680 if (i) return !0
52681 if (!i)
52682 try {
52683 return (JSON.parse(s.toString()), !0)
52684 } catch (s) {
52685 return !1
52686 }
52687 return !1
52688 }
52689 async parse(s) {
52690 if (this.sourceMap)

Callers

nothing calls this directly

Calls 3

includesMethod · 0.45
parseMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected