-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdeps.js
87 lines (85 loc) · 1.59 KB
/
deps.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
'use strict'
const getDependencies = (opt, files) => {
const {
tripsWithoutShapeId,
stopsWithoutLevelId,
} = opt
return {
shape_exists: [
'shapes',
],
agency: [
'is_timezone',
],
stops: [
'is_timezone',
...(stopsWithoutLevelId ? [] : ['levels']),
],
transfers: [
'stops',
],
stop_times: [
'trips',
'stops',
'service_days',
'frequencies',
],
routes: [
'agency',
],
trips: [
'routes',
'service_days',
...(tripsWithoutShapeId ? [] : ['shapes', 'shape_exists']),
],
frequencies: [
'trips',
],
pathways: [
'stops',
],
feed_info: [
'is_valid_lang_code',
],
translations: [
'is_valid_lang_code',
// > table_name
// > Defines the dataset table that contains the field to be translated. The following values are allowed:
// > agency
// > stops
// > routes
// > trips
// > stop_times
// > feed_info
// > pathways
// > levels
// > attributions
// https://gtfs.org/schedule/reference/#translationstxt
// todo: respect opt.*!
// these are soft dependencies, they are not depended upon, they must only be imported first
// todo: only specify dependencies here if the files are not in use
'agency',
'stops',
'routes',
'trips',
...(files.includes('stop_times')
? ['stop_times']
: []
),
...(files.includes('feed_info')
? ['feed_info']
: []
),
...(files.includes('pathways')
? ['pathways']
: []
),
...(files.includes('levels')
? ['levels']
: []
),
// not supported yet: attributions
],
}
}
module.exports = getDependencies