bus-mj 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -1
- package/index.js +4 -2
- package/package.json +1 -1
- package/src/getBus.js +8 -0
package/index.d.ts
CHANGED
|
@@ -39,4 +39,5 @@ export function findBusDetailByOperator(operatorName: string): Bus[];
|
|
|
39
39
|
export function findOpenHoursAll(): string[];
|
|
40
40
|
export function findStopByRef(ref: number): Stop;
|
|
41
41
|
export function findBusByStopLabel(label: string): Bus[];
|
|
42
|
-
export function findBusByTwoStopLabel(begin: string, end: string): Bus[];
|
|
42
|
+
export function findBusByTwoStopLabel(begin: string, end: string): Bus[];
|
|
43
|
+
export function findBusOperator(operator: string): Bus[];
|
package/index.js
CHANGED
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
findOpenHoursAll,
|
|
11
11
|
findStopByRef,
|
|
12
12
|
findBusByStopLabel,
|
|
13
|
-
findBusByTwoStopLabel
|
|
13
|
+
findBusByTwoStopLabel,
|
|
14
|
+
findBusOperator
|
|
14
15
|
} from "./src/getBus.js";
|
|
15
16
|
|
|
16
17
|
export {
|
|
@@ -25,5 +26,6 @@ export {
|
|
|
25
26
|
findOpenHoursAll,
|
|
26
27
|
findStopByRef,
|
|
27
28
|
findBusByStopLabel,
|
|
28
|
-
findBusByTwoStopLabel
|
|
29
|
+
findBusByTwoStopLabel,
|
|
30
|
+
findBusOperator
|
|
29
31
|
};
|
package/package.json
CHANGED
package/src/getBus.js
CHANGED
|
@@ -150,6 +150,14 @@ export function findBusAll() {
|
|
|
150
150
|
return relations;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* fetch bus by operator
|
|
155
|
+
* @returns { Bus[] }
|
|
156
|
+
*/
|
|
157
|
+
export function findBusOperator(operator) {
|
|
158
|
+
return relations.filter((e) => e.tags.operator == operator);
|
|
159
|
+
}
|
|
160
|
+
|
|
153
161
|
/**
|
|
154
162
|
* fetch all operator
|
|
155
163
|
* @returns { string[] }
|