@e-mc/types 0.8.24 → 0.8.26

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.24/index.d.ts
12
+ - https://www.unpkg.com/@e-mc/types@0.8.26/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.24/lib/logger.d.ts
190
- - https://www.unpkg.com/@e-mc/types@0.8.24/lib/module.d.ts
189
+ - https://www.unpkg.com/@e-mc/types@0.8.26/lib/logger.d.ts
190
+ - https://www.unpkg.com/@e-mc/types@0.8.26/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.24',
2
+ VERSION = '0.8.26',
3
3
  TEMP_DIR = 'tmp',
4
4
  CJS = '__cjs__'
5
5
  }
package/index.js CHANGED
@@ -148,7 +148,6 @@ function recurseObject(data, parseString, completed, cache) {
148
148
  }
149
149
  return data;
150
150
  }
151
- const convertScrypt = (key, iv, data) => crypto.scryptSync(key, iv, Math.ceil(data.length / 16) * 16);
152
151
  const isFunction = (value) => typeof value === 'function';
153
152
  var LOG_TYPE;
154
153
  (function (LOG_TYPE) {
@@ -880,23 +879,29 @@ function getEncoding(value, fallback = 'utf-8') {
880
879
  exports.getEncoding = getEncoding;
881
880
  function encryptUTF8(algorithm, key, iv, data, encoding = 'hex') {
882
881
  if (checkCipherType(algorithm) && isString(data)) {
882
+ let result;
883
883
  try {
884
- const gcm = crypto.createCipheriv(algorithm, convertScrypt(key, iv, data), iv);
885
- return gcm.update(data, 'utf-8', encoding) + gcm.final(encoding);
884
+ const gcm = crypto.createCipheriv(algorithm, crypto.scryptSync(key, iv, 32), iv);
885
+ result = gcm.update(data, 'utf8', encoding);
886
+ result += gcm.final(encoding);
886
887
  }
887
888
  catch {
888
889
  }
890
+ return result;
889
891
  }
890
892
  }
891
893
  exports.encryptUTF8 = encryptUTF8;
892
894
  function decryptUTF8(algorithm, key, iv, data, encoding = 'hex') {
893
895
  if (checkCipherType(algorithm) && isString(data)) {
896
+ let result;
894
897
  try {
895
- const gcm = crypto.createDecipheriv(algorithm, convertScrypt(key, iv, data), iv);
896
- return gcm.update(data, encoding, 'utf-8') + gcm.final('utf-8');
898
+ const gcm = crypto.createDecipheriv(algorithm, crypto.scryptSync(key, iv, 32), iv);
899
+ result = gcm.update(data, encoding, 'utf8');
900
+ result += gcm.final('utf8');
897
901
  }
898
902
  catch {
899
903
  }
904
+ return result;
900
905
  }
901
906
  }
902
907
  exports.decryptUTF8 = decryptUTF8;
package/lib/document.d.ts CHANGED
@@ -80,7 +80,7 @@ export interface TransformOptions<T = AnyObject, U = T> extends TransformOutput
80
80
  supplementChunks: ChunkData[];
81
81
  }
82
82
 
83
- export interface ITransformSeries<T = AnyObject, U = T> extends IModule, TransformOptions<T, U> {
83
+ export interface ITransformSeries<T = AnyObject, U = T, V = object> extends IModule, TransformOptions<T, U> {
84
84
  readonly type: string;
85
85
  init(instance: IModule, dirname?: string): this;
86
86
  close(instance: IModule): void;
@@ -88,11 +88,11 @@ export interface ITransformSeries<T = AnyObject, U = T> extends IModule, Transfo
88
88
  getMainFile(code?: string, imports?: StringMap): Undef<SourceInput<string>>;
89
89
  getSourceFiles(imports?: StringMap): Undef<SourceInput>;
90
90
  toBaseConfig(all?: boolean): T;
91
- upgrade<V = unknown>(context: V, dirname?: string, name?: string): V;
91
+ upgrade<W = unknown>(context: W, dirname?: string, name?: string): W;
92
92
  set code(value);
93
93
  get code(): string;
94
94
  get out(): IOut;
95
- get metadata(): object;
95
+ get metadata(): V;
96
96
  get options(): TransformOutput;
97
97
  get productionRelease(): boolean;
98
98
  get imported(): boolean;
package/lib/index.d.ts CHANGED
@@ -292,7 +292,7 @@ declare namespace functions {
292
292
  createServer(port: number, secure?: Null<SecureOptions>, active?: boolean): Null<ws.Server>;
293
293
  shutdown(): void;
294
294
  setTimeout(value: NumString): void;
295
- checkTimeout(client: ws | ws.WebSocket): boolean;
295
+ checkTimeout(client: ws.WebSocket): boolean;
296
296
  readonly prototype: IWatch<T, U, V, W>;
297
297
  new(module?: V): IWatch<T, U, V, W>;
298
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<typeof ws, number>;
62
- checkTimeout(client: ws | ws.WebSocket): boolean;
61
+ CLIENT_SESSION: Map<ws.WebSocket, number>;
62
+ checkTimeout(client: 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.24",
3
+ "version": "0.8.26",
4
4
  "description": "Type definitions for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",