(obj: any)
| 40 | } |
| 41 | |
| 42 | function newFunction(obj: any) { |
| 43 | const ary = []; |
| 44 | let isComplex = false; |
| 45 | for (const item of (obj.anyOf || obj.oneOf)) { |
| 46 | const tmp = getType(item); |
| 47 | if (ary.findIndex((s) => s === tmp) === -1) { |
| 48 | ary.push(getType(item)); |
| 49 | } |
| 50 | if (item.itemms || item.properties || item.anyOf || item.oneOf) { |
| 51 | isComplex = true; |
| 52 | } |
| 53 | } |
| 54 | if (isComplex) { |
| 55 | return '{' + ary.join(pipe) + '}'; |
| 56 | } |
| 57 | return ary.join(pipe); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | function writeHeader(f: fs.WriteStream) { |