printPathArray.mjs 223 B

12345678
  1. /**
  2. * Build a string describing the path.
  3. */
  4. export default function printPathArray(path) {
  5. return path.map(function (key) {
  6. return typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key;
  7. }).join('');
  8. }