@vnejs/semaphore 0.2.1 → 0.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/semaphore",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/utils.ts CHANGED
@@ -2,9 +2,7 @@ import type { QueueEntry } from "./queue-entry.js";
2
2
 
3
3
  export const getPromiseField = (e: QueueEntry) => e.promise;
4
4
 
5
- export const onlyNotInProcessWithResolve = (
6
- e: QueueEntry,
7
- ): e is QueueEntry & { resolve: () => void } => !e.inProcess && e.resolve !== undefined;
5
+ export const onlyNotInProcessWithResolve = (e: QueueEntry): e is QueueEntry & { resolve: () => void } => !e.inProcess && e.resolve !== undefined;
8
6
 
9
7
  export const byWeight = (a: QueueEntry, b: QueueEntry) => b.weight - a.weight;
10
8
 
@@ -23,5 +21,4 @@ export const createQueueEntry = (key: string, weight: number, func: () => Promis
23
21
  export const isCanAddNewElement = (queue: QueueEntry[], weight: number, maxWeight: number) =>
24
22
  queue.length > 0 && maxWeight >= weight + queue[queue.length - 1].weight;
25
23
 
26
- export const recalcSortedQueue = (queue: Record<string, QueueEntry>) =>
27
- Object.values(queue).filter(onlyNotInProcessWithResolve).sort(byWeight);
24
+ export const recalcSortedQueue = (queue: Record<string, QueueEntry>) => Object.values(queue).filter(onlyNotInProcessWithResolve).sort(byWeight);
package/tsconfig.json CHANGED
@@ -4,12 +4,6 @@
4
4
  "rootDir": "src",
5
5
  "outDir": "dist"
6
6
  },
7
- "include": [
8
- "src/**/*.ts"
9
- ],
10
- "exclude": [
11
- "dist",
12
- "node_modules",
13
- "src/tests"
14
- ]
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["dist", "node_modules", "src/tests"]
15
9
  }