@e-mc/types 0.5.17 → 0.5.18

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  export const enum INTERNAL {
2
- VERSION = '0.5.17',
2
+ VERSION = '0.5.18',
3
3
  TEMP_DIR = 'tmp',
4
4
  CJS = '__cjs__'
5
5
  }
package/index.js CHANGED
@@ -714,8 +714,10 @@ function coerceObject(data, parseString, cache) {
714
714
  const removeQuotes = (content) => content.trim().replace(/^["']/g, '').replace(/["']$/g, '').trim();
715
715
  const errorCreate = () => errorValue('Invalid parameters', match[2].trim());
716
716
  switch (match[1]) {
717
- case 'Date':
718
- return new Date(match[2].replace(/["']/g, '').trim());
717
+ case 'Date': {
718
+ const text = match[2].replace(/["']/g, '').trim();
719
+ return text ? new Date(text) : new Date();
720
+ }
719
721
  case 'URL':
720
722
  case 'RegExp': {
721
723
  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;
@@ -284,7 +285,7 @@ declare namespace functions {
284
285
  createServer(port: number, secure?: Null<SecureOptions>, active?: boolean): Undef<ws.Server>;
285
286
  shutdown(): void;
286
287
  setTimeout(value: NumString): void;
287
- checkTimeout(client: ws): boolean;
288
+ checkTimeout(client: ws | ws.WebSocket): boolean;
288
289
  readonly prototype: IWatch<T, U, V, W>;
289
290
  new(module?: V): IWatch<T, U, V, W>;
290
291
  new(interval?: number, port?: number, securePort?: number, extensions?: unknown[]): IWatch<T, U, V, W>;
package/lib/watch.d.ts CHANGED
@@ -57,8 +57,8 @@ export interface IFileGroup<T extends ExternalAsset = ExternalAsset> extends IAb
57
57
 
58
58
  export interface FileGroupConstructor<T extends ExternalAsset = ExternalAsset> {
59
59
  CONNECTION_TIMEOUT: number;
60
- CLIENT_SESSION: Map<ws, number>;
61
- checkTimeout(client: ws): boolean;
60
+ CLIENT_SESSION: Map<typeof ws, number>;
61
+ checkTimeout(client: ws | ws.WebSocket): boolean;
62
62
  cloneAsset(asset: T): T;
63
63
  readonly prototype: IFileGroup<T>;
64
64
  new(uri: string, assets: T[], abortable: boolean): IFileGroup<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/types",
3
- "version": "0.5.17",
3
+ "version": "0.5.18",
4
4
  "description": "Type definitions for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",