Skip to content

Commit

Permalink
refactor doubled then
Browse files Browse the repository at this point in the history
  • Loading branch information
LiviaMedeiros committed Aug 19, 2023
1 parent cc0752a commit 7c35f8b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ const adjustHeaders = ({ headers }) =>

const statsAsOptions = async (statsOrError, { status } = {}) =>
Promise.resolve(statsOrError)
.then(
headers => ({ ...errAsStatus(headers, status), headers }),
headers => ({ ...errAsStatus(headers, status), headers })
)
.catch($ => $)
.then(headers => ({ ...errAsStatus(headers, status), headers }))
.then($ => Object.assign($, { headers: adjustHeaders($) }));

const getFileURL = (url, fileURL = null) =>
Expand Down

0 comments on commit 7c35f8b

Please sign in to comment.