Skip to content

Commit

Permalink
🎨 astro/src/utils/atproto_api/*.tsにPrettierを適用
Browse files Browse the repository at this point in the history
  • Loading branch information
ZEKE320 committed Apr 6, 2024
1 parent bb3be85 commit 22d2911
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
5 changes: 3 additions & 2 deletions astro/src/utils/atproto_api/createRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ export const api = async ({
})
.then(async response => {
if (!response?.ok) {
const res: typeof etype = await response.json() as typeof etype
const res: typeof etype =
(await response.json()) as typeof etype
const e: Error = new Error(res.message)
e.name = apiName
throw e
}
return await response.json() as typeof mtype
return (await response.json()) as typeof mtype
})
.catch((e: Error) => {
return {
Expand Down
5 changes: 3 additions & 2 deletions astro/src/utils/atproto_api/createSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ export const api = async ({
})
.then(async response => {
if (!response?.ok) {
const res: typeof etype = await response.json() as typeof etype
const res: typeof etype =
(await response.json()) as typeof etype
const e: Error = new Error(res.message)
e.name = apiName
throw e
}
return await response.json() as typeof mtype
return (await response.json()) as typeof mtype
})
.catch((e: Error) => {
return {
Expand Down
5 changes: 3 additions & 2 deletions astro/src/utils/atproto_api/deleteSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ export const api = async ({
})
.then(async response => {
if (!response?.ok) {
const res: typeof etype = await response.json() as typeof etype
const res: typeof etype =
(await response.json()) as typeof etype
const e: Error = new Error(res.message)
e.name = apiName
throw e
}
return await response.json() as void
return (await response.json()) as void
})
.catch((e: Error) => {
return {
Expand Down
5 changes: 3 additions & 2 deletions astro/src/utils/atproto_api/getPostThread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ export const api = async ({
})
.then(async response => {
if (!response?.ok) {
const res: typeof etype = await response.json() as typeof etype
const res: typeof etype =
(await response.json()) as typeof etype
const e: Error = new Error(res.message)
e.name = apiName
throw e
}
return await response.json() as typeof mtype
return (await response.json()) as typeof mtype
})
.catch((e: Error) => {
return {
Expand Down
5 changes: 3 additions & 2 deletions astro/src/utils/atproto_api/getProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ export const api = async ({
})
.then(async response => {
if (!response?.ok) {
const res: typeof etype = await response.json() as typeof etype
const res: typeof etype =
(await response.json()) as typeof etype
const e: Error = new Error(res.message)
e.name = apiName
throw e
}
return await response.json() as typeof mtype
return (await response.json()) as typeof mtype
})
.catch((e: Error) => {
return {
Expand Down
5 changes: 3 additions & 2 deletions astro/src/utils/atproto_api/getRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ export const api = async ({
})
.then(async response => {
if (!response?.ok) {
const res: typeof etype = await response.json() as typeof etype
const res: typeof etype =
(await response.json()) as typeof etype
const e: Error = new Error(res.message)
e.name = apiName
throw e
}
return await response.json() as typeof mtype
return (await response.json()) as typeof mtype
})
.catch((e: Error) => {
return {
Expand Down
5 changes: 3 additions & 2 deletions astro/src/utils/atproto_api/getSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ export const api = async ({
})
.then(async response => {
if (!response?.ok) {
const res: typeof etype = await response.json() as typeof etype
const res: typeof etype =
(await response.json()) as typeof etype
const e: Error = new Error(res.message)
e.name = apiName
throw e
}
return await response.json() as typeof mtype
return (await response.json()) as typeof mtype
})
.catch((e: Error) => {
return {
Expand Down
5 changes: 3 additions & 2 deletions astro/src/utils/atproto_api/refreshSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ export const api = async ({
})
.then(async response => {
if (!response?.ok) {
const res: typeof etype = await response.json() as typeof etype
const res: typeof etype =
(await response.json()) as typeof etype
const e: Error = new Error(res.message)
e.name = apiName
throw e
}
return await response.json() as typeof mtype
return (await response.json()) as typeof mtype
})
.catch((e: Error) => {
return {
Expand Down

0 comments on commit 22d2911

Please sign in to comment.