printPathArray.js 329 B

1234567891011121314151617
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true,
  4. });
  5. exports.printPathArray = printPathArray;
  6. /**
  7. * Build a string describing the path.
  8. */
  9. function printPathArray(path) {
  10. return path
  11. .map((key) =>
  12. typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key,
  13. )
  14. .join('');
  15. }