d3b92593d5
- Create Axios-based API client with sources, jobs, and dashboard endpoints - Add responsive Layout component with navigation sidebar - Set up React Router with Dashboard, Backups, and Settings routes - Configure TanStack Query provider with default options - Use lucide-react for navigation icons
28 lines
664 B
JavaScript
28 lines
664 B
JavaScript
import { inspectList } from './helpers'
|
|
|
|
function inspectMapEntry([key, value], options) {
|
|
options.truncate -= 4
|
|
key = options.inspect(key, options)
|
|
options.truncate -= key.length
|
|
value = options.inspect(value, options)
|
|
return `${key} => ${value}`
|
|
}
|
|
|
|
// IE11 doesn't support `map.entries()`
|
|
function mapToEntries(map) {
|
|
const entries = []
|
|
map.forEach((value, key) => {
|
|
entries.push([key, value])
|
|
})
|
|
return entries
|
|
}
|
|
|
|
export default function inspectMap(map, options) {
|
|
const size = map.size - 1
|
|
if (size <= 0) {
|
|
return 'Map{}'
|
|
}
|
|
options.truncate -= 7
|
|
return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`
|
|
}
|