spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / hooks / pane-state / base-mode-of / base-mode-of.ts
14 lines · 401 BRaw
1import type Git from '../../git'
2
3/**
4 * A stored or picked value as a base mode, or null when it names none.
5 *
6 * @param value what `$.store.get` returned or a Select carried
7 * @returns the mode, or null
8 */
9export function baseModeOf(value: unknown): Git.BaseMode | null {
10 const isMode =
11 value === 'session' || value === 'uncommitted' || value === 'branch'
12
13 return isMode ? value : null
14}