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.
TypeScript
/**
* One key's value in an os-release file, unquoted; undefined when the file
* has no such line.
*
* @param content the file's text
* @param key the key
* @returns the value, or undefined
*/
export const osReleaseValue = (content: string, key: 'ID' | 'VERSION_ID') =>
content
.split('\n')
.map(line => /^(ID|VERSION_ID)=(.*)$/.exec(line))
.find(match => match?.[1] === key)?.[2]
?.replace(/^"|"$/g, '')