mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
enable no-irregular-whitespace and no-mixed-spaces-and-tabs rules, fix non-compliant whitespace
This commit is contained in:
parent
c072a70c57
commit
df010fc24c
3 changed files with 8 additions and 10 deletions
|
@ -14,8 +14,6 @@
|
||||||
"ecmaVersion": 2018
|
"ecmaVersion": 2018
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-irregular-whitespace": "off",
|
|
||||||
"no-mixed-spaces-and-tabs": "off",
|
|
||||||
"no-unused-vars": [
|
"no-unused-vars": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
|
|
2
index.js
2
index.js
|
@ -111,7 +111,7 @@ const createClient = (profile, userAgent, opt = {}) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
opt = Object.assign({
|
opt = Object.assign({
|
||||||
results: null, // number of journeys – `null` means "whatever HAFAS returns"
|
results: null, // number of journeys – `null` means "whatever HAFAS returns"
|
||||||
via: null, // let journeys pass this station?
|
via: null, // let journeys pass this station?
|
||||||
stopovers: false, // return stations on the way?
|
stopovers: false, // return stations on the way?
|
||||||
transfers: -1, // maximum of 5 transfers
|
transfers: -1, // maximum of 5 transfers
|
||||||
|
|
|
@ -44,14 +44,14 @@ const createParseArrOrDep = (prefix) => {
|
||||||
]).map(([remark]) => remark)
|
]).map(([remark]) => remark)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt.stopovers && Array.isArray(d.stopL)) {
|
if (opt.stopovers && Array.isArray(d.stopL)) {
|
||||||
// Filter stations the train passes without stopping, as this doesn't comply with FPTF (yet).
|
// Filter stations the train passes without stopping, as this doesn't comply with FPTF (yet).
|
||||||
const stopovers = d.stopL
|
const stopovers = d.stopL
|
||||||
.map(st => profile.parseStopover(ctx, st, d.date))
|
.map(st => profile.parseStopover(ctx, st, d.date))
|
||||||
.filter(st => !st.passBy)
|
.filter(st => !st.passBy)
|
||||||
if (prefix === ARRIVAL) res.previousStopovers = stopovers
|
if (prefix === ARRIVAL) res.previousStopovers = stopovers
|
||||||
else if (prefix === DEPARTURE) res.nextStopovers = stopovers
|
else if (prefix === DEPARTURE) res.nextStopovers = stopovers
|
||||||
}
|
}
|
||||||
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue