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

Function get_json_sample_schema

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

Source from the content-addressed store, hash-verified

37520 getSchemaObjectType = (s) => immutableToJS(s)?.type ?? 'string',
37521 Ss = [{ when: /json/, shouldStringifyTypes: ['string'] }],
37522 Es = ['object'],
37523 get_json_sample_schema = (s) => (o, i, a, u) => {
37524 const { fn: _ } = s(),
37525 w = _.memoizedSampleFromSchema(o, i, u),
37526 x = typeof w,
37527 C = Ss.reduce((s, o) => (o.when.test(a) ? [...s, ...o.shouldStringifyTypes] : s), Es)
37528 return gt()(C, (s) => s === x) ? JSON.stringify(w, null, 2) : w
37529 },
37530 get_yaml_sample_schema = (s) => (o, i, a, u) => {
37531 const { fn: _ } = s(),

Callers 1

json_schema_5_samplesFunction · 0.85

Calls 3

sFunction · 0.50
gtFunction · 0.50
reduceMethod · 0.45

Tested by

no test coverage detected