Converts the given string into an object property path array.

Syntax

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

toPath(str: string): (string | number)[]

Examples

TypeScript
toPath('a[0].b.c') //=> ['a', 0, 'b', 'c']
Last updated on
Edit this page