constants.js 627 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. /**
  6. * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  7. *
  8. * This source code is licensed under the MIT license found in the
  9. * LICENSE file in the root directory of this source tree.
  10. *
  11. *
  12. */
  13. const isWindows = process.platform === 'win32';
  14. const KEYS = (exports.KEYS = {
  15. ARROW_DOWN: '\u001b[B',
  16. ARROW_LEFT: '\u001b[D',
  17. ARROW_RIGHT: '\u001b[C',
  18. ARROW_UP: '\u001b[A',
  19. BACKSPACE: Buffer.from(isWindows ? '08' : '7f', 'hex').toString(),
  20. CONTROL_C: '\u0003',
  21. CONTROL_D: '\u0004',
  22. ENTER: '\r',
  23. ESCAPE: '\u001b'
  24. });