在初始化具有大量或的合并类型时出现内存不足错误
const Type1 = type({foo1: 'string', bar1: 'string'}).or({foo1: 'null', bar1: 'null'}); const Type2 = type({foo2: 'string', bar2: 'string'}).or({foo2: 'null', bar2: 'null'}); const Type3 = type({foo3: 'string', bar3: 'string'}).or({foo3: 'null', bar3: 'null'}); const Type4 = type({foo4: 'string', bar4: 'string'}).or({foo4: 'null', bar4: 'null'}); const Type5 = type({foo5: 'string', bar5: 'string'}).or({foo5: 'null', bar5: 'null'}); const Type6 = type({foo6: 'string', bar6: 'string'}).or({foo6: 'null', bar6: 'null'}); const Type7 = type({foo7: 'string', bar7: 'string'}).or({foo7: 'null', bar7: 'null'}); const Type8 = type({foo8: 'string', bar8: 'string'}).or({foo8: 'null', bar8: 'null'}); const Type9 = type({foo9: 'string', bar9: 'string'}).or({foo9: 'null', bar9: 'null'}); const Type10 = type({foo10: 'string', bar10: 'string'}).or({foo10: 'null', bar10: 'null'}); const Type11 = type({foo11: 'string', bar11: 'string'}).or({foo11: 'null', bar11: 'null'}); const merged = Type1 .merge(Type2) .merge(Type3) .merge(Type4) .merge(Type5) .merge(Type6) .merge(Type7) .merge(Type8) .merge(Type9) .merge(Type10) .merge(Type11);
内容来源: arktypeio/arktype