Skip to content

Commit

Permalink
refactor: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
ludchieng committed May 21, 2023
1 parent 02bedd9 commit 754abbc
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default Vue.extend({
},
data: () => ({
clockInterval: 0,
time: {} as Time,
time: Object as Time,
}),
created () {
this.clockInterval = setInterval(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Stop/StopHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default Vue.extend({
DesignPageTitle,
},
props: {
stop: {} as PropType<StopType>,
stop: Object as PropType<StopType>,
},
})
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Stop/StopPrevNextStops.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default Vue.extend({
DesignPrevNext,
},
props: {
stop: {} as PropType<StopType>,
stop: Object as PropType<StopType>,
},
methods: {
getStop,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Stop/StopSchedules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ export default Vue.extend({
StopSchedulesVisits,
},
props: {
stop: {} as PropType<StopType>,
stop: Object as PropType<StopType>,
},
data: () => ({
fetchAbortController: new AbortController(),
visitsByDirections: [] as [string, VisitType[]][],
debugData: new Set(),
updatedAt: {} as Date,
updatedAt: Object as Date,
updateCounter: 0,
updateInterval: 0,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/components/Stop/StopSchedulesDetailsTimes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default Vue.extend({
UiSchedulesDetailsTimeInline,
},
props: {
visit: {} as PropType<VisitType>,
visit: Object as PropType<VisitType>,
isInline: {
type: Boolean,
default: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default Vue.extend({
UiSchedulesDetailsTimeWrapped,
},
props: {
visit: {} as PropType<VisitType>,
visit: Object as PropType<VisitType>,
},
methods: {
toTime,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Stop/StopSchedulesVisitTime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default Vue.extend({
components: { UiSchedulesTime },
props: {
visit: {
type: {} as PropType<VisitType>,
type: Object as PropType<VisitType>,
required: true,
},
},
Expand Down
4 changes: 3 additions & 1 deletion src/components/Stop/StopSchedulesVisits.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ export default Vue.extend({
StopSchedulesDetailsTimesNonStopPassage,
},
props: {
visits: {} as PropType<VisitType[]>,
visits: {
type: Array as PropType<VisitType[]>,
},
},
data: () => ({
updateCounter: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default Vue.extend({
},
props: {
label: String,
time: {} as PropType<Time>,
time: Object as PropType<Time>,
},
methods: {
toTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default Vue.extend({
},
props: {
label: String,
time: {} as PropType<Time>,
time: Object as PropType<Time>,
isTimeTextGray: {
type: Boolean,
default: false,
Expand Down
2 changes: 0 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,3 @@ new Vue({
store,
render: h => h(App),
}).$mount('#app')

console.log('VUE_APP_API_URL ', process.env.VUE_APP_API_URL)
2 changes: 1 addition & 1 deletion src/pages/TimetablesStopPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default Vue.extend({
StopPrevNextStops,
},
data: () => ({
stop: {} as StopType,
stop: Object as StopType,
}),
watch: {
'$route.path': {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/localstore/lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const getLinesByRef = () => {
}

export const getLinesByCategory = () => {
const res = {} as { [x: string]: any }
const res = Object as { [x: string]: any }
const lines = Object.entries(getLinesByRef())
.filter(([k, v]) => k.trim() !== '')
.map(([k, v]) => v) as any[]
Expand Down

0 comments on commit 754abbc

Please sign in to comment.