synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
32 lines (31 loc) • 818 B
JavaScript
import n from "./getEnumeratedValues.js";
import a from "./getSchemaForProperty.js";
import l from "./getRequiredAttributes.js";
import { getFlatTypeInfo as c } from "./getType.js";
function S(t) {
if (!t)
return {};
const p = l(t), s = {};
return t.properties && Object.keys(t.properties).forEach((i) => {
const e = a(t, i), u = c(e);
let r = n(e).map(
(o) => o.value
);
if (r.length === 0 && e && e.items) {
const o = Array.isArray(e.items) ? e.items[0] : e.items;
r = n(o).map(
(m) => m.value
);
}
s[i] = {
type: u,
isRequired: p.includes(i),
enumeratedValues: r.length > 0 ? r : null,
description: e?.description
};
}), s;
}
export {
S as getSchemaPropertiesInfo
};
//# sourceMappingURL=getSchemaPropertyInfo.js.map