aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ansi-escapes/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/ansi-escapes/index.js')
-rw-r--r--node_modules/ansi-escapes/index.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/node_modules/ansi-escapes/index.js b/node_modules/ansi-escapes/index.js
index ebd413b01..4d47b1098 100644
--- a/node_modules/ansi-escapes/index.js
+++ b/node_modules/ansi-escapes/index.js
@@ -3,12 +3,12 @@ const x = module.exports;
const ESC = '\u001B[';
const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
-x.cursorTo = function (x, y) {
- if (arguments.length === 0) {
- return ESC + 'H';
+x.cursorTo = (x, y) => {
+ if (typeof x !== 'number') {
+ throw new TypeError('The `x` argument is required');
}
- if (arguments.length === 1) {
+ if (typeof y !== 'number') {
return ESC + (x + 1) + 'G';
}
@@ -16,6 +16,10 @@ x.cursorTo = function (x, y) {
};
x.cursorMove = (x, y) => {
+ if (typeof x !== 'number') {
+ throw new TypeError('The `x` argument is required');
+ }
+
let ret = '';
if (x < 0) {