Skip to content

Commit

Permalink
style: format source code
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jul 19, 2023
1 parent 07020ce commit ca7e409
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ daysUntilClose: 7

# Issues with these labels will never be considered stale
exemptLabels:
- "Type: Security"
- 'Type: Security'

# Label to use when marking an issue as stale
staleLabel: "Status: Abandoned"
staleLabel: 'Status: Abandoned'

# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
Expand Down
4 changes: 2 additions & 2 deletions src/define_middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function middlewareReferenceBuilder(
* a reference to the executable middleware.
*/
export function defineNamedMiddleware<
NamedMiddleware extends Record<string | number | symbol, LazyImport<MiddlewareAsClass>>
NamedMiddleware extends Record<string | number | symbol, LazyImport<MiddlewareAsClass>>,
>(collection: NamedMiddleware) {
return Object.keys(collection).reduce(
(result, key: keyof NamedMiddleware) => {
Expand All @@ -49,7 +49,7 @@ export function defineNamedMiddleware<
},
{} as {
[K in keyof NamedMiddleware]: <
Args extends GetMiddlewareArgs<UnWrapLazyImport<NamedMiddleware[K]>>
Args extends GetMiddlewareArgs<UnWrapLazyImport<NamedMiddleware[K]>>,
>(
...args: Args
) => {
Expand Down
13 changes: 8 additions & 5 deletions src/exception_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,14 @@ export class ExceptionHandler {
*/
#expandStatusPages() {
if (!this.#expandedStatusPages) {
this.#expandedStatusPages = Object.keys(this.statusPages).reduce((result, range) => {
const renderer = this.statusPages[range as StatusPageRange]
result = Object.assign(result, parseRange(range, renderer))
return result
}, {} as Record<number, StatusPageRenderer>)
this.#expandedStatusPages = Object.keys(this.statusPages).reduce(
(result, range) => {
const renderer = this.statusPages[range as StatusPageRange]
result = Object.assign(result, parseRange(range, renderer))
return result
},
{} as Record<number, StatusPageRenderer>
)
}

return this.#expandedStatusPages
Expand Down
11 changes: 7 additions & 4 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ export function parseRange<T>(range: string, value: T): Record<number, T> {
throw new InvalidArgumentsException(`Invalid range "${range}"`)
}

return [...Array(max - min + 1).keys()].reduce((result, step) => {
result[min + step] = value
return result
}, {} as Record<number, T>)
return [...Array(max - min + 1).keys()].reduce(
(result, step) => {
result[min + step] = value
return result
},
{} as Record<number, T>
)
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"rootDir": "./",
"outDir": "./build"
}
}
}

0 comments on commit ca7e409

Please sign in to comment.