|
| 1 | +import { t } from 'elysia' |
| 2 | +import { benchmark } from './utils' |
| 3 | + |
| 4 | +benchmark( |
| 5 | + t.Array( |
| 6 | + t.Object({ |
| 7 | + id: t.Number(), |
| 8 | + name: t.String(), |
| 9 | + bio: t.String(), |
| 10 | + user: t.Object({ |
| 11 | + name: t.String(), |
| 12 | + password: t.String(), |
| 13 | + email: t.Optional(t.String({ format: 'email' })), |
| 14 | + age: t.Optional(t.Number()), |
| 15 | + avatar: t.Optional(t.String({ format: 'uri' })), |
| 16 | + cover: t.Optional(t.String({ format: 'uri' })) |
| 17 | + }), |
| 18 | + playing: t.Optional(t.String()), |
| 19 | + wishlist: t.Optional(t.Array(t.Number())), |
| 20 | + games: t.Array( |
| 21 | + t.Object({ |
| 22 | + id: t.Number(), |
| 23 | + name: t.String(), |
| 24 | + hoursPlay: t.Optional(t.Number({ default: 0 })), |
| 25 | + tags: t.Array( |
| 26 | + t.Object({ |
| 27 | + name: t.String(), |
| 28 | + count: t.Number() |
| 29 | + }) |
| 30 | + ) |
| 31 | + }) |
| 32 | + ), |
| 33 | + metadata: t.Intersect([ |
| 34 | + t.Object({ |
| 35 | + alias: t.String() |
| 36 | + }), |
| 37 | + t.Object({ |
| 38 | + country: t.Nullable(t.String()), |
| 39 | + region: t.Optional(t.String()) |
| 40 | + }) |
| 41 | + ]), |
| 42 | + social: t.Optional( |
| 43 | + t.Object({ |
| 44 | + facebook: t.Optional(t.String()), |
| 45 | + twitter: t.Optional(t.String()), |
| 46 | + youtube: t.Optional(t.String()) |
| 47 | + }) |
| 48 | + ) |
| 49 | + }) |
| 50 | + ), |
| 51 | + [ |
| 52 | + { |
| 53 | + id: 1, |
| 54 | + name: 'SaltyAom', |
| 55 | + bio: 'I like train', |
| 56 | + user: { |
| 57 | + name: 'SaltyAom', |
| 58 | + password: '123456', |
| 59 | + avatar: 'https://avatars.githubusercontent.com/u/35027979?v=4', |
| 60 | + cover: 'https://saltyaom.com/cosplay/pekomama.webp' |
| 61 | + }, |
| 62 | + playing: 'Strinova', |
| 63 | + wishlist: [4_154_456, 2_345_345], |
| 64 | + games: [ |
| 65 | + { |
| 66 | + id: 4_154_456, |
| 67 | + name: 'MiSide', |
| 68 | + hoursPlay: 17, |
| 69 | + tags: [ |
| 70 | + { name: 'Psychological Horror', count: 236_432 }, |
| 71 | + { name: 'Cute', count: 495_439 }, |
| 72 | + { name: 'Dating Sim', count: 395_532 } |
| 73 | + ] |
| 74 | + }, |
| 75 | + { |
| 76 | + id: 4_356_345, |
| 77 | + name: 'Strinova', |
| 78 | + hoursPlay: 365, |
| 79 | + tags: [ |
| 80 | + { name: 'Free to Play', count: 205_593 }, |
| 81 | + { name: 'Anime', count: 504_304 }, |
| 82 | + { name: 'Third-Person Shooter', count: 395_532 } |
| 83 | + ] |
| 84 | + }, |
| 85 | + { |
| 86 | + id: 2_345_345, |
| 87 | + name: "Tom Clancy's Rainbow Six Siege", |
| 88 | + hoursPlay: 287, |
| 89 | + tags: [ |
| 90 | + { name: 'FPS', count: 855_324 }, |
| 91 | + { name: 'Multiplayer', count: 456_567 }, |
| 92 | + { name: 'Tactical', count: 544_467 } |
| 93 | + ] |
| 94 | + } |
| 95 | + ], |
| 96 | + metadata: { |
| 97 | + alias: 'SaltyAom', |
| 98 | + country: 'Thailand', |
| 99 | + region: 'Asia' |
| 100 | + }, |
| 101 | + social: { |
| 102 | + twitter: 'SaltyAom' |
| 103 | + } |
| 104 | + }, |
| 105 | + { |
| 106 | + id: 2, |
| 107 | + name: 'VLost', |
| 108 | + bio: 'ไม่พี่คืองี้', |
| 109 | + user: { |
| 110 | + name: 'nattapon_kub', |
| 111 | + password: '123456' |
| 112 | + }, |
| 113 | + games: [ |
| 114 | + { |
| 115 | + id: 4_154_456, |
| 116 | + name: 'MiSide', |
| 117 | + hoursPlay: 17, |
| 118 | + tags: [ |
| 119 | + { name: 'Psychological Horror', count: 236_432 }, |
| 120 | + { name: 'Cute', count: 495_439 }, |
| 121 | + { name: 'Dating Sim', count: 395_532 } |
| 122 | + ] |
| 123 | + }, |
| 124 | + { |
| 125 | + id: 4_356_345, |
| 126 | + name: 'Strinova', |
| 127 | + hoursPlay: 365, |
| 128 | + tags: [ |
| 129 | + { name: 'Free to Play', count: 205_593 }, |
| 130 | + { name: 'Anime', count: 504_304 }, |
| 131 | + { name: 'Third-Person Shooter', count: 395_532 } |
| 132 | + ] |
| 133 | + } |
| 134 | + ], |
| 135 | + metadata: { |
| 136 | + alias: 'vlost', |
| 137 | + country: 'Thailand' |
| 138 | + } |
| 139 | + }, |
| 140 | + { |
| 141 | + id: 2, |
| 142 | + name: 'eika', |
| 143 | + bio: 'こんにちわ!', |
| 144 | + user: { |
| 145 | + name: 'ei_ka', |
| 146 | + password: '123456' |
| 147 | + }, |
| 148 | + games: [ |
| 149 | + { |
| 150 | + id: 4_356_345, |
| 151 | + name: 'Strinova', |
| 152 | + hoursPlay: 365, |
| 153 | + tags: [ |
| 154 | + { name: 'Free to Play', count: 205_593 }, |
| 155 | + { name: 'Anime', count: 504_304 }, |
| 156 | + { name: 'Third-Person Shooter', count: 395_532 } |
| 157 | + ] |
| 158 | + } |
| 159 | + ], |
| 160 | + metadata: { |
| 161 | + alias: 'eika', |
| 162 | + country: 'Japan' |
| 163 | + } |
| 164 | + } |
| 165 | + ] |
| 166 | +) |
0 commit comments