Comparing version 2.0.6 to 2.0.7
import { Base } from '../base'; | ||
export declare function shouldDisplaySpinner(): boolean; | ||
export declare function getSpinner(): ActionBase; | ||
export interface ITask { | ||
@@ -4,0 +4,0 @@ action: string; |
@@ -13,12 +13,17 @@ "use strict"; | ||
const config_1 = require("../config"); | ||
function shouldDisplaySpinner() { | ||
return (!process.env.DEBUG && | ||
!config_1.Config.mock && | ||
!config_1.Config.debug && | ||
function getSpinner() { | ||
let Action; | ||
if (config_1.Config.debug) | ||
Action = require('./debug').DebugAction; | ||
else if (!config_1.Config.mock && | ||
!!process.stdin.isTTY && | ||
!!process.stderr.isTTY && | ||
!process.env.CI && | ||
process.env.TERM !== 'dumb'); | ||
process.env.TERM !== 'dumb') | ||
Action = require('./spinner').SpinnerAction; | ||
else | ||
Action = require('./simple').SimpleAction; | ||
return new Action(); | ||
} | ||
exports.shouldDisplaySpinner = shouldDisplaySpinner; | ||
exports.getSpinner = getSpinner; | ||
class ActionBase extends base_1.Base { | ||
@@ -25,0 +30,0 @@ start(action, status) { |
@@ -5,4 +5,2 @@ "use strict"; | ||
const errors_1 = require("./errors"); | ||
const spinner_1 = require("./action/spinner"); | ||
const simple_1 = require("./action/simple"); | ||
const base_1 = require("./action/base"); | ||
@@ -31,5 +29,4 @@ const base_2 = require("./base"); | ||
get action() { | ||
if (!this._action) { | ||
this._action = base_1.shouldDisplaySpinner() ? new spinner_1.SpinnerAction() : new simple_1.SimpleAction(); | ||
} | ||
if (!this._action) | ||
this._action = base_1.getSpinner(); | ||
return this._action; | ||
@@ -36,0 +33,0 @@ } |
{ | ||
"name": "cli-ux", | ||
"description": "set of CLI output utilities", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"author": "Jeff Dickey", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/jdxcode/cli-ux/issues", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
46755
32
1440
6