This repository was archived by the owner on Jan 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,13 @@ function maybeMakeError (error, caller) {
101101 }
102102
103103 // assign extra data to `err` like an error `code`
104- Object . assign ( err , error )
104+ for ( const key in error ) {
105+ try {
106+ err [ key ] = error [ key ]
107+ } catch ( err ) {
108+ void err
109+ }
110+ }
105111
106112 if (
107113 typeof Error . captureStackTrace === 'function' &&
@@ -202,7 +208,7 @@ export class Result {
202208 const err = maybeMakeError ( result ?. err , Result . from )
203209 const data = result ?. data !== null && result ?. data !== undefined
204210 ? result . data
205- : result ?. err ? null : result
211+ : ( result ?. err ? null : result )
206212
207213 return new this ( data , err )
208214 }
@@ -233,7 +239,11 @@ export class Result {
233239 get length ( ) {
234240 if ( this . data !== null && this . err !== null ) {
235241 return 2
242+ } else if ( this . data !== null || this . err !== null ) {
243+ return 1
236244 }
245+
246+ return 0
237247 }
238248
239249 * [ Symbol . iterator ] ( ) {
Original file line number Diff line number Diff line change @@ -24,6 +24,6 @@ maintainer: Socket Supply Co.
2424bundle_identifier: co.socketsupply.io.tests
2525bundle_identifier_short: co.socketsupply.io.tests
2626
27- forward_console: true
27+ # forward_console: true
2828
2929headless: true
You can’t perform that action at this time.
0 commit comments