MCPcopy Create free account
hub / github.com/dataease/SQLBot / getPathPrefix

Function getPathPrefix

frontend/src/utils/useCache.ts:5–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3type CacheType = 'localStorage' | 'sessionStorage'
4
5const getPathPrefix = () => {
6 const pathname = window.location.pathname
7 // eslint-disable-next-line no-useless-escape
8 const match = pathname.match(/^\/([^\/]+)/)
9 return match ? `${match[1]}_` : 'sqlbot_v1_'
10}
11
12export const useCache = (type: CacheType = 'localStorage') => {
13 const originalCache = new WebStorageCache({ storage: type })

Callers 1

useCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected