diff --git a/package-lock.json b/package-lock.json index c44bb3b..5181d9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "divia-api", - "version": "2.2.0", + "version": "2.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4e0e404..6b01809 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "divia-api", - "version": "2.2.1", + "version": "2.2.2", "description": "Dvia API v2", "main": "src/index.js", "scripts": { diff --git a/src/Line.js b/src/Line.js index 8403c27..387cd74 100644 --- a/src/Line.js +++ b/src/Line.js @@ -71,7 +71,7 @@ class Line { * @returns {Stop} */ getStop(id) { - const stop = this.data.arrets[id]; + const stop = Object.values(this.data.arrets).find(arret => arret.id === id); if (stop) return new Stop(this.api, this, stop); } diff --git a/src/index.js b/src/index.js index 82ef174..8003e6d 100644 --- a/src/index.js +++ b/src/index.js @@ -21,7 +21,7 @@ class DiviaAPI { * @returns {Line} */ getLine(id) { - const line = this.reseau.arborescence.lignes[id]; + const line = Object.values(this.reseau.arborescence.lignes).find(ligne => ligne.id === id); if (line) return new Line(this, line); }