Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quest-runner

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quest-runner - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

2

package.json
{
"name": "quest-runner",
"version": "0.1.5",
"version": "0.1.6",
"description": "Tool for creating and processing logic flow scenarios",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -231,2 +231,6 @@ const ansi = require('ansi-colors');

squeeze(array, limit = 10, separator = '...') {
return utils.squeeze(array, limit, separator);
}
timeout;

@@ -347,3 +351,14 @@

if (options?.silent !== true) {
console.log(`${ansi.magentaBright('CALL')} ${ansi.cyanBright(method)} ${ansi.yellowBright(url)}`);
let anonymous = true;
for (const header in request.headers) {
if (header.toLowerCase() === 'authorization') {
anonymous = false;
break;
}
}
if (anonymous) {
console.log(`${ansi.greenBright('CALL')} ${ansi.blueBright(method)} ${ansi.yellowBright(url)}`);
} else {
console.log(`${ansi.magentaBright('CALL')} ${ansi.cyanBright(method)} ${ansi.yellowBright(url)}`);
}
console.log();

@@ -498,9 +513,14 @@ }

});
process.stdin.setRawMode(true);
process.stdin.resume();
const time = (options?.time ?? 10) * 1000;
let query = options?.text;
if (query == undefined) query = '' +
if (query === undefined) query = '' +
ansi.whiteBright('Press ') +
ansi.greenBright('Enter ') +
ansi.whiteBright('to continue... ');
if (query != undefined && 0 === ('' + query).trim().length) query = undefined;
let enter = false;
try {
if (query != undefined) process.stdout.write(query);
await new Promise(resolve => {

@@ -510,7 +530,12 @@ const ac = new AbortController();

signal.addEventListener('abort', () => {
readline.moveCursor(process.stdout, 0, -1);
resolve();
}, { once: true });
rl.question(query, { signal }, _answer => {
rl.question(query ?? '', { signal }, _answer => {
if (query != undefined) {
readline.moveCursor(process.stdout, 0, -1);
readline.clearLine(process.stdout, 1);
}
enter = true;
resolve();
rl.close();
});

@@ -522,3 +547,4 @@ if (time > 0) setTimeout(() => ac.abort(), time);

rl.close();
console.log();
process.stdin.setRawMode(false);
if (query != undefined && !enter) console.log();
}

@@ -525,0 +551,0 @@ }

@@ -118,4 +118,19 @@ class Utils {

squeeze = (array, limit = 10, separator = '...') => {
if (array == undefined) return array;
if (typeof array !== 'object' || !Array.isArray(array)) return array;
if (array.length <= limit) return array;
if (separator == undefined) {
const half = Math.floor(limit / 2);
const result = [ ...array.slice(0, half), ...array.slice(half - limit) ];
return result;
} else {
const half = Math.floor((limit - 1) / 2);
const result = [ ...array.slice(0, half), separator, ...array.slice(1 + half - limit) ];
return result;
}
};
}
module.exports = new Utils;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc