Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Use camelCasing
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed May 2, 2022
1 parent 1f351fc commit 651a1e7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/stores/search.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineStore } from 'pinia'

import { deepclone } from '~/utils/clone'
import { deepClone } from '~/utils/clone'
import type { DeepWriteable } from '~/types/utils'

import {
Expand Down Expand Up @@ -57,7 +57,7 @@ export const useSearchStore = defineStore('search', {
state: (): SearchState => ({
searchType: ALL_MEDIA,
searchTerm: '',
filters: deepclone(filterData as DeepWriteable<typeof filterData>),
filters: deepClone(filterData as DeepWriteable<typeof filterData>),
}),
getters: {
filterCategories(state) {
Expand Down Expand Up @@ -136,7 +136,7 @@ export const useSearchStore = defineStore('search', {
}))
}
return {
...(deepclone(filterData) as DeepWriteable<typeof filterData>),
...(deepClone(filterData) as DeepWriteable<typeof filterData>),
audioProviders: resetProviders(AUDIO),
imageProviders: resetProviders(IMAGE),
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/clone.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import rfdc from 'rfdc'

export const deepclone = rfdc()
export const deepClone = rfdc()
4 changes: 2 additions & 2 deletions src/utils/search-query-transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '~/constants/filters'
import { ALL_MEDIA, SupportedSearchType } from '~/constants/media'
import { getParameterByName } from '~/utils/url-params'
import { deepclone } from '~/utils/clone'
import { deepClone } from '~/utils/clone'

export interface ApiQueryParams {
q?: string
Expand Down Expand Up @@ -171,7 +171,7 @@ export const queryToFilterData = ({
}) => {
// The default filterData object from search store doesn't contain provider filters,
// so we can't use it.
const filters = deepclone(defaultFilters) as Filters
const filters = deepClone(defaultFilters) as Filters
const filterTypes = getMediaFilterTypes(searchType)
const differentFiltersWithSameApiParams = [
'audioProviders',
Expand Down
6 changes: 3 additions & 3 deletions test/unit/specs/utils/search-query-transform.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { deepclone } from '~/utils/clone'
import { deepClone } from '~/utils/clone'
import {
filtersToQueryData,
queryToFilterData,
Expand Down Expand Up @@ -257,7 +257,7 @@ describe('searchQueryTransform', () => {
searchBy: 'creator',
mature: 'true',
}
const testFilters = deepclone(filters)
const testFilters = deepClone(filters)
testFilters.audioProviders = [
{ code: 'jamendo', checked: true },
{ code: 'wikimedia', checked: true },
Expand Down Expand Up @@ -299,7 +299,7 @@ describe('searchQueryTransform', () => {
searchBy: 'creator',
mature: 'true',
}
const expectedFilters = deepclone(filters)
const expectedFilters = deepClone(filters)
const setChecked = (code, filterCategory) => {
const idx = expectedFilters[filterCategory].findIndex(
(item) => item.code === code
Expand Down

0 comments on commit 651a1e7

Please sign in to comment.