MCPcopy Create free account
hub / github.com/ShipSecAI/studio / pick

Function pick

packages/component-sdk/src/tool-helpers.ts:136–147  ·  view source on GitHub ↗

* Pick specific keys from an object.

(
  obj: T,
  keys: K[]
)

Source from the content-addressed store, hash-verified

134 * Pick specific keys from an object.
135 */
136function pick<T extends Record<string, unknown>, K extends string>(
137 obj: T,
138 keys: K[]
139): Pick<T, K> {
140 const result = {} as Pick<T, K>;
141 for (const key of keys) {
142 if (key in obj) {
143 (result as Record<string, unknown>)[key] = obj[key];
144 }
145 }
146 return result;
147}
148
149type ZodObjectLike = {
150 shape?: Record<string, AnySchema> | (() => Record<string, AnySchema>);

Callers 1

getToolSchemaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected