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 / kept-of / kept-of.ts
9 lines · 317 BRaw
1/**
2 * The items that are there: nulls dropped, so a part may answer null for
3 * "nothing here" and the whole lists what is left.
4 *
5 * @param items values or nulls
6 * @returns the values, in order
7 */
8export const keptOf = <T>(items: readonly (T | null)[]): T[] =>
9 items.filter((item): item is T => item !== null)