Skip to content

Commit 98add2c

Browse files
committed
feat(devdeps): update dev deps to latest drops test for node@<12
1 parent a383313 commit 98add2c

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
node-version: [8.x, 10.x, 12.x]
8+
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]
99
steps:
1010
- uses: actions/checkout@v1
1111
- name: Use Node.js ${{ matrix.node-version }}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module.exports = function ExpressOpenApi (_routePrefix, _doc, _opts) {
9191
if (!middleware.document.components || !middleware.document.components[type] || !middleware.document.components[type][name]) {
9292
throw new Error(`Unknown ${type} ref: ${name}`)
9393
}
94-
return { '$ref': `#/components/${type}/${name}` }
94+
return { $ref: `#/components/${type}/${name}` }
9595
}
9696

9797
// @TODO create id

lib/generate-doc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function split (thing) {
8686
} else if (thing.fast_slash) {
8787
return []
8888
} else {
89-
var match = thing
89+
const match = thing
9090
.toString()
9191
.replace('\\/?', '')
9292
.replace('(?=\\/|$)', '$')

lib/validate.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module.exports = function makeValidatorMiddleware (middleware, schema, opts) {
5050
p.required && !reqSchema.properties.query.required.includes(p.name) && reqSchema.properties.query.required.push(p.name)
5151
break
5252
case 'header':
53+
// eslint-disable-next-line no-case-declarations
5354
const name = p.name.toLowerCase()
5455
reqSchema.properties.headers.properties[name] = p.schema
5556
p.required && !reqSchema.properties.headers.required.includes(p.name) && reqSchema.properties.headers.required.push(name)

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
"postpublish": "git push origin && git push origin --tags"
2222
},
2323
"devDependencies": {
24-
"express": "^4.16.4",
25-
"mocha": "^5.2.0",
26-
"standard": "^12.0.1",
27-
"supertest": "^3.3.0"
24+
"express": "^4.18.2",
25+
"mocha": "^10.2.0",
26+
"standard": "^17.1.0",
27+
"supertest": "^6.3.3"
2828
},
2929
"dependencies": {
3030
"ajv": "^6.10.2",

test/_validate.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict'
2-
var { suite, test } = require('mocha')
3-
var assert = require('assert')
4-
var supertest = require('supertest')
5-
var express = require('express')
6-
var openapi = require('..')
2+
const { suite, test } = require('mocha')
3+
const assert = require('assert')
4+
const supertest = require('supertest')
5+
const express = require('express')
6+
const openapi = require('..')
77

88
module.exports = function () {
99
suite('validate', function () {

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ suite(name, function () {
294294
app.use(oapi)
295295
app.get('/:id', oapi.path({
296296
description: 'Get thing by id',
297-
parameters: [ oapi.parameters('id') ],
297+
parameters: [oapi.parameters('id')],
298298
responses: {
299299
204: {
300300
description: 'Successful response',

0 commit comments

Comments
 (0)