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 / own-option / member-of / member-of.ts
13 lines · 462 BRaw
1/**
2 * One step into settings read as plain data: the value's own member of that
3 * name, or undefined when the value is no object or holds none.
4 *
5 * @param value what was read so far
6 * @param key the member's name
7 * @returns the member, or undefined
8 */
9export function memberOf(value: unknown, key: string): unknown {
10 const isObject = typeof value === 'object' && value !== null
11
12 return isObject ? new Map(Object.entries(value)).get(key) : undefined
13}