Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import cliTruncate from 'cli-truncate';
import figures from 'figures';
import * as logSymbols from 'log-symbols';
import logUpdate from 'log-update';
import ora from 'ora';
import { EMPTY, Observable, Subject, timer } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { indentString, stripAnsi } from './displayUtils';
import { areTasksDone, getTasksError } from './tasks';
import { InteractiveCLI, TaskStatus } from './types';
// tslint:disable-next-line no-any
type Spinners = any;
const pointer = chalk.yellow(figures.pointer);
const skipped = chalk.yellow(figures.arrowDown);
const getSymbol = (task: TaskStatus, mutableSpinners: Spinners) => {
if (mutableSpinners[task.id] == undefined) {
const spinner = ora({ color: 'yellow' });
mutableSpinners[task.id] = spinner;
}
const hasSubtasks = task.subtasks !== undefined && task.subtasks.length > 0;
if (task.pending) {
return hasSubtasks ? pointer : chalk.yellow(mutableSpinners[task.id].frame().trim());
}
if (task.complete) {
return logSymbols.success;
}
continue
}
console.error(error)
continue
}
if (answer) {
const installed = await moduler.install(
pack.name,
pack.version
)
console.log(c.blue(
figures.arrowDown,
c.bold(pack.name + (pack.version ?
c.gray.bold('@' + pack.version) : '')
),
'installed',
installed ?
`in ${Math.round(installed.elapsed * 10000) / 10000000}s!` :
'!'
) + '\n')
}
} else {
const loc = resolved.location === 'global cache' ?
'jay\'s cache' :
resolved.location
console.log(
c.green(
{' '.repeat(2)}
You can save up to{' '}
{this.doneSearching ? null : (
{' '}
)}
{prettyBytes(this.totalPotential)}.
<div>
<span>
{' '.repeat(2)}
{this.doneSearching ? (
({figures.arrowDown} {figures.arrowUp}) Move up / down
{' '.repeat(6)}
(space) Select item
{' '.repeat(6)}
(d) Show {this.state.mode === 'docs' ? 'commands' : 'docs'}
{' '.repeat(6)}
(enter) Execute
) : (
<span>
Press s to stop searching.
</span>
)}
</span>
</div>
<div>
<div></div></div>
'use strict';
const isCI = require('is-ci');
const chalk = require('chalk');
const logSymbols = require('log-symbols');
const figures = require('figures');
const elegantSpinner = require('elegant-spinner');
const logUpdate = require('log-update');
const indentString = require('indent-string');
const pointer = chalk.yellow(figures.pointer);
const skipped = chalk.yellow(figures.arrowDown);
const isDefined = x => x !== null && x !== undefined;
const getSymbol = (task, options) => {
if (!task.spinner) {
task.spinner = elegantSpinner();
}
if (task.isPending()) {
return options.showSubtasks !== false && task.subtasks.length > 0 ? pointer : chalk.yellow(task.spinner());
}
if (task.isCompleted()) {
return logSymbols.success;
}
getTasksError,
areTasksDone,
} from '@neo-one/server-plugin';
import chalk from 'chalk';
import cliTruncate from 'cli-truncate';
import elegantSpinner from 'elegant-spinner';
import figures from 'figures';
import indentString from 'indent-string';
import logSymbols from 'log-symbols';
import { map, switchMap, take } from 'rxjs/operators';
import stripAnsi from 'strip-ansi';
import logUpdate from 'log-update';
const pointer = chalk.yellow(figures.pointer);
const skipped = chalk.yellow(figures.arrowDown);
const addCommonResource = ({
cli,
command,
crud,
}: {|
cli: InteractiveCLI,
command: Command,
crud: CRUDResourceBase<*, *>,
|}) => {
command.autocomplete({
data: async () => crud.getCLIAutocomplete({ cli }),
});
};
const addCommon = ({
const symbol = Theme.getValueBy(symbols, type, (): string => {
if (type === IndicationType.Active) return frame();
if (type === IndicationType.Success) return Figures.tick;
if (type === IndicationType.Skip) return Figures.arrowDown;
if (type === IndicationType.Error) return Figures.cross;
if (type === IndicationType.Message) return Figures.line;
if (type === IndicationType.Info) return Figures.info;
if (type === IndicationType.Warning) return Figures.warning;
if (type === IndicationType.Subtask) return Figures.pointerSmall;
if (type === IndicationType.List) return Figures.pointer;
return symbols.get(IndicationType.Default) || this.symbol(IndicationType.Subtask);
});
'use strict';
const chalk = require('chalk');
const logSymbols = require('log-symbols');
const figures = require('figures');
const elegantSpinner = require('elegant-spinner');
const pointer = chalk.yellow(figures.pointer);
const skipped = chalk.yellow(figures.arrowDown);
exports.isDefined = x => x !== null && x !== undefined;
exports.getSymbol = (task, options) => {
if (!task.spinner) {
task.spinner = elegantSpinner();
}
if (task.isPending()) {
return options.showSubtasks !== false && task.subtasks.length > 0 ? pointer : chalk.yellow(task.spinner());
}
if (task.isCompleted()) {
return logSymbols.success;
}