@@ -172,6 +172,14 @@ class Right<R, L = never> implements Either<L, R> {
172172 return `Right(${ this . __value } )`
173173 }
174174
175+ [ Symbol . for ( 'nodejs.util.inspect.custom' ) ] (
176+ _depth : number ,
177+ opts : unknown ,
178+ inspect : Function
179+ ) {
180+ return `Right(${ inspect ( this . __value , opts ) } )`
181+ }
182+
175183 toString ( ) : string {
176184 return this . inspect ( )
177185 }
@@ -272,16 +280,24 @@ class Right<R, L = never> implements Either<L, R> {
272280 return left ( this . __value )
273281 }
274282
275- 'fantasy-land/bimap' = this . bimap
276- 'fantasy-land/map' = this . map
277- 'fantasy-land/ap' = this . ap
278- 'fantasy-land/equals' = this . equals
279- 'fantasy-land/chain' = this . chain
280- 'fantasy-land/alt' = this . alt
281- 'fantasy-land/reduce' = this . reduce
282- 'fantasy-land/extend' = this . extend
283+ declare 'fantasy-land/bimap' : typeof this . bimap
284+ declare 'fantasy-land/map' : typeof this . map
285+ declare 'fantasy-land/ap' : typeof this . ap
286+ declare 'fantasy-land/equals' : typeof this . equals
287+ declare 'fantasy-land/chain' : typeof this . chain
288+ declare 'fantasy-land/alt' : typeof this . alt
289+ declare 'fantasy-land/reduce' : typeof this . reduce
290+ declare 'fantasy-land/extend' : typeof this . extend
283291}
284292
293+ Right . prototype [ 'fantasy-land/bimap' ] = Right . prototype . bimap
294+ Right . prototype [ 'fantasy-land/map' ] = Right . prototype . map
295+ Right . prototype [ 'fantasy-land/ap' ] = Right . prototype . ap
296+ Right . prototype [ 'fantasy-land/equals' ] = Right . prototype . equals
297+ Right . prototype [ 'fantasy-land/chain' ] = Right . prototype . chain
298+ Right . prototype [ 'fantasy-land/alt' ] = Right . prototype . alt
299+ Right . prototype [ 'fantasy-land/reduce' ] = Right . prototype . reduce
300+ Right . prototype [ 'fantasy-land/extend' ] = Right . prototype . extend
285301Right . prototype . constructor = Either as any
286302
287303class Left < L , R = never > implements Either < L , R > {
@@ -305,6 +321,14 @@ class Left<L, R = never> implements Either<L, R> {
305321 return `Left(${ JSON . stringify ( this . __value ) } )`
306322 }
307323
324+ [ Symbol . for ( 'nodejs.util.inspect.custom' ) ] (
325+ _depth : number ,
326+ opts : unknown ,
327+ inspect : Function
328+ ) {
329+ return `Left(${ inspect ( this . __value , opts ) } )`
330+ }
331+
308332 toString ( ) : string {
309333 return this . inspect ( )
310334 }
@@ -409,16 +433,24 @@ class Left<L, R = never> implements Either<L, R> {
409433 return right ( this . __value )
410434 }
411435
412- 'fantasy-land/bimap' = this . bimap
413- 'fantasy-land/map' = this . map
414- 'fantasy-land/ap' = this . ap
415- 'fantasy-land/equals' = this . equals
416- 'fantasy-land/chain' = this . chain
417- 'fantasy-land/alt' = this . alt
418- 'fantasy-land/reduce' = this . reduce
419- 'fantasy-land/extend' = this . extend
436+ declare 'fantasy-land/bimap' : typeof this . bimap
437+ declare 'fantasy-land/map' : typeof this . map
438+ declare 'fantasy-land/ap' : typeof this . ap
439+ declare 'fantasy-land/equals' : typeof this . equals
440+ declare 'fantasy-land/chain' : typeof this . chain
441+ declare 'fantasy-land/alt' : typeof this . alt
442+ declare 'fantasy-land/reduce' : typeof this . reduce
443+ declare 'fantasy-land/extend' : typeof this . extend
420444}
421445
446+ Left . prototype [ 'fantasy-land/bimap' ] = Left . prototype . bimap
447+ Left . prototype [ 'fantasy-land/map' ] = Left . prototype . map
448+ Left . prototype [ 'fantasy-land/ap' ] = Left . prototype . ap
449+ Left . prototype [ 'fantasy-land/equals' ] = Left . prototype . equals
450+ Left . prototype [ 'fantasy-land/chain' ] = Left . prototype . chain
451+ Left . prototype [ 'fantasy-land/alt' ] = Left . prototype . alt
452+ Left . prototype [ 'fantasy-land/reduce' ] = Left . prototype . reduce
453+ Left . prototype [ 'fantasy-land/extend' ] = Left . prototype . extend
422454Left . prototype . constructor = Either as any
423455
424456const left = < L , R = never > ( value : L ) : Either < L , R > => new Left ( value )
0 commit comments