@oclif/core 4.0.0-beta.12 → 4.0.0-beta.13

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.
package/lib/ux/index.d.ts CHANGED
@@ -55,13 +55,13 @@ export declare const ux: {
55
55
  *
56
56
  * See node's util.format() for formatting options.
57
57
  */
58
- stderr: (str: string | string[] | undefined, ...args: string[]) => void;
58
+ stderr: (str?: string | string[] | undefined, ...args: string[]) => void;
59
59
  /**
60
60
  * Log a formatted string to stdout.
61
61
  *
62
62
  * See node's util.format() for formatting options.
63
63
  */
64
- stdout: (str: string | string[] | undefined, ...args: string[]) => void;
64
+ stdout: (str?: string | string[] | undefined, ...args: string[]) => void;
65
65
  /**
66
66
  * Prints a pretty warning message to stderr.
67
67
  */
package/lib/ux/write.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const stdout: (str: string | string[] | undefined, ...args: string[]) => void;
2
- export declare const stderr: (str: string | string[] | undefined, ...args: string[]) => void;
1
+ export declare const stdout: (str?: string | string[] | undefined, ...args: string[]) => void;
2
+ export declare const stderr: (str?: string | string[] | undefined, ...args: string[]) => void;
package/lib/ux/write.js CHANGED
@@ -3,8 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stderr = exports.stdout = void 0;
4
4
  const node_util_1 = require("node:util");
5
5
  const stdout = (str, ...args) => {
6
- if (typeof str === 'string' || !str) {
7
- process.stdout.write((0, node_util_1.format)(str, ...args) + '\n');
6
+ if (!str && args) {
7
+ process.stdout.write((0, node_util_1.format)(...args) + '\n');
8
+ }
9
+ else if (!str) {
10
+ process.stdout.write('\n');
11
+ }
12
+ else if (typeof str === 'string') {
13
+ process.stdout.write((str && (0, node_util_1.format)(str, ...args)) + '\n');
8
14
  }
9
15
  else {
10
16
  process.stdout.write((0, node_util_1.format)(...str, ...args) + '\n');
@@ -12,8 +18,14 @@ const stdout = (str, ...args) => {
12
18
  };
13
19
  exports.stdout = stdout;
14
20
  const stderr = (str, ...args) => {
15
- if (typeof str === 'string' || !str) {
16
- process.stderr.write((0, node_util_1.format)(str, ...args) + '\n');
21
+ if (!str && args) {
22
+ process.stderr.write((0, node_util_1.format)(...args) + '\n');
23
+ }
24
+ else if (!str) {
25
+ process.stderr.write('\n');
26
+ }
27
+ else if (typeof str === 'string') {
28
+ process.stderr.write((str && (0, node_util_1.format)(str, ...args)) + '\n');
17
29
  }
18
30
  else {
19
31
  process.stderr.write((0, node_util_1.format)(...str, ...args) + '\n');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "4.0.0-beta.12",
4
+ "version": "4.0.0-beta.13",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {