@e-mc/types 0.12.14 → 0.12.15
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 +5 -5
- package/constant.d.ts +1 -1
- package/index.js +11 -11
- package/lib/core.d.ts +2 -1
- package/lib/index.d.ts +1 -0
- 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.15/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { LogArguments } from "./lib/logger";
|
|
@@ -204,10 +204,10 @@ const IMPORT_MAP: Record<string, string | undefined>;
|
|
|
204
204
|
|
|
205
205
|
## References
|
|
206
206
|
|
|
207
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
208
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
209
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
210
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
207
|
+
- https://www.unpkg.com/@e-mc/types@0.12.15/index.d.ts
|
|
208
|
+
- https://www.unpkg.com/@e-mc/types@0.12.15/lib/logger.d.ts
|
|
209
|
+
- https://www.unpkg.com/@e-mc/types@0.12.15/lib/module.d.ts
|
|
210
|
+
- https://www.unpkg.com/@e-mc/types@0.12.15/lib/node.d.ts
|
|
211
211
|
|
|
212
212
|
* https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
213
213
|
* https://www.npmjs.com/package/@types/bytes
|
package/constant.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1029,18 +1029,18 @@ function asFunction(value, sync = true) {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
function getEncoding(value, fallback) {
|
|
1031
1031
|
if (typeof value === 'string') {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1032
|
+
const result = value.trim().toLowerCase();
|
|
1033
|
+
if (result.slice(0, 3) === 'utf') {
|
|
1034
|
+
switch (result.slice(result[3] === '-' ? 4 : 3)) {
|
|
1035
|
+
case '8':
|
|
1036
|
+
return 'utf8';
|
|
1037
|
+
case '16le':
|
|
1038
|
+
case '16':
|
|
1039
|
+
return 'utf16le';
|
|
1040
|
+
}
|
|
1041
1041
|
}
|
|
1042
|
-
if (Buffer.isEncoding(
|
|
1043
|
-
return
|
|
1042
|
+
else if (Buffer.isEncoding(result)) {
|
|
1043
|
+
return result;
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
return fallback || 'utf8';
|
package/lib/core.d.ts
CHANGED
|
@@ -70,9 +70,10 @@ export interface ClientDbConstructor<T extends IHost = IHost, U extends ClientMo
|
|
|
70
70
|
convertTime(value: number | string): number;
|
|
71
71
|
findResult(source: string, credential: unknown, queryString: string, timeout: number, sessionKey?: string | boolean, renewCache?: boolean): QueryResult | undefined;
|
|
72
72
|
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, options: StoreResultOptions): QueryResult;
|
|
73
|
+
/** @deprecated */
|
|
73
74
|
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, sessionKey: string, sessionExpires: number): QueryResult;
|
|
74
75
|
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, cache: DbCacheValue): QueryResult;
|
|
75
|
-
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, cache: DbCacheValue | undefined, options: StoreResultOptions): QueryResult;
|
|
76
|
+
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, cache: DbCacheValue | undefined, options: Omit<StoreResultOptions, "cache">): QueryResult;
|
|
76
77
|
purgeResult(prefix?: string): Promise<number>;
|
|
77
78
|
extractUUID(credential: unknown): string;
|
|
78
79
|
setPoolConfig(value: unknown): void;
|
package/lib/index.d.ts
CHANGED
|
@@ -619,6 +619,7 @@ declare namespace functions {
|
|
|
619
619
|
getThreadCount(full: true): ThreadCountStat;
|
|
620
620
|
getThreadCount(username: string, iv?: BinaryLike): ThreadCountStat;
|
|
621
621
|
getThreadCount(username?: string | boolean, iv?: BinaryLike): number;
|
|
622
|
+
parseIp(value: unknown, kind?: "ipv4" | "ipv6"): string;
|
|
622
623
|
getLogDelayed(): FormatMessageArgs[];
|
|
623
624
|
getPermissionFromSettings(freeze?: boolean): IPermission;
|
|
624
625
|
readonly prototype: IHost;
|