@jsenv/humanize 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -683,7 +683,8 @@ const inspectStringObject = (value, {
683
683
  });
684
684
  };
685
685
 
686
- // primitives
686
+ // tslint:disable:ordered-imports
687
+
687
688
  const humanize = (value, {
688
689
  parenthesis = false,
689
690
  quote = "auto",
@@ -888,7 +888,8 @@ const inspectStringObject = (
888
888
  return inspectConstructor(`String(${stringSource})`, { useNew, parenthesis });
889
889
  };
890
890
 
891
- // primitives
891
+ // tslint:disable:ordered-imports
892
+
892
893
 
893
894
  const humanize = (
894
895
  value,
@@ -1925,6 +1926,9 @@ const createTaskLog = (
1925
1926
  fail: () => {},
1926
1927
  };
1927
1928
  }
1929
+ if (animated && process.env.SNAPSHOTING_FUNCTION_SIDE_EFFECTS) {
1930
+ animated = false;
1931
+ }
1928
1932
  const startMs = Date.now();
1929
1933
  const dynamicLog = createDynamicLog();
1930
1934
  let message = label;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/humanize",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Generate messages meant to read by humans",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,30 +1,30 @@
1
1
  ------------ 23 executions ready ------------
2
2
  directory: /Users/damien.maillard/dev/perso/jsenv-core/packages/independent/humanize/src
3
3
  ---------------------------------------------
4
- ✔ 01/23 _tests/byte/file_size.test.js [node/0.03s] (1 completed)
4
+ ✔ 01/23 _tests/byte/file_size.test.js [node/0.04s] (1 completed)
5
5
  ✔ 02/23 _tests/byte/memory.test.js [node/0.03s] (2 completed)
6
- ✔ 03/23 _tests/content_frame/content_frame.test.js [node/0.08s] (3 completed)
7
- ✔ 04/23 _tests/js_value/_inspect.test.html [chromium/0.5s] (4 completed)
6
+ ✔ 03/23 _tests/content_frame/content_frame.test.js [node/0.1s] (3 completed)
7
+ ✔ 04/23 _tests/js_value/_inspect.test.html [chromium/0.2s] (4 completed)
8
8
  ✔ 05/23 _tests/js_value/_inspect.test.html [firefox/0.2s] (5 completed)
9
9
  ✔ 06/23 _tests/js_value/_inspect.test.html [webkit/0.5s] (6 completed)
10
- ✔ 07/23 _tests/js_value/array.test.js [node/0.03s] (7 completed)
11
- ✔ 08/23 _tests/js_value/biginit.test.js [node/0.03s] (8 completed)
12
- ✔ 09/23 _tests/js_value/boolean.test.js [node/0.06s] (9 completed)
13
- ✔ 10/23 _tests/js_value/date.test.js [node/0.06s] (10 completed)
14
- ✔ 11/23 _tests/js_value/error.test.js [node/0.05s] (11 completed)
15
- ✔ 12/23 _tests/js_value/function.test.js [node/0.07s] (12 completed)
16
- ✔ 13/23 _tests/js_value/instance.test.js [node/0.06s] (13 completed)
17
- ✔ 14/23 _tests/js_value/null.test.js [node/0.2s] (14 completed)
18
- ✔ 15/23 _tests/js_value/number.test.js [node/0.1s] (15 completed)
19
- ✔ 16/23 _tests/js_value/object.test.js [node/0.2s] (16 completed)
20
- ✔ 17/23 _tests/js_value/regexp.test.js [node/0.06s] (17 completed)
10
+ ✔ 07/23 _tests/js_value/array.test.js [node/0.04s] (7 completed)
11
+ ✔ 08/23 _tests/js_value/biginit.test.js [node/0.04s] (8 completed)
12
+ ✔ 09/23 _tests/js_value/boolean.test.js [node/0.04s] (9 completed)
13
+ ✔ 10/23 _tests/js_value/date.test.js [node/0.05s] (10 completed)
14
+ ✔ 11/23 _tests/js_value/error.test.js [node/0.04s] (11 completed)
15
+ ✔ 12/23 _tests/js_value/function.test.js [node/0.05s] (12 completed)
16
+ ✔ 13/23 _tests/js_value/instance.test.js [node/0.09s] (13 completed)
17
+ ✔ 14/23 _tests/js_value/null.test.js [node/0.04s] (14 completed)
18
+ ✔ 15/23 _tests/js_value/number.test.js [node/0.06s] (15 completed)
19
+ ✔ 16/23 _tests/js_value/object.test.js [node/0.05s] (16 completed)
20
+ ✔ 17/23 _tests/js_value/regexp.test.js [node/0.04s] (17 completed)
21
21
  ✔ 18/23 _tests/js_value/string.test.js [node/0.07s] (18 completed)
22
- ✔ 19/23 _tests/js_value/symbol.test.js [node/0.03s] (19 completed)
23
- ✔ 20/23 _tests/js_value/undefined.test.js [node/0.03s] (20 completed)
24
- ✔ 21/23 _tests/time/decimals.test.js [node/0.03s] (21 completed)
25
- ✔ 22/23 _tests/time/duration.test.js [node/0.03s] (22 completed)
26
- ✔ 23/23 _tests/time/ellapsed.test.js [node/0.02s] (all completed)
22
+ ✔ 19/23 _tests/js_value/symbol.test.js [node/0.05s] (19 completed)
23
+ ✔ 20/23 _tests/js_value/undefined.test.js [node/0.04s] (20 completed)
24
+ ✔ 21/23 _tests/time/decimals.test.js [node/0.04s] (21 completed)
25
+ ✔ 22/23 _tests/time/duration.test.js [node/0.04s] (22 completed)
26
+ ✔ 23/23 _tests/time/ellapsed.test.js [node/0.03s] (all completed)
27
27
  ------------ 23 executions done -------------
28
28
  status: all completed
29
- duration: 2.6s (setup: 0.4s, execution: 2.5s, teardown: 0.2s)
29
+ duration: 2.7s (setup: 0.4s, execution: 2.5s, teardown: 0.2s)
30
30
  ---------------------------------------------
@@ -1,5 +1,5 @@
1
- import { writeFileSync } from "node:fs";
2
1
  import { takeFileSnapshot } from "@jsenv/snapshot";
2
+ import { writeFileSync } from "node:fs";
3
3
 
4
4
  import { generateContentFrame } from "@jsenv/humanize";
5
5
 
@@ -1,10 +1,10 @@
1
1
  import { assert } from "@jsenv/assert";
2
2
 
3
3
  import {
4
- setRoundedPrecision,
5
4
  setCeiledPrecision,
6
5
  setFlooredPrecision,
7
6
  setPrecision,
7
+ setRoundedPrecision,
8
8
  } from "@jsenv/humanize/src/utils/decimals.js";
9
9
 
10
10
  /* numbers between -1 and 1 */
@@ -1,3 +1,5 @@
1
+ // tslint:disable:ordered-imports
2
+
1
3
  // primitives
2
4
  import { inspectBoolean } from "./boolean.js";
3
5
  import { inspectNull } from "./null.js";
@@ -2,8 +2,8 @@
2
2
  * see also https://github.com/vadimdemedes/ink
3
3
  */
4
4
 
5
- import stringWidth from "string-width";
6
5
  import ansiEscapes from "ansi-escapes";
6
+ import stringWidth from "string-width";
7
7
 
8
8
  export const createDynamicLog = ({
9
9
  stream = process.stdout,
package/src/log/logger.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  LOG_LEVEL_DEBUG,
3
- LOG_LEVEL_INFO,
4
- LOG_LEVEL_WARN,
5
3
  LOG_LEVEL_ERROR,
4
+ LOG_LEVEL_INFO,
6
5
  LOG_LEVEL_OFF,
6
+ LOG_LEVEL_WARN,
7
7
  } from "./LOG_LEVELS.js";
8
8
 
9
9
  export const createLogger = ({ logLevel = LOG_LEVEL_INFO } = {}) => {
@@ -15,6 +15,9 @@ export const createTaskLog = (
15
15
  fail: () => {},
16
16
  };
17
17
  }
18
+ if (animated && process.env.SNAPSHOTING_FUNCTION_SIDE_EFFECTS) {
19
+ animated = false;
20
+ }
18
21
  const startMs = Date.now();
19
22
  const dynamicLog = createDynamicLog();
20
23
  let message = label;
@@ -1,3 +1,5 @@
1
+ // tslint:disable:ordered-imports
2
+
1
3
  export { createDetailedMessage } from "./log/detailed_message.js";
2
4
  export { ANSI } from "./ansi/ansi_browser.js";
3
5
  export { UNICODE } from "./unicode/unicode_browser.js";
package/src/main_node.js CHANGED
@@ -1,3 +1,5 @@
1
+ // tslint:disable:ordered-imports
2
+
1
3
  export { createDetailedMessage } from "./log/detailed_message.js";
2
4
  export { ANSI } from "./ansi/ansi_node.js";
3
5
  export { UNICODE } from "./unicode/unicode_node.js";
@@ -1,5 +1,5 @@
1
- import { createUnicode } from "./unicode_runtime_agnostic.js";
2
1
  import { ANSI } from "../ansi/ansi_browser.js";
2
+ import { createUnicode } from "./unicode_runtime_agnostic.js";
3
3
 
4
4
  export const UNICODE = createUnicode({
5
5
  supported: true,
@@ -1,6 +1,6 @@
1
1
  import isUnicodeSupported from "is-unicode-supported";
2
- import { createUnicode } from "./unicode_runtime_agnostic.js";
3
2
  import { ANSI } from "../ansi/ansi_node.js";
3
+ import { createUnicode } from "./unicode_runtime_agnostic.js";
4
4
 
5
5
  export const UNICODE = createUnicode({
6
6
  supported: process.env.FORCE_UNICODE === "1" || isUnicodeSupported(),