UNPKG

structured-elements

Version:

A TypeScript package for modelling and validating data

14 lines (12 loc) 204 B
export const buildElementPath = ({ key, path, }: { key: string | number path: string }): string => { if (typeof key === `string`) { return `${path}.${key}` } return `${path}[${key}]` }