Socket
Socket
Sign inDemoInstall

hafas-rest-api

Package Overview
Dependencies
138
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.3.0 to 3.3.1

3

package.json
{
"name": "hafas-rest-api",
"description": "Expose a HAFAS client via an HTTP REST API.",
"version": "3.3.0",
"version": "3.3.1",
"main": "index.js",

@@ -38,2 +38,3 @@ "files": [

"express-pino-logger": "^4.0.0",
"github-slugger": "^1.3.0",
"hsts": "^2.1.0",

@@ -40,0 +41,0 @@ "http-link-header": "^1.0.2",

'use strict'
const {inspect} = require('util')
const Slugger = require('github-slugger')

@@ -42,21 +43,2 @@ const generateRouteDoc = (path, route) => {

// todo: filter based on `routes`
const listOfRoutes = `\
## Routes
*Note:* These routes only wrap [\`hafas-client@5\` methods](https://github.com/public-transport/hafas-client/blob/5/docs/readme.md), check their docs for more details.
- [\`GET /locations\`](#get-locations)
- [\`GET /stops/nearby\`](#get-stopsnearby)
- [\`GET /stops/reachable-from\`](#get-stopsreachable-from)
- [\`GET /stops/:id\`](#get-stopsid)
- [\`GET /stops/:id/departures\`](#get-stopsiddepartures)
- [\`GET /stops/:id/arrivals\`](#get-stopsidarrivals)
- [\`GET /journeys\`](#get-journeys)
- [\`GET /journeys/:ref\`](#get-journeysref)
- [\`GET /trips/:id\`](#get-tripsid)
- [\`GET /radar\`](#get-radar)
- [date/time parameters](#datetime-parameters)
`
const tail = `\

@@ -72,7 +54,23 @@ ## Date/Time Parameters

const slugger = new Slugger()
const generateApiDocs = (routes) => {
const r = Object.create(null)
let listOfRoutes = `\
## Routes
*Note:* These routes only wrap [\`hafas-client@5\` methods](https://github.com/public-transport/hafas-client/blob/5/docs/readme.md), check their docs for more details.
`
for (const [path, route] of Object.entries(routes)) {
r[path] = generateRouteDoc(path, route)
const spec = `GET ${path}`
listOfRoutes += `
- [\`${spec}\`](#${slugger.slug(spec)})`
}
listOfRoutes += `
- [date/time parameters](#datetime-parameters)
`
return {

@@ -79,0 +77,0 @@ listOfRoutes,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc