@e-mc/types 0.12.0 → 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 +6 -6
- package/constant.d.ts +1 -1
- package/index.d.ts +1 -1
- package/index.js +6 -3
- package/lib/index.d.ts +1 -2
- package/package.json +1 -1
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.
|
|
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.
|
|
204
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
205
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
206
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
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
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
|
-
|
|
1084
|
+
value = PLATFORM_WIN32 ? wrapQuote(value) : value.replaceAll(' ', '\\ ');
|
|
1085
1085
|
}
|
|
1086
|
-
|
|
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
|
@@ -763,7 +763,6 @@ declare namespace functions {
|
|
|
763
763
|
readonly LOG_TYPE: LOG_TYPE;
|
|
764
764
|
readonly LOG_FORMAT: LoggerFormatSettings<LoggerFormat<number>>;
|
|
765
765
|
readonly STATUS_TYPE: STATUS_TYPE;
|
|
766
|
-
readonly REQUIRE_ESM: boolean;
|
|
767
766
|
readonly PLATFORM_WIN32: boolean;
|
|
768
767
|
readonly MAX_TIMEOUT: number;
|
|
769
768
|
readonly TEMP_DIR: string;
|
|
@@ -830,7 +829,7 @@ declare namespace functions {
|
|
|
830
829
|
/** @deprecated */
|
|
831
830
|
checkSemVer(name: string | [string, string], min: number | string, max?: number | string, unstable?: boolean, startDir?: string): boolean;
|
|
832
831
|
/** @deprecated @e-mc/types */
|
|
833
|
-
sanitizeCmd(value: string): string;
|
|
832
|
+
sanitizeCmd(value: string, ...args: unknown[]): string;
|
|
834
833
|
/** @deprecated @e-mc/types */
|
|
835
834
|
sanitizeArgs(value: string, doubleQuote?: boolean): string;
|
|
836
835
|
/** @deprecated @e-mc/types */
|