Skip to content

Commit

Permalink
Merge branch 'master' into tom-sherman-refactor-app-to-function-compo…
Browse files Browse the repository at this point in the history
…nent
  • Loading branch information
vadimdemedes committed May 11, 2024
2 parents 39a0819 + ba795a1 commit b1e8e7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/parse-keypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const keyName: Record<string, string> = {
'[7^': 'home',
'[8^': 'end',
/* misc. */
'[Z': 'tab'
'[Z': 'tab',
};

export const nonAlphanumericKeys = [...Object.values(keyName), 'backspace'];
Expand All @@ -106,7 +106,7 @@ const isShiftKey = (code: string) => {
'[6$',
'[7$',
'[8$',
'[Z'
'[Z',
].includes(code);
};

Expand All @@ -122,7 +122,7 @@ const isCtrlKey = (code: string) => {
'[5^',
'[6^',
'[7^',
'[8^'
'[8^',
].includes(code);
};

Expand Down Expand Up @@ -160,7 +160,7 @@ const parseKeypress = (s: Buffer | string = ''): ParsedKey => {
shift: false,
option: false,
sequence: s,
raw: s
raw: s,
};

key.sequence = key.sequence || s || key.name;
Expand Down
7 changes: 5 additions & 2 deletions src/reconciler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ if (process.env['DEV'] === 'true') {
try {
await import('./devtools.js');
} catch (error: any) {
if (error.code === 'MODULE_NOT_FOUND') {
if (error.code === 'ERR_MODULE_NOT_FOUND') {
console.warn(
`
Debugging with React Devtools requires \`react-devtools-core\` dependency to be installed.
The environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`,
but this failed as it was not installed. Debugging with React Devtools requires it.
To install use this command:
$ npm install --save-dev react-devtools-core
`.trim() + '\n',
Expand Down

0 comments on commit b1e8e7e

Please sign in to comment.