@e-mc/types 0.8.23 → 0.8.24

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 CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- - https://www.unpkg.com/@e-mc/types@0.8.23/index.d.ts
12
+ - https://www.unpkg.com/@e-mc/types@0.8.24/index.d.ts
13
13
 
14
14
  ```typescript
15
15
  import type { LogArguments } from "./lib/logger";
@@ -186,8 +186,8 @@ const IMPORT_MAP: Record<string, string | undefined>;
186
186
 
187
187
  ## References
188
188
 
189
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/logger.d.ts
190
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/module.d.ts
189
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/logger.d.ts
190
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/module.d.ts
191
191
 
192
192
  * https://nodejs.org/api/perf_hooks.html
193
193
  * https://www.npmjs.com/package/@types/bytes
package/constant.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export const enum INTERNAL {
2
- VERSION = '0.8.23',
2
+ VERSION = '0.8.24',
3
3
  TEMP_DIR = 'tmp',
4
4
  CJS = '__cjs__'
5
5
  }
package/index.js CHANGED
@@ -603,7 +603,7 @@ function alignSize(value, kb = 0, factor = 0) {
603
603
  }
604
604
  if (kb > 0) {
605
605
  kb = Math.ceil(kb) * 1024;
606
- return Math.ceil(result / kb) * kb;
606
+ return Math.ceil(Math.max(result, 1) / kb) * kb;
607
607
  }
608
608
  return result;
609
609
  }
@@ -753,8 +753,10 @@ function coerceObject(data, parseString, cache) {
753
753
  const removeQuotes = (content) => content.trim().replace(/^["']/g, '').replace(/["']$/g, '').trim();
754
754
  const errorCreate = () => errorValue('Invalid parameters', match[2].trim());
755
755
  switch (match[1]) {
756
- case 'Date':
757
- return new Date(match[2].replace(/["']/g, '').trim());
756
+ case 'Date': {
757
+ const text = match[2].replace(/["']/g, '').trim();
758
+ return text ? new Date(text) : new Date();
759
+ }
758
760
  case 'URL':
759
761
  case 'RegExp': {
760
762
  const pattern = /^("[^"]+"|'[^']+'|[^\s,]+)(?:\s*,\s*("[^"]+"|'[^']+'|\S+))?$/.exec(match[2].trim());
package/lib/index.d.ts CHANGED
@@ -103,6 +103,7 @@ declare namespace functions {
103
103
  }
104
104
 
105
105
  interface ImageConstructor<T extends IHost = IHost, U extends ImageModule = ImageModule> extends ModuleConstructor {
106
+ /** @deprecated */
106
107
  readonly REGEXP_SIZERANGE: RegExp;
107
108
  transform(file: string, command: string, options?: TransformOptions): Promise<Null<Buffer> | string>;
108
109
  clamp(value: unknown, min?: number, max?: number): number;
@@ -291,7 +292,7 @@ declare namespace functions {
291
292
  createServer(port: number, secure?: Null<SecureOptions>, active?: boolean): Null<ws.Server>;
292
293
  shutdown(): void;
293
294
  setTimeout(value: NumString): void;
294
- checkTimeout(client: ws): boolean;
295
+ checkTimeout(client: ws | ws.WebSocket): boolean;
295
296
  readonly prototype: IWatch<T, U, V, W>;
296
297
  new(module?: V): IWatch<T, U, V, W>;
297
298
  /* @deprecated */
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/types",
3
- "version": "0.8.23",
3
+ "version": "0.8.24",
4
4
  "description": "Type definitions for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",