sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
21 lines (16 loc) • 522 B
text/typescript
import debug from 'debug'
import {DEBUG_FRAGMENT} from '../constants'
const rootName = 'core:studio:navbar:search:'
export default debug(rootName)
export function debugWithName(name: string): debug.Debugger {
const namespace = `${rootName}${name}`
if (debug && debug.enabled(namespace)) {
return debug(namespace)
}
return debug(rootName)
}
export function isDebugMode(): boolean {
return typeof window === 'undefined'
? false
: window.location.hash.slice(1).split(';').includes(DEBUG_FRAGMENT)
}