Socket
Socket
Sign inDemoInstall

@jsenv/humanize

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/humanize - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

28

dist/browser/jsenv_humanize_browser.js

@@ -25,4 +25,14 @@ const createDetailedMessage = (message, details = {}) => {

GREY: "\x1b[90m",
color: (text, ANSI_COLOR) => {
return ANSI.supported && ANSI_COLOR ? "".concat(ANSI_COLOR).concat(text).concat(RESET) : text;
color: (text, color) => {
if (!ANSI.supported) {
return text;
}
if (!color) {
return text;
}
if (text.trim() === "") {
// cannot set color of blank chars
return text;
}
return "".concat(color).concat(text).concat(RESET);
},

@@ -32,4 +42,14 @@ BOLD: "\x1b[1m",

STRIKE: "\x1b[9m",
effect: (text, ANSI_EFFECT) => {
return ANSI.supported && ANSI_EFFECT ? "".concat(ANSI_EFFECT).concat(text).concat(RESET) : text;
effect: (text, effect) => {
if (!ANSI.supported) {
return text;
}
if (!effect) {
return text;
}
// cannot add effect to empty string
if (text === "") {
return text;
}
return "".concat(effect).concat(text).concat(RESET);
}

@@ -36,0 +56,0 @@ };

32

dist/node/jsenv_humanize_node.js

@@ -216,6 +216,14 @@ import process$1 from "node:process";

GREY: "\x1b[90m",
color: (text, ANSI_COLOR) => {
return ANSI.supported && ANSI_COLOR
? `${ANSI_COLOR}${text}${RESET}`
: text;
color: (text, color) => {
if (!ANSI.supported) {
return text;
}
if (!color) {
return text;
}
if (text.trim() === "") {
// cannot set color of blank chars
return text;
}
return `${color}${text}${RESET}`;
},

@@ -226,6 +234,14 @@

STRIKE: "\x1b[9m",
effect: (text, ANSI_EFFECT) => {
return ANSI.supported && ANSI_EFFECT
? `${ANSI_EFFECT}${text}${RESET}`
: text;
effect: (text, effect) => {
if (!ANSI.supported) {
return text;
}
if (!effect) {
return text;
}
// cannot add effect to empty string
if (text === "") {
return text;
}
return `${effect}${text}${RESET}`;
},

@@ -232,0 +248,0 @@ };

{
"name": "@jsenv/humanize",
"version": "1.2.0",
"version": "1.2.1",
"description": "Generate messages meant to read by humans",

@@ -5,0 +5,0 @@ "license": "MIT",

------------ 23 executions ready ------------
directory: /Users/damien.maillard/dev/perso/jsenv-core/packages/independent/humanize/src
---------------------------------------------
✔ 01/23 _tests/byte/file_size.test.js [node/0.03s] (1 completed)
✔ 01/23 _tests/byte/file_size.test.js [node/0.04s] (1 completed)
✔ 02/23 _tests/byte/memory.test.js [node/0.03s] (2 completed)
✔ 03/23 _tests/content_frame/content_frame.test.js [node/0.07s] (3 completed)
✔ 04/23 _tests/js_value/_inspect.test.html [chromium/0.4s] (4 completed)
✔ 05/23 _tests/js_value/_inspect.test.html [firefox/0.1s] (5 completed)
✔ 03/23 _tests/content_frame/content_frame.test.js [node/0.09s] (3 completed)
✔ 04/23 _tests/js_value/_inspect.test.html [chromium/0.2s] (4 completed)
✔ 05/23 _tests/js_value/_inspect.test.html [firefox/0.2s] (5 completed)
✔ 06/23 _tests/js_value/_inspect.test.html [webkit/0.4s] (6 completed)
✔ 07/23 _tests/js_value/array.test.js [node/0.03s] (7 completed)
✔ 08/23 _tests/js_value/biginit.test.js [node/0.03s] (8 completed)
✔ 09/23 _tests/js_value/boolean.test.js [node/0.06s] (9 completed)
✔ 08/23 _tests/js_value/biginit.test.js [node/0.04s] (8 completed)
✔ 09/23 _tests/js_value/boolean.test.js [node/0.05s] (9 completed)
✔ 10/23 _tests/js_value/date.test.js [node/0.05s] (10 completed)
✔ 11/23 _tests/js_value/error.test.js [node/0.07s] (11 completed)
✔ 11/23 _tests/js_value/error.test.js [node/0.05s] (11 completed)
✔ 12/23 _tests/js_value/function.test.js [node/0.04s] (12 completed)
✔ 13/23 _tests/js_value/instance.test.js [node/0.04s] (13 completed)
✔ 14/23 _tests/js_value/null.test.js [node/0.03s] (14 completed)
✔ 14/23 _tests/js_value/null.test.js [node/0.05s] (14 completed)
✔ 15/23 _tests/js_value/number.test.js [node/0.05s] (15 completed)
✔ 16/23 _tests/js_value/object.test.js [node/0.06s] (16 completed)
✔ 17/23 _tests/js_value/regexp.test.js [node/0.04s] (17 completed)
✔ 18/23 _tests/js_value/string.test.js [node/0.03s] (18 completed)
✔ 19/23 _tests/js_value/symbol.test.js [node/0.04s] (19 completed)
✔ 16/23 _tests/js_value/object.test.js [node/0.05s] (16 completed)
✔ 17/23 _tests/js_value/regexp.test.js [node/0.05s] (17 completed)
✔ 18/23 _tests/js_value/string.test.js [node/0.05s] (18 completed)
✔ 19/23 _tests/js_value/symbol.test.js [node/0.06s] (19 completed)
✔ 20/23 _tests/js_value/undefined.test.js [node/0.04s] (20 completed)
✔ 21/23 _tests/time/decimals.test.js [node/0.05s] (21 completed)
✔ 22/23 _tests/time/duration.test.js [node/0.05s] (22 completed)
✔ 21/23 _tests/time/decimals.test.js [node/0.04s] (21 completed)
✔ 22/23 _tests/time/duration.test.js [node/0.04s] (22 completed)
✔ 23/23 _tests/time/ellapsed.test.js [node/0.04s] (all completed)
------------ 23 executions done -------------
status: all completed
duration: 2.5s (setup: 0.4s, execution: 2.4s, teardown: 0.2s)
duration: 2.8s (setup: 0.4s, execution: 2.6s, teardown: 0.2s)
---------------------------------------------

@@ -16,6 +16,14 @@ // https://github.com/Marak/colors.js/blob/master/lib/styles.js

GREY: "\x1b[90m",
color: (text, ANSI_COLOR) => {
return ANSI.supported && ANSI_COLOR
? `${ANSI_COLOR}${text}${RESET}`
: text;
color: (text, color) => {
if (!ANSI.supported) {
return text;
}
if (!color) {
return text;
}
if (text.trim() === "") {
// cannot set color of blank chars
return text;
}
return `${color}${text}${RESET}`;
},

@@ -26,6 +34,14 @@

STRIKE: "\x1b[9m",
effect: (text, ANSI_EFFECT) => {
return ANSI.supported && ANSI_EFFECT
? `${ANSI_EFFECT}${text}${RESET}`
: text;
effect: (text, effect) => {
if (!ANSI.supported) {
return text;
}
if (!effect) {
return text;
}
// cannot add effect to empty string
if (text === "") {
return text;
}
return `${effect}${text}${RESET}`;
},

@@ -32,0 +48,0 @@ };

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