MCPcopy Index your code
hub / github.com/simstudioai/sim / getNestedString

Function getNestedString

apps/sim/app/api/v1/admin/types.ts:415–427  ·  view source on GitHub ↗

* Safely get a nested string value from an object.

(obj: Record<string, unknown>, path: string)

Source from the content-addressed store, hash-verified

413 * Safely get a nested string value from an object.
414 */
415function getNestedString(obj: Record<string, unknown>, path: string): string | undefined {
416 const parts = path.split('.')
417 let current: unknown = obj
418
419 for (const part of parts) {
420 if (current === null || typeof current !== 'object') {
421 return undefined
422 }
423 current = (current as Record<string, unknown>)[part]
424 }
425
426 return typeof current === 'string' ? current : undefined
427}
428
429// =============================================================================
430// Organization Types

Callers 1

extractWorkflowMetadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected