better-lock 2.0.2-beta → 2.0.3
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 +10 -4
- package/dist/better_lock.d.ts +7 -4
- package/dist/better_lock.js +4 -1
- package/dist/better_lock.js.map +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +92 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1414 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/BetterLockError.html +5 -0
- package/docs/classes/BetterLockExecutionTimeoutError.html +5 -0
- package/docs/classes/BetterLockInternalError.html +5 -0
- package/docs/classes/BetterLockInvalidArgumentError.html +5 -0
- package/docs/classes/BetterLockJobAbortedError.html +5 -0
- package/docs/classes/BetterLockQueueOverflowError.html +5 -0
- package/docs/classes/BetterLockWaitTimeoutError.html +5 -0
- package/docs/classes/_internal_.BetterLock.html +92 -0
- package/docs/classes/_internal_.KeyQueue.html +8 -0
- package/docs/classes/_internal_.LockJob.html +28 -0
- package/docs/index.html +211 -0
- package/docs/interfaces/BetterLockJobOptions.html +9 -0
- package/docs/interfaces/BetterLockOptions.html +21 -0
- package/docs/modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html +1 -0
- package/docs/modules/_internal_.html +7 -0
- package/docs/modules.html +5 -0
- package/package.json +5 -2
- package/src/better_lock.ts +7 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-lock",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "A (better) node.js lock library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"test": "jest",
|
|
11
11
|
"watch": "jest --watchAll",
|
|
12
12
|
"lint": "eslint ./src",
|
|
13
|
-
"coverage": "jest --coverage"
|
|
13
|
+
"coverage": "jest --coverage",
|
|
14
|
+
"docs": "typedoc src/index.ts --excludePrivate --excludeProtected --excludeExternals"
|
|
14
15
|
},
|
|
15
16
|
"repository": {
|
|
16
17
|
"type": "git",
|
|
@@ -36,6 +37,8 @@
|
|
|
36
37
|
"prettier": "latest",
|
|
37
38
|
"prettier-plugin-import-sort": "0.0.7",
|
|
38
39
|
"ts-jest": "^28.0.3",
|
|
40
|
+
"typedoc": "^0.22.15",
|
|
41
|
+
"typedoc-plugin-missing-exports": "^0.22.6",
|
|
39
42
|
"typescript": "^4.3.2"
|
|
40
43
|
},
|
|
41
44
|
"author": "Ivan Pantic",
|
package/src/better_lock.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as tools from './tools';
|
|
|
12
12
|
import { ICallback, ICallbackExecutor, ILockKey, IPromiseExecutor } from './types';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Main better lock class.
|
|
16
16
|
*/
|
|
17
17
|
export class BetterLock {
|
|
18
18
|
/**
|
|
@@ -23,10 +23,13 @@ export class BetterLock {
|
|
|
23
23
|
promise_tester: p => p && typeof p.then === 'function',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
private options: IOptions;
|
|
27
|
-
private log: (msg: string) => void;
|
|
28
|
-
private queues: { [key: string]: KeyQueue };
|
|
26
|
+
private readonly options: IOptions;
|
|
27
|
+
private readonly log: (msg: string) => void;
|
|
28
|
+
private readonly queues: { [key: string]: KeyQueue };
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Create a better lock instance
|
|
32
|
+
*/
|
|
30
33
|
constructor(options?: IOptions) {
|
|
31
34
|
this.options = tools.assign({}, [BetterLock.DEFAULT_OPTIONS, options]);
|
|
32
35
|
this.log = tools.makeLog(this.options.name, this.options.log);
|