@@ -31,7 +31,7 @@ test("getSchemaBox", () => {
3131 expect ( getSchemaBox ( { type : "boolean" , nullable : true } ) ) . toMatchInlineSnapshot ( `
3232 {
3333 "type": "union",
34- "value": "boolean | null",
34+ "value": "( boolean | null) ",
3535 }
3636 ` ) ;
3737 expect ( getSchemaBox ( { type : "string" } ) ) . toMatchInlineSnapshot ( `
@@ -61,7 +61,7 @@ test("getSchemaBox", () => {
6161 expect ( getSchemaBox ( { type : "string" , nullable : true } ) ) . toMatchInlineSnapshot ( `
6262 {
6363 "type": "union",
64- "value": "string | null",
64+ "value": "( string | null) ",
6565 }
6666 ` ) ;
6767
@@ -75,7 +75,7 @@ test("getSchemaBox", () => {
7575 expect ( getSchemaBox ( { type : "array" , items : { type : "string" , nullable : true } } ) ) . toMatchInlineSnapshot ( `
7676 {
7777 "type": "array",
78- "value": "Array<string | null>",
78+ "value": "Array<( string | null) >",
7979 }
8080 ` ) ;
8181 expect ( getSchemaBox ( { type : "object" } ) ) . toMatchInlineSnapshot (
@@ -103,7 +103,7 @@ test("getSchemaBox", () => {
103103 . toMatchInlineSnapshot ( `
104104 {
105105 "type": "ref",
106- "value": "Partial<{ str: string, nb: number, nullable: string | null }>",
106+ "value": "Partial<{ str: string, nb: number, nullable: ( string | null) }>",
107107 }
108108 ` ) ;
109109
@@ -163,7 +163,7 @@ test("getSchemaBox", () => {
163163 ) . toMatchInlineSnapshot ( `
164164 {
165165 "type": "ref",
166- "value": "Partial<{ str: string } & { string: number }>",
166+ "value": "Partial<( { str: string } & { string: number }) >",
167167 }
168168 ` ) ;
169169
@@ -177,7 +177,7 @@ test("getSchemaBox", () => {
177177 ) . toMatchInlineSnapshot ( `
178178 {
179179 "type": "ref",
180- "value": "Partial<{ str: string } & { string: Partial<{ prop: boolean }> }>",
180+ "value": "Partial<( { str: string } & { string: Partial<{ prop: boolean }> }) >",
181181 }
182182 ` ) ;
183183
@@ -195,7 +195,7 @@ test("getSchemaBox", () => {
195195 ) . toMatchInlineSnapshot ( `
196196 {
197197 "type": "array",
198- "value": "Array<Partial<{ str: string, nullable: string | null }>>",
198+ "value": "Array<Partial<{ str: string, nullable: ( string | null) }>>",
199199 }
200200 ` ) ;
201201
@@ -227,15 +227,15 @@ test("getSchemaBox", () => {
227227 ) . toMatchInlineSnapshot ( `
228228 {
229229 "type": "ref",
230- "value": "Partial<{ enumprop: "aaa" | "bbb" | "ccc" }>",
230+ "value": "Partial<{ enumprop: ( "aaa" | "bbb" | "ccc") }>",
231231 }
232232 ` ) ;
233233
234234 expect ( getSchemaBox ( { type : "string" , enum : [ "aaa" , "bbb" , "ccc" ] } ) ) . toMatchInlineSnapshot (
235235 `
236236 {
237237 "type": "union",
238- "value": ""aaa" | "bbb" | "ccc"",
238+ "value": "( "aaa" | "bbb" | "ccc") ",
239239 }
240240 ` ,
241241 ) ;
@@ -244,7 +244,7 @@ test("getSchemaBox", () => {
244244 expect ( getSchemaBox ( { type : "string" , enum : [ "aaa" , "bbb" , "ccc" ] } ) ) . toMatchInlineSnapshot ( `
245245 {
246246 "type": "union",
247- "value": ""aaa" | "bbb" | "ccc"",
247+ "value": "( "aaa" | "bbb" | "ccc") ",
248248 }
249249 ` ) ;
250250
@@ -259,48 +259,48 @@ test("getSchemaBox", () => {
259259 ) . toMatchInlineSnapshot ( `
260260 {
261261 "type": "ref",
262- "value": "Partial<{ union: string | number }>",
262+ "value": "Partial<{ union: ( string | number) }>",
263263 }
264264 ` ) ;
265265 expect ( getSchemaBox ( { oneOf : [ { type : "string" } , { type : "number" } ] } ) ) . toMatchInlineSnapshot (
266266 `
267267 {
268268 "type": "union",
269- "value": "string | number",
269+ "value": "( string | number) ",
270270 }
271271 ` ,
272272 ) ;
273273
274274 // StringOrNumber
275275 expect ( getSchemaBox ( { oneOf : [ { type : "string" } , { type : "number" } ] } ) ) . toMatchInlineSnapshot ( `
276- {
277- "type": "union",
278- "value": "string | number",
279- }
280- ` ) ;
276+ {
277+ "type": "union",
278+ "value": "( string | number) ",
279+ }
280+ ` ) ;
281281
282282 expect ( getSchemaBox ( { allOf : [ { type : "string" } , { type : "number" } ] } ) ) . toMatchInlineSnapshot (
283283 `
284284 {
285285 "type": "intersection",
286- "value": "string & number",
286+ "value": "( string & number) ",
287287 }
288288 ` ,
289289 ) ;
290290
291291 // StringAndNumber
292292 expect ( getSchemaBox ( { allOf : [ { type : "string" } , { type : "number" } ] } ) ) . toMatchInlineSnapshot ( `
293- {
294- "type": "intersection",
295- "value": "string & number",
296- }
297- ` ) ;
293+ {
294+ "type": "intersection",
295+ "value": "( string & number) ",
296+ }
297+ ` ) ;
298298
299299 expect ( getSchemaBox ( { anyOf : [ { type : "string" } , { type : "number" } ] } ) ) . toMatchInlineSnapshot (
300300 `
301301 {
302302 "type": "union",
303- "value": "string | number",
303+ "value": "( string | number) ",
304304 }
305305 ` ,
306306 ) ;
@@ -309,7 +309,7 @@ test("getSchemaBox", () => {
309309 expect ( getSchemaBox ( { anyOf : [ { type : "string" } , { type : "number" } ] } ) ) . toMatchInlineSnapshot ( `
310310 {
311311 "type": "union",
312- "value": "string | number",
312+ "value": "( string | number) ",
313313 }
314314 ` ) ;
315315
@@ -324,7 +324,7 @@ test("getSchemaBox", () => {
324324 ) . toMatchInlineSnapshot ( `
325325 {
326326 "type": "ref",
327- "value": "Partial<{ unionOrArrayOfUnion: string | number }>",
327+ "value": "Partial<{ unionOrArrayOfUnion: ( string | number) }>",
328328 }
329329 ` ) ;
330330
@@ -339,22 +339,22 @@ test("getSchemaBox", () => {
339339 ) . toMatchInlineSnapshot ( `
340340 {
341341 "type": "ref",
342- "value": "Partial<{ intersection: string & number }>",
342+ "value": "Partial<{ intersection: ( string & number) }>",
343343 }
344344 ` ) ;
345345
346346 expect ( getSchemaBox ( { type : "string" , enum : [ "aaa" , "bbb" , "ccc" ] } ) ) . toMatchInlineSnapshot (
347347 `
348348 {
349349 "type": "union",
350- "value": ""aaa" | "bbb" | "ccc"",
350+ "value": "( "aaa" | "bbb" | "ccc") ",
351351 }
352352 ` ,
353353 ) ;
354354 expect ( getSchemaBox ( { type : "number" , enum : [ 1 , 2 , 3 ] } ) ) . toMatchInlineSnapshot ( `
355355 {
356356 "type": "union",
357- "value": "1 | 2 | 3",
357+ "value": "( 1 | 2 | 3) ",
358358 }
359359 ` ) ;
360360
@@ -398,7 +398,7 @@ test("getSchemaBox", () => {
398398 } ) ) . toMatchInlineSnapshot ( `
399399 {
400400 "type": "object",
401- "value": "{ members: Array<{ id: string, firstName?: string | null | undefined, lastName?: string | null | undefined, email: string, profilePictureURL?: string | null | undefined }> }",
401+ "value": "{ members: Array<{ id: string, firstName?: ( string | null) | undefined, lastName?: ( string | null) | undefined, email: string, profilePictureURL?: ( string | null) | undefined }> }",
402402 }
403403 ` ) ;
404404} ) ;
@@ -610,7 +610,7 @@ describe("getSchemaBox with context", () => {
610610 `
611611 {
612612 "type": "ref",
613- "value": "Partial<{ user: User | Member, users: Array<User | Member>, basic: number }>",
613+ "value": "Partial<{ user: ( User | Member) , users: Array<( User | Member) >, basic: number }>",
614614 }
615615 ` ,
616616 ) ;
@@ -634,7 +634,7 @@ describe("getSchemaBox with context", () => {
634634 `
635635 {
636636 "type": "ref",
637- "value": "Partial<{ name: string | null }>",
637+ "value": "Partial<{ name: ( string | null) }>",
638638 }
639639 ` ,
640640 ) ;
0 commit comments