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

Function extractExample

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

Source from the content-addressed store, hash-verified

74765 const { examples: o, example: i, default: a } = s
74766 return !!(Array.isArray(o) && o.length >= 1) || void 0 !== a || void 0 !== i
74767 },
74768 extractExample = (s) => {
74769 if (!isJSONSchemaObject(s)) return null
74770 const { examples: o, example: i, default: a } = s
74771 return Array.isArray(o) && o.length >= 1
74772 ? o.at(0)
74773 : void 0 !== a
74774 ? a
74775 : void 0 !== i
74776 ? i
74777 : void 0
74778 },
74779 IT = {
74780 array: [

Callers 2

inferTypeFunction · 0.85

Calls 2

isJSONSchemaObjectFunction · 0.85
isArrayMethod · 0.45

Tested by

no test coverage detected