Skip to content

⬅️ Back to Table of Contents

📄 index.test.ts

📊 Analysis Summary

Metric Count
🔧 Functions 16
📦 Imports 16
📊 Variables & Constants 8

📚 Table of Contents

🛠️ File Location:

📂 packages/core/useStorage/index.test.ts

📦 Imports

Name Source
debounceFilter @vueuse/shared
beforeEach vitest
describe vitest
expect vitest
it vitest
vi vitest
deepRef vue
defineComponent vue
nextTick vue
toRaw vue
mount ../../.test
nextTwoTick ../../.test
useSetup ../../.test
customStorageEventName ./index
StorageSerializers ./index
useStorage ./index

Variables & Constants

Name Type Kind Value Exported
KEY "custom-key" const 'custom-key'
ANOTHER_KEY "another-key" const 'another-key'
storageState Map<string, string | number> const new Map<string, string | number | undefined>()
storageMock { getItem: any; setItem: any; removeItem: any; clear: any; } const `{
getItem: vi.fn(x => storageState.get(x)),
setItem: vi.fn((x, v) => storageState.set(x, v)),
removeItem: vi.fn(x => storageState.delete(x)),
clear: vi.fn(() => storageState.clear()),
}`
storage Storage const storageMock as any as Storage
call [CustomEvent<any>] let/var eventFn.mock.calls[0] as [CustomEvent]
call2 [CustomEvent<any>] let/var eventFn.mock.calls[1] as [CustomEvent]
customStorage { getItem: (key: string) => string; setItem: (key: string, value: string) => void; removeItem: (key: string) => void; } let/var `{
getItem: storage.getItem,
setItem: storage.setItem,
removeItem: storage.removeItem,
}`

Functions

mergeDefaults(value: string, initial: string): string[]

Code
(value, initial) => [...initial, ...value]
  • Parameters:
  • value: string
  • initial: string
  • Return Type: string[]

mergeDefaults(value: string, initial: string): string[]

Code
(value, initial) => [...initial, ...value]
  • Parameters:
  • value: string
  • initial: string
  • Return Type: string[]

mergeDefaults(value: string, initial: string): string[]

Code
(value, initial) => [...initial, ...value]
  • Parameters:
  • value: string
  • initial: string
  • Return Type: string[]

mergeDefaults(value: string, initial: string): string[]

Code
(value, initial) => [...initial, ...value]
  • Parameters:
  • value: string
  • initial: string
  • Return Type: string[]

mergeDefaults(value: string, initial: string): string

Code
(value, initial) => value + initial
  • Parameters:
  • value: string
  • initial: string
  • Return Type: string

mergeDefaults(value: string, initial: string): string

Code
(value, initial) => value + initial
  • Parameters:
  • value: string
  • initial: string
  • Return Type: string

mergeDefaults(value: string, initial: string): string

Code
(value, initial) => value + initial
  • Parameters:
  • value: string
  • initial: string
  • Return Type: string

mergeDefaults(value: string, initial: string): string

Code
(value, initial) => value + initial
  • Parameters:
  • value: string
  • initial: string
  • Return Type: string

getItem(): any

Code
() => null
  • Return Type: any

setItem(): never

Code
() => { throw new Error('write item error') }
  • Return Type: never

getItem(): any

Code
() => null
  • Return Type: any

setItem(): never

Code
() => { throw new Error('write item error') }
  • Return Type: never

getItem(): any

Code
() => null
  • Return Type: any

setItem(): never

Code
() => { throw new Error('write item error') }
  • Return Type: never

getItem(): any

Code
() => null
  • Return Type: any

setItem(): never

Code
() => { throw new Error('write item error') }
  • Return Type: never