@e-mc/types 0.7.18 → 0.7.20
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/constant.d.ts +1 -1
- package/index.js +4 -2
- package/lib/index.d.ts +2 -1
- package/lib/watch.d.ts +2 -2
- package/package.json +1 -1
package/constant.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -720,8 +720,10 @@ function coerceObject(data, parseString, cache) {
|
|
|
720
720
|
const removeQuotes = (content) => content.trim().replace(/^["']/g, '').replace(/["']$/g, '').trim();
|
|
721
721
|
const errorCreate = () => errorValue('Invalid parameters', match[2].trim());
|
|
722
722
|
switch (match[1]) {
|
|
723
|
-
case 'Date':
|
|
724
|
-
|
|
723
|
+
case 'Date': {
|
|
724
|
+
const text = match[2].replace(/["']/g, '').trim();
|
|
725
|
+
return text ? new Date(text) : new Date();
|
|
726
|
+
}
|
|
725
727
|
case 'URL':
|
|
726
728
|
case 'RegExp': {
|
|
727
729
|
const pattern = /^("[^"]+"|'[^']+'|[^\s,]+)(?:\s*,\s*("[^"]+"|'[^']+'|\S+))?$/.exec(match[2].trim());
|
package/lib/index.d.ts
CHANGED
|
@@ -104,6 +104,7 @@ declare namespace functions {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
interface ImageConstructor<T extends IHost = IHost, U extends ImageModule = ImageModule> extends ModuleConstructor {
|
|
107
|
+
/** @deprecated */
|
|
107
108
|
readonly REGEXP_SIZERANGE: RegExp;
|
|
108
109
|
transform(file: string, command: string, options?: TransformOptions): Promise<Null<Buffer> | string>;
|
|
109
110
|
clamp(value: unknown, min?: number, max?: number): number;
|
|
@@ -285,7 +286,7 @@ declare namespace functions {
|
|
|
285
286
|
createServer(port: number, secure?: Null<SecureOptions>, active?: boolean): Null<ws.Server>;
|
|
286
287
|
shutdown(): void;
|
|
287
288
|
setTimeout(value: NumString): void;
|
|
288
|
-
checkTimeout(client: ws): boolean;
|
|
289
|
+
checkTimeout(client: ws | ws.WebSocket): boolean;
|
|
289
290
|
readonly prototype: IWatch<T, U, V, W>;
|
|
290
291
|
new(module?: V): IWatch<T, U, V, W>;
|
|
291
292
|
new(interval?: number, port?: number, securePort?: number, extensions?: unknown[]): IWatch<T, U, V, W>;
|
package/lib/watch.d.ts
CHANGED
|
@@ -58,8 +58,8 @@ export interface IFileGroup<T extends ExternalAsset = ExternalAsset> extends IAb
|
|
|
58
58
|
|
|
59
59
|
export interface FileGroupConstructor<T extends ExternalAsset = ExternalAsset> {
|
|
60
60
|
CONNECTION_TIMEOUT: number;
|
|
61
|
-
CLIENT_SESSION: Map<ws, number>;
|
|
62
|
-
checkTimeout(client: ws): boolean;
|
|
61
|
+
CLIENT_SESSION: Map<typeof ws, number>;
|
|
62
|
+
checkTimeout(client: ws | ws.WebSocket): boolean;
|
|
63
63
|
cloneAsset(asset: T): T;
|
|
64
64
|
readonly prototype: IFileGroup<T>;
|
|
65
65
|
new(uri: string, assets: T[], abortable: boolean): IFileGroup<T>;
|