(s, o = {}, i = void 0, a = !1)
| 74928 | ) |
| 74929 | }, |
| 74930 | NT = merge_merge, |
| 74931 | main_sampleFromSchemaGeneric = (s, o = {}, i = void 0, a = !1) => { |
| 74932 | if (null == s && void 0 === i) return |
| 74933 | ;('function' == typeof s?.toJS && (s = s.toJS()), (s = typeCast(s))) |
| 74934 | let u = void 0 !== i || hasExample(s) |
| 74935 | const _ = !u && Array.isArray(s.oneOf) && s.oneOf.length > 0, |
| 74936 | w = !u && Array.isArray(s.anyOf) && s.anyOf.length > 0 |
| 74937 | if (!u && (_ || w)) { |
| 74938 | const i = typeCast(random_pick(_ ? s.oneOf : s.anyOf)) |
| 74939 | ;(!(s = NT(s, i, o)).xml && i.xml && (s.xml = i.xml), |
| 74940 | hasExample(s) && hasExample(i) && (u = !0)) |
| 74941 | } |
| 74942 | const x = {} |
| 74943 | let { xml: C, properties: j, additionalProperties: L, items: B, contains: $ } = s || {}, |
| 74944 | U = type_getType(s), |
| 74945 | { includeReadOnly: V, includeWriteOnly: z } = o |
| 74946 | C = C || {} |
| 74947 | let Y, |
| 74948 | { name: Z, prefix: ee, namespace: ie } = C, |
| 74949 | ae = {} |
| 74950 | if ( |
| 74951 | (Object.hasOwn(s, 'type') || (s.type = U), |
| 74952 | a && ((Z = Z || 'notagname'), (Y = (ee ? `${ee}:` : '') + Z), ie)) |
| 74953 | ) { |
| 74954 | x[ee ? `xmlns:${ee}` : 'xmlns'] = ie |
| 74955 | } |
| 74956 | a && (ae[Y] = []) |
| 74957 | const ce = objectify(j) |
| 74958 | let le, |
| 74959 | pe = 0 |
| 74960 | const hasExceededMaxProperties = () => |
| 74961 | Number.isInteger(s.maxProperties) && s.maxProperties > 0 && pe >= s.maxProperties, |
| 74962 | canAddProperty = (o) => |
| 74963 | !(Number.isInteger(s.maxProperties) && s.maxProperties > 0) || |
| 74964 | (!hasExceededMaxProperties() && |
| 74965 | (!((o) => |
| 74966 | !Array.isArray(s.required) || |
| 74967 | 0 === s.required.length || |
| 74968 | !s.required.includes(o))(o) || |
| 74969 | s.maxProperties - |
| 74970 | pe - |
| 74971 | (() => { |
| 74972 | if (!Array.isArray(s.required) || 0 === s.required.length) return 0 |
| 74973 | let o = 0 |
| 74974 | return ( |
| 74975 | a |
| 74976 | ? s.required.forEach((s) => (o += void 0 === ae[s] ? 0 : 1)) |
| 74977 | : s.required.forEach((s) => { |
| 74978 | o += void 0 === ae[Y]?.find((o) => void 0 !== o[s]) ? 0 : 1 |
| 74979 | }), |
| 74980 | s.required.length - o |
| 74981 | ) |
| 74982 | })() > |
| 74983 | 0)) |
| 74984 | if ( |
| 74985 | ((le = a |
| 74986 | ? (i, u = void 0) => { |
| 74987 | if (s && ce[i]) { |
no test coverage detected