Skip to content

Commit 810f39f

Browse files
committed
refactor: apply code style changes to rest of return values
1 parent 96fd1d7 commit 810f39f

2 files changed

Lines changed: 301 additions & 349 deletions

File tree

packages/kitsu/src/index.js

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,10 @@ export default class Kitsu {
242242
return {
243243
...deserialise(data),
244244
status,
245-
...(responseHeaders && Object.keys(responseHeaders).length > 0
245+
...(responseHeaders && Object.keys(responseHeaders).length
246246
? { headers: responseHeaders }
247-
: {})
247+
: {}
248+
)
248249
}
249250
} catch (E) {
250251
throw error(E)
@@ -308,7 +309,14 @@ export default class Kitsu {
308309
}
309310
)
310311

311-
return { ...deserialise(data), status, ...(responseHeaders && Object.keys(responseHeaders).length > 0 ? { headers: responseHeaders } : {}) }
312+
return {
313+
...deserialise(data),
314+
status,
315+
...(responseHeaders && Object.keys(responseHeaders).length
316+
? { headers: responseHeaders }
317+
: {}
318+
)
319+
}
312320
} catch (E) {
313321
throw error(E)
314322
}
@@ -368,7 +376,14 @@ export default class Kitsu {
368376
}
369377
)
370378

371-
return { ...deserialise(data), status, ...(responseHeaders && Object.keys(responseHeaders).length > 0 ? { headers: responseHeaders } : {}) }
379+
return {
380+
...deserialise(data),
381+
status,
382+
...(responseHeaders && Object.keys(responseHeaders).length
383+
? { headers: responseHeaders }
384+
: {}
385+
)
386+
}
372387
} catch (E) {
373388
throw error(E)
374389
}
@@ -421,7 +436,14 @@ export default class Kitsu {
421436
...config.axiosOptions
422437
})
423438

424-
return { ...deserialise(data), status, ...(responseHeaders && Object.keys(responseHeaders).length > 0 ? { headers: responseHeaders } : {}) }
439+
return {
440+
...deserialise(data),
441+
status,
442+
...(responseHeaders && Object.keys(responseHeaders).length
443+
? { headers: responseHeaders }
444+
: {}
445+
)
446+
}
425447
} catch (E) {
426448
throw error(E)
427449
}
@@ -530,7 +552,14 @@ export default class Kitsu {
530552
...axiosOptions
531553
})
532554

533-
return { ...deserialise(data), status, ...(responseHeaders && Object.keys(responseHeaders).length > 0 ? { headers: responseHeaders } : {}) }
555+
return {
556+
...deserialise(data),
557+
status,
558+
...(responseHeaders && Object.keys(responseHeaders).length
559+
? { headers: responseHeaders }
560+
: {}
561+
)
562+
}
534563
} catch (E) {
535564
throw error(E)
536565
}

0 commit comments

Comments
 (0)