@e-mc/types 0.12.1 → 0.12.3
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/asset.d.ts +1 -0
- package/lib/index.d.ts +5 -4
- 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/asset.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -160,7 +160,7 @@ declare namespace functions {
|
|
|
160
160
|
executeBatchQuery(batch: V[], sessionKey: string, outResult?: BatchQueryResult): Promise<BatchQueryResult>;
|
|
161
161
|
executeBatchQuery(batch: V[], options?: ExecuteBatchQueryOptions | string, outResult?: BatchQueryResult): Promise<BatchQueryResult>;
|
|
162
162
|
processRows(batch: V[], tasks: Promise<QueryResult | null>[], parallel: boolean): Promise<BatchQueryResult>;
|
|
163
|
-
processRows(batch: V[], tasks: Promise<QueryResult | null>[], options?: ProcessRowsOptions, outResult?: BatchQueryResult): Promise<BatchQueryResult>;
|
|
163
|
+
processRows(batch: V[], tasks: Promise<QueryResult | null>[], options?: ProcessRowsOptions | boolean, outResult?: BatchQueryResult): Promise<BatchQueryResult>;
|
|
164
164
|
handleFail(err: unknown, item: V, options?: HandleFailOptions): boolean;
|
|
165
165
|
readTLSCert(value: unknown, cache?: boolean): string;
|
|
166
166
|
readTLSConfig(options: SecureContextOptions, cache?: boolean): void;
|
|
@@ -349,8 +349,8 @@ declare namespace functions {
|
|
|
349
349
|
headersOf(uri: string): OutgoingHttpHeaders | undefined;
|
|
350
350
|
aria2c(uri: string | URL, pathname: string): Promise<string[]>;
|
|
351
351
|
aria2c(uri: string | URL, options?: Aria2Options): Promise<string[]>;
|
|
352
|
-
rclone(uri: string, pathname: string): Promise<string[]>;
|
|
353
|
-
rclone(uri: string, options?: RcloneOptions): Promise<string[]>;
|
|
352
|
+
rclone(uri: string | URL, pathname: string): Promise<string[]>;
|
|
353
|
+
rclone(uri: string | URL, options?: RcloneOptions): Promise<string[]>;
|
|
354
354
|
json(uri: string | URL, options?: OpenOptions): Promise<object | null>;
|
|
355
355
|
pipe(uri: string | URL, to: Writable, options?: OpenOptions): Promise<null>;
|
|
356
356
|
opts<V extends OpenOptions>(url: string | URL, options?: V): HostConfig & V;
|
|
@@ -388,6 +388,7 @@ declare namespace functions {
|
|
|
388
388
|
fromStatusCode(value: number | string): string;
|
|
389
389
|
defineHttpAgent(options: HttpAgentSettings): void;
|
|
390
390
|
defineDnsLookup(options: DnsLookupSettings, clear?: boolean): void;
|
|
391
|
+
isRclone(value: string | URL): boolean;
|
|
391
392
|
getAria2Path(): string;
|
|
392
393
|
getRclonePath(): string;
|
|
393
394
|
readonly prototype: IRequest<T, U>;
|
|
@@ -829,7 +830,7 @@ declare namespace functions {
|
|
|
829
830
|
/** @deprecated */
|
|
830
831
|
checkSemVer(name: string | [string, string], min: number | string, max?: number | string, unstable?: boolean, startDir?: string): boolean;
|
|
831
832
|
/** @deprecated @e-mc/types */
|
|
832
|
-
sanitizeCmd(value: string): string;
|
|
833
|
+
sanitizeCmd(value: string, ...args: unknown[]): string;
|
|
833
834
|
/** @deprecated @e-mc/types */
|
|
834
835
|
sanitizeArgs(value: string, doubleQuote?: boolean): string;
|
|
835
836
|
/** @deprecated @e-mc/types */
|