Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
chore(lint): apply lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Oct 13, 2022
1 parent 12f2863 commit e1e4484
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions common_back-end/singletons/url_maker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@ export default class {
lastPage: number
): object {
const document = { ...JSONAPI }
document.links = document.links || {}
document.links ||= {}
document.links = {
...document.links as object,
"first": `${this.makeBaseModelPath(modelPath)}?page=1`,
"last": `${this.makeBaseModelPath(modelPath)}?page=${lastPage}`,
"prev": currentPage === 1
? null
: `${this.makeBaseModelPath(modelPath)}?page=${currentPage - 1}`,
"next": currentPage === lastPage
? null
: `${this.makeBaseModelPath(modelPath)}?page=${currentPage + 1}`

: `${this.makeBaseModelPath(modelPath)}?page=${currentPage + 1}`,
"prev": currentPage === 1
? null
: `${this.makeBaseModelPath(modelPath)}?page=${currentPage - 1}`
}

return document
Expand All @@ -50,7 +49,11 @@ export default class {
}

static getResolvedPort() {
return this.port === 0 || this.port === 80 || this.port === 443 ? "" : `:${this.port}`
const HTTP_PORT = 80
const HTTPS_PORT = 443
return this.port === 0 || this.port === HTTP_PORT || this.port === HTTPS_PORT
? ""
: `:${this.port}`
}

static makeBaseURL(): string {
Expand Down Expand Up @@ -119,8 +122,8 @@ export default class {
&& typeof parsedData[0] === "number"
) {
return {
"hasExpired": parsedData[0] < currentTime,
"data": parsedData[1]
"data": parsedData[1],
"hasExpired": parsedData[0] < currentTime
}
}
throw new Error()
Expand Down

0 comments on commit e1e4484

Please sign in to comment.