Converts the given array values into an object property path string.

Syntax

TypeScript
import { fromPath } from '@opentf/std';

fromPath(arr: (string | number)[] = []): string

Examples

TypeScript
fromPath([0]) //=> '[0]'

fromPath(['a', '0', 'b', 'c']) //=> 'a[0].b.c'

fromPath(['a', 1, 'b', 'c']) //=> 'a[1].b.c'
Last updated on
Edit this page