@matrixai/async-init
Advanced tools
Comparing version 1.8.2 to 1.8.3
@@ -12,11 +12,7 @@ "use strict"; | ||
return (constructor) => { | ||
var _a, _b, _c; | ||
const constructor_ = class extends constructor { | ||
constructor() { | ||
super(...arguments); | ||
this[_a] = false; | ||
this[_b] = null; | ||
this[_c] = new async_locks_1.RWLockWriter(); | ||
} | ||
get [(_a = utils_1._destroyed, _b = utils_1._status, _c = utils_1.initLock, utils_1.destroyed)]() { | ||
[utils_1._destroyed] = false; | ||
[utils_1._status] = null; | ||
[utils_1.initLock] = new async_locks_1.RWLockWriter(); | ||
get [utils_1.destroyed]() { | ||
return this[utils_1._destroyed]; | ||
@@ -23,0 +19,0 @@ } |
@@ -13,12 +13,8 @@ "use strict"; | ||
return (constructor) => { | ||
var _a, _b, _c, _d; | ||
const constructor_ = class extends constructor { | ||
constructor() { | ||
super(...arguments); | ||
this[_a] = false; | ||
this[_b] = false; | ||
this[_c] = null; | ||
this[_d] = new async_locks_1.RWLockWriter(); | ||
} | ||
get [(_a = utils_1._running, _b = utils_1._destroyed, _c = utils_1._status, _d = utils_1.initLock, utils_1.running)]() { | ||
[utils_1._running] = false; | ||
[utils_1._destroyed] = false; | ||
[utils_1._status] = null; | ||
[utils_1.initLock] = new async_locks_1.RWLockWriter(); | ||
get [utils_1.running]() { | ||
return this[utils_1._running]; | ||
@@ -25,0 +21,0 @@ } |
@@ -6,17 +6,17 @@ "use strict"; | ||
class ErrorAsyncInit extends errors_1.AbstractError { | ||
static description = 'Async init error'; | ||
} | ||
exports.ErrorAsyncInit = ErrorAsyncInit; | ||
ErrorAsyncInit.description = 'Async init error'; | ||
class ErrorAsyncInitRunning extends ErrorAsyncInit { | ||
static description = 'Async init is running'; | ||
} | ||
exports.ErrorAsyncInitRunning = ErrorAsyncInitRunning; | ||
ErrorAsyncInitRunning.description = 'Async init is running'; | ||
class ErrorAsyncInitNotRunning extends ErrorAsyncInit { | ||
static description = 'Async init is not running'; | ||
} | ||
exports.ErrorAsyncInitNotRunning = ErrorAsyncInitNotRunning; | ||
ErrorAsyncInitNotRunning.description = 'Async init is not running'; | ||
class ErrorAsyncInitDestroyed extends ErrorAsyncInit { | ||
static description = 'Async init is destroyed'; | ||
} | ||
exports.ErrorAsyncInitDestroyed = ErrorAsyncInitDestroyed; | ||
ErrorAsyncInitDestroyed.description = 'Async init is destroyed'; | ||
//# sourceMappingURL=errors.js.map |
@@ -12,11 +12,7 @@ "use strict"; | ||
return (constructor) => { | ||
var _a, _b, _c; | ||
const constructor_ = class extends constructor { | ||
constructor() { | ||
super(...arguments); | ||
this[_a] = false; | ||
this[_b] = null; | ||
this[_c] = new async_locks_1.RWLockWriter(); | ||
} | ||
get [(_a = utils_1._running, _b = utils_1._status, _c = utils_1.initLock, utils_1.running)]() { | ||
[utils_1._running] = false; | ||
[utils_1._status] = null; | ||
[utils_1.initLock] = new async_locks_1.RWLockWriter(); | ||
get [utils_1.running]() { | ||
return this[utils_1._running]; | ||
@@ -23,0 +19,0 @@ } |
@@ -1,2 +0,2 @@ | ||
declare type Status = 'destroying' | 'starting' | 'stopping' | null; | ||
type Status = 'destroying' | 'starting' | 'stopping' | null; | ||
export type { Status }; |
{ | ||
"name": "@matrixai/async-init", | ||
"version": "1.8.2", | ||
"version": "1.8.3", | ||
"author": "Roger Qiu", | ||
@@ -15,3 +15,3 @@ "description": "Asynchronous Initialisation and Deinitialisation Decorators", | ||
"prepare": "tsc -p ./tsconfig.build.json", | ||
"build": "rimraf ./dist && tsc -p ./tsconfig.build.json", | ||
"build": "shx rm -rf ./dist && tsc -p ./tsconfig.build.json", | ||
"postversion": "npm install --package-lock-only --ignore-scripts --silent", | ||
@@ -23,13 +23,15 @@ "ts-node": "ts-node", | ||
"lint-shell": "find ./src ./tests ./scripts -type f -regextype posix-extended -regex '.*\\.(sh)' -exec shellcheck {} +", | ||
"docs": "rimraf ./docs && typedoc --gitRevision master --tsconfig ./tsconfig.build.json --out ./docs src" | ||
"docs": "shx rm -rf ./docs && typedoc --gitRevision master --tsconfig ./tsconfig.build.json --out ./docs src" | ||
}, | ||
"dependencies": { | ||
"@matrixai/async-locks": "^3.1.2", | ||
"@matrixai/errors": "^1.1.3" | ||
"@matrixai/async-locks": "^3.2.0", | ||
"@matrixai/errors": "^1.1.7" | ||
}, | ||
"devDependencies": { | ||
"@swc/core": "^1.3.62", | ||
"@swc/jest": "^0.2.26", | ||
"@types/jest": "^28.1.3", | ||
"@types/node": "^16.11.7", | ||
"@typescript-eslint/eslint-plugin": "^5.23.0", | ||
"@typescript-eslint/parser": "^5.23.0", | ||
"@types/node": "^18.11.11", | ||
"@typescript-eslint/eslint-plugin": "^5.45.1", | ||
"@typescript-eslint/parser": "^5.45.1", | ||
"async-mutex": "^0.3.2", | ||
@@ -41,11 +43,12 @@ "eslint": "^8.15.0", | ||
"jest": "^28.1.1", | ||
"jest-extended": "^3.0.1", | ||
"jest-junit": "^14.0.0", | ||
"prettier": "^2.6.2", | ||
"rimraf": "^3.0.2", | ||
"shx": "^0.3.4", | ||
"ts-jest": "^28.0.5", | ||
"ts-node": "^10.9.1", | ||
"tsconfig-paths": "^3.9.0", | ||
"typedoc": "^0.22.15", | ||
"typescript": "^4.5.2" | ||
"typedoc": "^0.23.21", | ||
"typescript": "^4.9.3" | ||
} | ||
} |
@@ -31,3 +31,3 @@ # js-async-init | ||
y = y ?? await Y.createY(); | ||
const x = new X({ y }); | ||
const x = new this({ y }); | ||
await x.start(); | ||
@@ -68,3 +68,3 @@ return x; | ||
public static async createY() { | ||
return new Y; | ||
return new this(); | ||
} | ||
@@ -71,0 +71,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
68243
21
731
Updated@matrixai/async-locks@^3.2.0
Updated@matrixai/errors@^1.1.7