flex-plugins-utils-logger
Advanced tools
Comparing version 0.2.1 to 0.2.2
import * as ora from 'ora'; | ||
export declare type OraCallback<T, R> = (arg: T) => R; | ||
export declare const _getSpinner: (text: string) => ora.Ora; | ||
export declare const progress: <R>(title: string, action: OraCallback<ora.Ora, any>) => Promise<R>; | ||
interface OraOptions { | ||
text: string; | ||
isEnabled?: boolean; | ||
} | ||
export declare const _getSpinner: (text: string, opts: Partial<OraOptions>) => ora.Ora; | ||
export declare const progress: <R>(title: string, action: OraCallback<ora.Ora, any>, opts?: OraOptions | undefined) => Promise<R>; | ||
export default progress; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -64,5 +75,7 @@ if (k2 === undefined) k2 = k; | ||
var env_1 = __importDefault(require("./env")); | ||
exports._getSpinner = function (text) { | ||
var options = { text: text }; | ||
if (env_1.default.isDebug() || env_1.default.isTrace()) { | ||
exports._getSpinner = function (text, opts) { | ||
var options = __assign({ text: text }, opts); | ||
var enabledProvided = 'isEnabled' in opts; | ||
var isVerboseOrQuiet = env_1.default.isDebug() || env_1.default.isTrace() || env_1.default.isQuiet(); | ||
if (!enabledProvided && isVerboseOrQuiet) { | ||
options.isEnabled = false; | ||
@@ -72,3 +85,3 @@ } | ||
}; | ||
exports.progress = function (title, action) { return __awaiter(void 0, void 0, void 0, function () { | ||
exports.progress = function (title, action, opts) { return __awaiter(void 0, void 0, void 0, function () { | ||
var spinner, response, e_1; | ||
@@ -78,3 +91,3 @@ return __generator(this, function (_a) { | ||
case 0: | ||
spinner = exports._getSpinner(title); | ||
spinner = exports._getSpinner(title, opts || {}); | ||
_a.label = 1; | ||
@@ -81,0 +94,0 @@ case 1: |
{ | ||
"name": "flex-plugins-utils-logger", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Flex Plugins Logger", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
37369
569