Skip to content

Commit

Permalink
feat(devdeps): update dev deps to latest drops test for node@<12
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleytodd committed Aug 25, 2023
1 parent a383313 commit 98add2c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module.exports = function ExpressOpenApi (_routePrefix, _doc, _opts) {
if (!middleware.document.components || !middleware.document.components[type] || !middleware.document.components[type][name]) {
throw new Error(`Unknown ${type} ref: ${name}`)
}
return { '$ref': `#/components/${type}/${name}` }
return { $ref: `#/components/${type}/${name}` }
}

// @TODO create id
Expand Down
2 changes: 1 addition & 1 deletion lib/generate-doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function split (thing) {
} else if (thing.fast_slash) {
return []
} else {
var match = thing
const match = thing
.toString()
.replace('\\/?', '')
.replace('(?=\\/|$)', '$')
Expand Down
1 change: 1 addition & 0 deletions lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = function makeValidatorMiddleware (middleware, schema, opts) {
p.required && !reqSchema.properties.query.required.includes(p.name) && reqSchema.properties.query.required.push(p.name)
break
case 'header':
// eslint-disable-next-line no-case-declarations
const name = p.name.toLowerCase()
reqSchema.properties.headers.properties[name] = p.schema
p.required && !reqSchema.properties.headers.required.includes(p.name) && reqSchema.properties.headers.required.push(name)
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"postpublish": "git push origin && git push origin --tags"
},
"devDependencies": {
"express": "^4.16.4",
"mocha": "^5.2.0",
"standard": "^12.0.1",
"supertest": "^3.3.0"
"express": "^4.18.2",
"mocha": "^10.2.0",
"standard": "^17.1.0",
"supertest": "^6.3.3"
},
"dependencies": {
"ajv": "^6.10.2",
Expand Down
10 changes: 5 additions & 5 deletions test/_validate.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict'
var { suite, test } = require('mocha')
var assert = require('assert')
var supertest = require('supertest')
var express = require('express')
var openapi = require('..')
const { suite, test } = require('mocha')
const assert = require('assert')
const supertest = require('supertest')
const express = require('express')
const openapi = require('..')

module.exports = function () {
suite('validate', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ suite(name, function () {
app.use(oapi)
app.get('/:id', oapi.path({
description: 'Get thing by id',
parameters: [ oapi.parameters('id') ],
parameters: [oapi.parameters('id')],
responses: {
204: {
description: 'Successful response',
Expand Down

0 comments on commit 98add2c

Please sign in to comment.