printPathArray.js.flow 282 B

1234567891011121314
  1. // @flow strict
  2. /**
  3. * Build a string describing the path.
  4. */
  5. export default function printPathArray(
  6. path: $ReadOnlyArray<string | number>,
  7. ): string {
  8. return path
  9. .map(key =>
  10. typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key,
  11. )
  12. .join('');
  13. }