@wxn0brp/db-core 0.12.8 → 0.12.9

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.
@@ -1,6 +1,8 @@
1
1
  export interface Task {
2
2
  func: Function;
3
- param: any[];
3
+ /** @deprecated use query instead */
4
+ param?: any[];
5
+ query?: any;
4
6
  resolve: Function;
5
7
  reject: Function;
6
8
  }
@@ -34,6 +36,6 @@ export declare class SmartExecutor implements ExecutorInterface {
34
36
  aware: boolean;
35
37
  collections: Map<string, SmartExecutorEntry>;
36
38
  constructor(ttl?: number, aware?: boolean);
37
- addOp(func: Function, query: any, collection: string): Promise<any>;
39
+ addOp(func: Function, query: any, collection?: string): Promise<any>;
38
40
  scheduleCleanup(key: string, entry: SmartExecutorEntry): number;
39
41
  }
@@ -12,9 +12,7 @@ export class Executor {
12
12
  return await new Promise((resolve, reject) => {
13
13
  this.queue.push({
14
14
  func,
15
- param: [
16
- query,
17
- ],
15
+ query,
18
16
  resolve,
19
17
  reject,
20
18
  });
@@ -31,7 +29,7 @@ export class Executor {
31
29
  while (this.queue.length > 0) {
32
30
  const q = this.queue.shift();
33
31
  await q
34
- .func(...q.param)
32
+ .func(q.query || q.param?.[0])
35
33
  .then(q.resolve)
36
34
  .catch(q.reject);
37
35
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.12.8";
1
+ export declare const version = "0.12.9";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "0.12.8";
1
+ export const version = "0.12.9";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wxn0brp/db-core",
3
- "version": "0.12.8",
3
+ "version": "0.12.9",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "author": "wxn0brP",