Skip to content

Commit

Permalink
chore: Updated dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Nov 23, 2022
1 parent 4fbeb48 commit 6b7f500
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@
"postpublish": "git push origin && git push origin -f --tags"
},
"dependencies": {
"acquerello": "^1.0.11",
"fastify-plugin": "^4.2.1",
"table": "^6.8.0"
"acquerello": "^1.0.12",
"fastify-plugin": "^4.3.0",
"table": "^6.8.1"
},
"devDependencies": {
"@cowtech/eslint-config": "^8.7.5",
"@cowtech/eslint-config": "^8.8.0",
"@swc/cli": "^0.1.57",
"@swc/core": "^1.3.7",
"@types/node": "^18.8.4",
"@swc/core": "^1.3.19",
"@types/node": "^18.11.9",
"@types/sinon": "^10.0.13",
"@types/tap": "^15.0.7",
"c8": "^7.12.0",
"chokidar": "^3.5.3",
"fastify": "^4.8.1",
"prettier": "^2.7.1",
"sinon": "^14.0.1",
"tap": "^16.3.0",
"fastify": "^4.10.2",
"prettier": "^2.8.0",
"sinon": "^14.0.2",
"tap": "^16.3.2",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
},
"engines": {
"node": ">=14.15.0"
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function getRouteConfig(r: RouteOptions): RouteConfig {
return (r.config as RouteConfig) ?? {}
}

function printRoutes(routes: Array<RouteOptions>, useColors: boolean): void {
function printRoutes(routes: RouteOptions[], useColors: boolean): void {
if (routes.length === 0) {
return
}
Expand All @@ -32,7 +32,7 @@ function printRoutes(routes: Array<RouteOptions>, useColors: boolean): void {
headers.push(styler('{{bold white}}Description{{-}}'))
}

const rows: Array<Array<string>> = [headers]
const rows: string[][] = [headers]

for (const route of routes) {
const methods = Array.isArray(route.method) ? route.method : [route.method]
Expand All @@ -45,7 +45,7 @@ function printRoutes(routes: Array<RouteOptions>, useColors: boolean): void {
.join(' | ')
),

styler(`{{bold green}}${route.url.replace(/:\w+|\[:\w+]/g, '{{yellow}}$&{{-}}')}{{-}}`)
styler(`{{bold green}}${route.url.replaceAll(/:\w+|\[:\w+]/g, '{{yellow}}$&{{-}}')}{{-}}`)
]

if (hasDescription) {
Expand Down Expand Up @@ -79,7 +79,7 @@ export const plugin = fastifyPlugin(
function (instance: FastifyInstance, options: FastifyPluginOptions, done: (error?: FastifyError) => void): void {
const useColors = options.useColors ?? true

const routes: Array<RouteOptions> = []
const routes: RouteOptions[] = []

// Utility to track all the RouteOptionss we add
instance.addHook('onRoute', route => {
Expand Down
8 changes: 4 additions & 4 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ t.test('Plugin', t => {

t.equal(
// eslint-disable-next-line no-control-regex
consoleStub.firstCall.args[0].replace(/\u001B\[\d+m/g, ''),
consoleStub.firstCall.args[0].replaceAll(/\u001B\[\d+m/g, ''),
`
Available routes:
@
Expand All @@ -63,7 +63,7 @@ t.test('Plugin', t => {
║ GET | POST │ /another/:params │ Title ║
╚════════════╧══════════════════╧═════════════╝
`
.replace(/^\s+/gm, '')
.replaceAll(/^\s+/gm, '')
.replace('@', '')
)
})
Expand Down Expand Up @@ -111,7 +111,7 @@ t.test('Plugin', t => {
║ GET | POST │ /another/:params │ Title ║
╚════════════╧══════════════════╧═════════════╝
`
.replace(/^\s+/gm, '')
.replaceAll(/^\s+/gm, '')
.replace('@', '')
)
})
Expand Down Expand Up @@ -157,7 +157,7 @@ t.test('Plugin', t => {
║ GET | POST │ /another/:params ║
╚════════════╧══════════════════╝
`
.replace(/^\s+/gm, '')
.replaceAll(/^\s+/gm, '')
.replace('@', '')
)
})
Expand Down

0 comments on commit 6b7f500

Please sign in to comment.