code style 👕, update deps, 1.2.1

This commit is contained in:
Jannis R 2017-10-03 17:36:42 +02:00
parent dd7eef94ac
commit 83bf5c1b0a
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 31 additions and 17 deletions

View file

@ -23,10 +23,10 @@ const hafasError = (msg) => {
return err
}
const request = (opt) => {
const createRequest = (opt) => {
opt = Object.assign({}, defaults, opt)
return (data) => {
const request = (data) => {
const body = opt.onBody({lang: 'en', svcReqL: [data]})
const req = opt.onReq({
json: true, body: JSON.stringify(body),
@ -52,8 +52,10 @@ const request = (opt) => {
if (Array.isArray(c.remL)) d.remarks = c.remL.map(opt.onRemark)
if (Array.isArray(c.opL)) d.operators = c.opL.map(opt.onOperator)
return d
}).catch((err) => {throw err})
})
}
return request
}
module.exports = request
module.exports = createRequest

View file

@ -1,18 +1,30 @@
{
"name": "hafas-client",
"description": "JavaScript client for HAFAS mobile APIs.",
"version": "1.2.0",
"main": "index.js",
"files": ["index.js", "parse.js", "stringify.js"],
"author": "Jannis R <mail@jannisr.de>",
"homepage": "https://github.com/derhuerst/hafas-client",
"repository": "derhuerst/hafas-client",
"bugs": "https://github.com/derhuerst/hafas-client/issues",
"license": "ISC",
"keywords": ["hafas", "public", "transport", "api", "mgate"],
"engines" : {"node": ">=6"},
"name": "hafas-client",
"description": "JavaScript client for HAFAS mobile APIs.",
"version": "1.2.1",
"main": "index.js",
"files": [
"index.js",
"parse.js",
"stringify.js"
],
"author": "Jannis R <mail@jannisr.de>",
"homepage": "https://github.com/derhuerst/hafas-client",
"repository": "derhuerst/hafas-client",
"bugs": "https://github.com/derhuerst/hafas-client/issues",
"license": "ISC",
"keywords": [
"hafas",
"public",
"transport",
"api",
"mgate"
],
"engines": {
"node": ">=6"
},
"dependencies": {
"got": "^6.7.1",
"got": "^7.1.0",
"moment-timezone": "^0.5.13",
"slugg": "^1.2.0"
},