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 / sec-default / hooks / policy / is-pinned-variable.ts
GitHub Actions (publish-mods)chore: Update mods/ 3deb873 · 13 days ago History
16 lines · 597 BRaw
1import type { Settings } from 'claude-code'
2
3import { pinnedNames } from './pinned-names.js'
4
5/**
6 * Whether managed policy pins an environment variable: it sets the name
7 * (pinnedNames), in any case (some systems read `Path` and `PATH` as one).
8 *
9 * @param policy the managed settings, as `$.settings.read` answers them
10 * @param name the variable a plugin would set or unset
11 * @returns true when the organization set it
12 */
13export const isPinnedVariable = (policy: Settings, name: string): boolean =>
14 pinnedNames(policy).some(
15 pinned => pinned.toUpperCase() === name.toUpperCase(),
16 )