@b613/utils
Advanced tools
Comparing version 1.0.0-alpha8 to 1.0.0-alpha9
@@ -6,3 +6,3 @@ "use strict"; | ||
const axios_1 = tslib_1.__importDefault(require("axios")); | ||
const cli_color_1 = tslib_1.__importDefault(require("cli-color")); | ||
const color_1 = tslib_1.__importDefault(require("./color")); | ||
const axios_cache_adapter_1 = require("axios-cache-adapter"); | ||
@@ -17,7 +17,7 @@ function createClient(baseURL, _a = {}) { | ||
if (response.status >= 400) { | ||
logger === null || logger === void 0 ? void 0 : logger.info(`${prefix} ${cli_color_1.default.red(response.status)}`, 'HTTP'); | ||
logger === null || logger === void 0 ? void 0 : logger.info(`${prefix} ${color_1.default.red(response.status)}`, 'HTTP'); | ||
logger === null || logger === void 0 ? void 0 : logger.error(`Error ${response.status}: ${JSON.stringify(response.data, null, 2)}`); | ||
} | ||
else { | ||
logger === null || logger === void 0 ? void 0 : logger.info(`${prefix} ${cli_color_1.default.green(response.status)}`, 'HTTP'); | ||
logger === null || logger === void 0 ? void 0 : logger.info(`${prefix} ${color_1.default.green(response.status)}`, 'HTTP'); | ||
} | ||
@@ -24,0 +24,0 @@ return response; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const cli_color_1 = tslib_1.__importDefault(require("cli-color")); | ||
const color_1 = tslib_1.__importDefault(require("../color")); | ||
class Trace { | ||
@@ -19,6 +19,6 @@ constructor(name) { | ||
warn(msg, prefix = 'WARN') { | ||
process.stderr.write(this.parse(cli_color_1.default.yellow(prefix), msg)); | ||
process.stderr.write(this.parse(color_1.default.yellow(prefix), msg)); | ||
} | ||
error(msg, prefix = 'ERROR') { | ||
process.stderr.write(this.parse(cli_color_1.default.red(prefix), msg)); | ||
process.stderr.write(this.parse(color_1.default.red(prefix), msg)); | ||
} | ||
@@ -25,0 +25,0 @@ } |
{ | ||
"name": "@b613/utils", | ||
"version": "1.0.0-alpha8", | ||
"version": "1.0.0-alpha9", | ||
"description": "Set of utility methods for common operations", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
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
116133
61
2014