Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimdemedes committed May 11, 2024
1 parent 5a1c50e commit b6d0b52
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
20 changes: 10 additions & 10 deletions src/ink.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import process from 'node:process';
import React, { type ReactNode } from 'react';
import React, {type ReactNode} from 'react';
import throttle from 'lodash/throttle.js';
import { type DebouncedFunc } from 'lodash';
import {type DebouncedFunc} from 'lodash';
import ansiEscapes from 'ansi-escapes';
import isInCi from 'is-in-ci';
import autoBind from 'auto-bind';
import signalExit from 'signal-exit';
import patchConsole from 'patch-console';
import { type FiberRoot } from 'react-reconciler';
import {type FiberRoot} from 'react-reconciler';
import Yoga from 'yoga-wasm-web/auto';
import reconciler from './reconciler.js';
import render from './renderer.js';
import * as dom from './dom.js';
import logUpdate, { type LogUpdate } from './log-update.js';
import logUpdate, {type LogUpdate} from './log-update.js';
import instances from './instances.js';
import App from './components/App.js';

const noop = () => { };
const noop = () => {};

export type Options = {
stdout: NodeJS.WriteStream;
Expand Down Expand Up @@ -91,7 +91,7 @@ export default class Ink {
);

// Unmount when process exits
this.unsubscribeExit = signalExit(this.unmount, { alwaysLast: false });
this.unsubscribeExit = signalExit(this.unmount, {alwaysLast: false});

if (process.env['DEV'] === 'true') {
reconciler.injectIntoDevTools({
Expand Down Expand Up @@ -121,9 +121,9 @@ export default class Ink {
this.onRender();
};

resolveExitPromise: () => void = () => { };
rejectExitPromise: (reason?: Error) => void = () => { };
unsubscribeExit: () => void = () => { };
resolveExitPromise: () => void = () => {};
rejectExitPromise: (reason?: Error) => void = () => {};
unsubscribeExit: () => void = () => {};

calculateLayout = () => {
// The 'columns' property can be undefined or 0 when not using a TTY.
Expand All @@ -144,7 +144,7 @@ export default class Ink {
return;
}

const { output, outputHeight, staticOutput } = render(this.rootNode);
const {output, outputHeight, staticOutput} = render(this.rootNode);

// If <Static> output isn't empty, it means new children have been added to it
const hasStaticOutput = staticOutput && staticOutput !== '\n';
Expand Down
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
8 changes: 4 additions & 4 deletions src/render-border.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cliBoxes from 'cli-boxes';
import chalk from 'chalk';
import colorize from './colorize.js';
import { type DOMNode } from './dom.js';
import {type DOMNode} from './dom.js';
import type Output from './output.js';

const renderBorder = (
Expand Down Expand Up @@ -103,11 +103,11 @@ const renderBorder = (
const offsetY = showTopBorder ? 1 : 0;

if (topBorder) {
output.write(x, y, topBorder, { transformers: [] });
output.write(x, y, topBorder, {transformers: []});
}

if (showLeftBorder) {
output.write(x, y + offsetY, leftBorder, { transformers: [] });
output.write(x, y + offsetY, leftBorder, {transformers: []});
}

if (showRightBorder) {
Expand All @@ -117,7 +117,7 @@ const renderBorder = (
}

if (bottomBorder) {
output.write(x, y + height - 1, bottomBorder, { transformers: [] });
output.write(x, y + height - 1, bottomBorder, {transformers: []});
}
}
};
Expand Down
8 changes: 4 additions & 4 deletions src/render-node-to-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import wrapText from './wrap-text.js';
import getMaxWidth from './get-max-width.js';
import squashTextNodes from './squash-text-nodes.js';
import renderBorder from './render-border.js';
import { type DOMElement } from './dom.js';
import {type DOMElement} from './dom.js';
import type Output from './output.js';

// If parent container is `<Box>`, text nodes will be treated as separate nodes in
Expand Down Expand Up @@ -50,7 +50,7 @@ const renderNodeToOutput = (
return;
}

const { yogaNode } = node;
const {yogaNode} = node;

if (yogaNode) {
if (yogaNode.getDisplay() === Yoga.DISPLAY_NONE) {
Expand Down Expand Up @@ -83,7 +83,7 @@ const renderNodeToOutput = (

text = applyPaddingToText(node, text);

output.write(x, y, text, { transformers: newTransformers });
output.write(x, y, text, {transformers: newTransformers});
}

return;
Expand Down Expand Up @@ -120,7 +120,7 @@ const renderNodeToOutput = (
yogaNode.getComputedBorder(Yoga.EDGE_BOTTOM)
: undefined;

output.clip({ x1, x2, y1, y2 });
output.clip({x1, x2, y1, y2});
clipped = true;
}
}
Expand Down

0 comments on commit b6d0b52

Please sign in to comment.