@e-mc/types 0.12.1 → 0.12.2

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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.12.1/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.12.2/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { LogArguments } from "./lib/logger";
@@ -65,7 +65,7 @@ function decryptUTF8(algorithm: CipherGCMTypes, key: BinaryLike, iv: BinaryLike,
65
65
  function hashKey(data: BinaryLike, algorithm?: string, encoding?: BinaryToTextEncoding): string;
66
66
  function incrementUUID(restart?: boolean): string;
67
67
  function validateUUID(value: unknown): boolean;
68
- function sanitizeCmd(value: string): string;
68
+ function sanitizeCmd(value: string, ...args: unknown[]): string;
69
69
  function sanitizeArgs(value: string, doubleQuote?: boolean): string;
70
70
  function sanitizeArgs(values: string[], doubleQuote?: boolean): string[];
71
71
  function randomString(format: string, dictionary?: string): string;
@@ -200,10 +200,10 @@ const IMPORT_MAP: Record<string, string | undefined>;
200
200
 
201
201
  ## References
202
202
 
203
- - https://www.unpkg.com/@e-mc/types@0.12.1/index.d.ts
204
- - https://www.unpkg.com/@e-mc/types@0.12.1/lib/logger.d.ts
205
- - https://www.unpkg.com/@e-mc/types@0.12.1/lib/module.d.ts
206
- - https://www.unpkg.com/@e-mc/types@0.12.1/lib/node.d.ts
203
+ - https://www.unpkg.com/@e-mc/types@0.12.2/index.d.ts
204
+ - https://www.unpkg.com/@e-mc/types@0.12.2/lib/logger.d.ts
205
+ - https://www.unpkg.com/@e-mc/types@0.12.2/lib/module.d.ts
206
+ - https://www.unpkg.com/@e-mc/types@0.12.2/lib/node.d.ts
207
207
 
208
208
  * https://developer.mozilla.org/en-US/docs/Web/API/DOMException
209
209
  * https://www.npmjs.com/package/@types/bytes
package/constant.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export const enum INTERNAL {
2
- VERSION = '0.12.1',
2
+ VERSION = '0.12.2',
3
3
  TEMP_DIR = 'tmp',
4
4
  CJS = '__cjs__'
5
5
  }
package/index.d.ts CHANGED
@@ -332,7 +332,7 @@ declare namespace types {
332
332
  function incrementUUID(restart?: boolean): string;
333
333
  function validateUUID(value: unknown): boolean;
334
334
  function randomString(format: string, dictionary?: string): string;
335
- function sanitizeCmd(value: string): string;
335
+ function sanitizeCmd(value: string, ...args: unknown[]): string;
336
336
  function sanitizeArgs(value: string, doubleQuote?: boolean): string;
337
337
  function sanitizeArgs(values: string[], doubleQuote?: boolean): string[];
338
338
  function errorValue(value: string, hint?: string): Error;
package/index.js CHANGED
@@ -1079,11 +1079,14 @@ function randomString(format, dictionary) {
1079
1079
  function validateUUID(value) {
1080
1080
  return typeof value === 'string' && value.length === 36 && REGEXP_UUID.test(value);
1081
1081
  }
1082
- function sanitizeCmd(value) {
1082
+ function sanitizeCmd(value, ...args) {
1083
1083
  if (value.includes(' ')) {
1084
- return PLATFORM_WIN32 ? wrapQuote(value) : value.replaceAll(' ', '\\ ');
1084
+ value = PLATFORM_WIN32 ? wrapQuote(value) : value.replaceAll(' ', '\\ ');
1085
1085
  }
1086
- return value;
1086
+ if (args.length === 0) {
1087
+ return value;
1088
+ }
1089
+ return [value].concat(args.flat().filter(arg => isString(arg))).join(' ');
1087
1090
  }
1088
1091
  function sanitizeArgs(values, doubleQuote) {
1089
1092
  const result = typeof values === 'string' ? [values] : values;
package/lib/index.d.ts CHANGED
@@ -829,7 +829,7 @@ declare namespace functions {
829
829
  /** @deprecated */
830
830
  checkSemVer(name: string | [string, string], min: number | string, max?: number | string, unstable?: boolean, startDir?: string): boolean;
831
831
  /** @deprecated @e-mc/types */
832
- sanitizeCmd(value: string): string;
832
+ sanitizeCmd(value: string, ...args: unknown[]): string;
833
833
  /** @deprecated @e-mc/types */
834
834
  sanitizeArgs(value: string, doubleQuote?: boolean): string;
835
835
  /** @deprecated @e-mc/types */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/types",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "Type definitions for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",