Skip to content

Commit fc3a3f6

Browse files
committed
now only using arrow functions
1 parent aa76018 commit fc3a3f6

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/components/DownloadButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import { defineComponent, computed } from 'vue'
1616
import { useCffstr } from 'src/store/cffstr'
1717
18-
function toDownloadUrl (body: string) {
18+
const toDownloadUrl = (body: string) => {
1919
return `data:text/vnd.yaml,${encodeURIComponent(body)}`
2020
}
2121

src/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { useApp, StepNameType } from '../store/app'
1717
* with the Router instance.
1818
*/
1919

20-
export default route(function (/* { store, ssrContext } */) {
20+
export default route((/* { store, ssrContext } */) => {
2121
const createHistory = process.env.SERVER
2222
? createMemoryHistory
2323
: (process.env.VUE_ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory)

src/store/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const firstStepIndex = 0
3636
const lastStepIndex = computed(() => state.value.showAdvanced ? stepNames.indexOf('finish-advanced') : stepNames.indexOf('finish-minimum'))
3737
const stepName = computed(() => stepNames[state.value.stepIndex])
3838

39-
export function useApp () {
39+
export const useApp = () => {
4040
const router = useRouter()
4141
return {
4242
cannotGoBack: computed(() => state.value.stepIndex === firstStepIndex),

src/store/cff.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const getInitialData = () => {
2424

2525
const cff = ref(getInitialData())
2626

27-
export function useCff () {
27+
export const useCff = () => {
2828
return {
2929
abstract: computed(() => cff.value.abstract),
3030
authors: computed(() => cff.value.authors),

src/store/cffstr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { CffType } from 'src/types'
99
import kebabcaseKeys from 'kebabcase-keys'
1010
import deepfilter from 'deep-filter'
1111

12-
export function useCffstr () {
12+
export const useCffstr = () => {
1313
const {
1414
abstract,
1515
authors,

src/store/validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ajv.addSchema(schema)
1212
type ajvErrorType = ErrorObject<string, Record<string, unknown>, unknown>
1313
const { jsObject } = useCffstr()
1414

15-
export function useValidation () {
15+
export const useValidation = () => {
1616
return {
1717
errors: computed(() => {
1818
ajv.validate(schema.$id, jsObject.value)

src/updown.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
function moveUpdate<Type> (index: number, value: number, array: Type[], updateArray: (a: Type[]) => void): void {
1+
const moveUpdate = <Type> (index: number, value: number, array: Type[], updateArray: (a: Type[]) => void): void => {
22
const newArray: Type[] = [...array]
33
newArray[index] = newArray.splice(index + value, 1, newArray[index])[0]
44
updateArray(newArray)
55
}
66

7-
export function moveDown<Type> (index: number, array: Type[], updateArray: (a: Type[]) => void): void {
7+
export const moveDown = <Type> (index: number, array: Type[], updateArray: (a: Type[]) => void): void => {
88
if (index === array.length - 1) return
99
moveUpdate(index, 1, array, updateArray)
1010
}
1111

12-
export function moveUp<Type> (index: number, array: Type[], updateArray: (a: Type[]) => void): void {
12+
export const moveUp = <Type> (index: number, array: Type[], updateArray: (a: Type[]) => void): void => {
1313
if (index === 0) return
1414
moveUpdate(index, -1, array, updateArray)
1515
}

0 commit comments

Comments
 (0)