mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
allow line.fahrtNr of null 💚
This commit is contained in:
parent
9257d3ad7d
commit
1f13f68926
1 changed files with 5 additions and 2 deletions
|
@ -83,8 +83,11 @@ const createValidateLine = (cfg) => {
|
||||||
const validateLine = (val, line, name = 'line') => {
|
const validateLine = (val, line, name = 'line') => {
|
||||||
defaultValidators.line(val, line, name)
|
defaultValidators.line(val, line, name)
|
||||||
|
|
||||||
a.strictEqual(typeof line.fahrtNr, 'string', name + ' must be string')
|
const msg = name + '.fahrtNr must be '
|
||||||
a.ok(line.fahrtNr, name + ' must not be empty')
|
if (line.fahrtNr !== null) {
|
||||||
|
a.strictEqual(typeof line.fahrtNr, 'string', msg + 'a string')
|
||||||
|
a.ok(line.fahrtNr, msg + ' be empty')
|
||||||
|
}
|
||||||
|
|
||||||
a.ok(validLineModes.includes(line.mode), name + '.mode is invalid')
|
a.ok(validLineModes.includes(line.mode), name + '.mode is invalid')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue