Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@matrixai/async-init

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matrixai/async-init - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

19

dist/CreateDestroy.js

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ready = void 0;
const utils_1 = require("./utils");
const errors_1 = require("./errors");
import { AsyncFunction, GeneratorFunction, AsyncGeneratorFunction, } from './utils';
import { ErrorAsyncInitDestroyed } from './errors';
function CreateDestroy() {

@@ -34,3 +31,3 @@ return (constructor) => {

}
function ready(errorDestroyed = new errors_1.ErrorAsyncInitDestroyed()) {
function ready(errorDestroyed = new ErrorAsyncInitDestroyed()) {
return (target, key, descriptor) => {

@@ -41,3 +38,3 @@ const f = descriptor.value;

}
if (descriptor.value instanceof utils_1.AsyncFunction) {
if (descriptor.value instanceof AsyncFunction) {
descriptor.value = async function (...args) {

@@ -50,3 +47,3 @@ if (this._destroyed) {

}
else if (descriptor.value instanceof utils_1.GeneratorFunction) {
else if (descriptor.value instanceof GeneratorFunction) {
descriptor.value = function* (...args) {

@@ -59,3 +56,3 @@ if (this._destroyed) {

}
else if (descriptor.value instanceof utils_1.AsyncGeneratorFunction) {
else if (descriptor.value instanceof AsyncGeneratorFunction) {
descriptor.value = async function* (...args) {

@@ -81,4 +78,4 @@ if (this._destroyed) {

}
exports.ready = ready;
exports.default = CreateDestroy;
export default CreateDestroy;
export { ready };
//# sourceMappingURL=CreateDestroy.js.map

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ready = void 0;
const utils_1 = require("./utils");
const errors_1 = require("./errors");
function CreateDestroyStartStop(errorRunning = new errors_1.ErrorAsyncInitRunning(), errorDestroyed = new errors_1.ErrorAsyncInitDestroyed()) {
import { AsyncFunction, GeneratorFunction, AsyncGeneratorFunction, } from './utils';
import { ErrorAsyncInitRunning, ErrorAsyncInitNotRunning, ErrorAsyncInitDestroyed, } from './errors';
function CreateDestroyStartStop(errorRunning = new ErrorAsyncInitRunning(), errorDestroyed = new ErrorAsyncInitDestroyed()) {
return (constructor) => {

@@ -79,3 +76,3 @@ return class extends constructor {

}
function ready(errorNotRunning = new errors_1.ErrorAsyncInitNotRunning()) {
function ready(errorNotRunning = new ErrorAsyncInitNotRunning()) {
return (target, key, descriptor) => {

@@ -86,3 +83,3 @@ const f = descriptor.value;

}
if (descriptor.value instanceof utils_1.AsyncFunction) {
if (descriptor.value instanceof AsyncFunction) {
descriptor.value = async function (...args) {

@@ -95,3 +92,3 @@ if (!this._running) {

}
else if (descriptor.value instanceof utils_1.GeneratorFunction) {
else if (descriptor.value instanceof GeneratorFunction) {
descriptor.value = function* (...args) {

@@ -104,3 +101,3 @@ if (!this._running) {

}
else if (descriptor.value instanceof utils_1.AsyncGeneratorFunction) {
else if (descriptor.value instanceof AsyncGeneratorFunction) {
descriptor.value = async function* (...args) {

@@ -126,4 +123,4 @@ if (!this._running) {

}
exports.ready = ready;
exports.default = CreateDestroyStartStop;
export default CreateDestroyStartStop;
export { ready };
//# sourceMappingURL=CreateDestroyStartStop.js.map

@@ -1,17 +0,11 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ErrorAsyncInitDestroyed = exports.ErrorAsyncInitNotRunning = exports.ErrorAsyncInitRunning = exports.ErrorAsyncInit = void 0;
const ts_custom_error_1 = require("ts-custom-error");
class ErrorAsyncInit extends ts_custom_error_1.CustomError {
import { CustomError } from 'ts-custom-error';
class ErrorAsyncInit extends CustomError {
}
exports.ErrorAsyncInit = ErrorAsyncInit;
class ErrorAsyncInitRunning extends ErrorAsyncInit {
}
exports.ErrorAsyncInitRunning = ErrorAsyncInitRunning;
class ErrorAsyncInitNotRunning extends ErrorAsyncInit {
}
exports.ErrorAsyncInitNotRunning = ErrorAsyncInitNotRunning;
class ErrorAsyncInitDestroyed extends ErrorAsyncInit {
}
exports.ErrorAsyncInitDestroyed = ErrorAsyncInitDestroyed;
export { ErrorAsyncInit, ErrorAsyncInitRunning, ErrorAsyncInitNotRunning, ErrorAsyncInitDestroyed, };
//# sourceMappingURL=errors.js.map

@@ -1,27 +0,5 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.errors = exports.startStop = exports.createDestroy = exports.createDestroyStartStop = void 0;
exports.createDestroyStartStop = __importStar(require("./CreateDestroyStartStop"));
exports.createDestroy = __importStar(require("./CreateDestroy"));
exports.startStop = __importStar(require("./StartStop"));
exports.errors = __importStar(require("./errors"));
export * as createDestroyStartStop from './CreateDestroyStartStop';
export * as createDestroy from './CreateDestroy';
export * as startStop from './StartStop';
export * as errors from './errors';
//# sourceMappingURL=index.js.map

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ready = void 0;
const utils_1 = require("./utils");
const errors_1 = require("./errors");
import { AsyncFunction, GeneratorFunction, AsyncGeneratorFunction, } from './utils';
import { ErrorAsyncInitNotRunning } from './errors';
function StartStop() {

@@ -49,3 +46,3 @@ return (constructor) => {

}
function ready(errorNotRunning = new errors_1.ErrorAsyncInitNotRunning()) {
function ready(errorNotRunning = new ErrorAsyncInitNotRunning()) {
return (target, key, descriptor) => {

@@ -56,3 +53,3 @@ const f = descriptor.value;

}
if (descriptor.value instanceof utils_1.AsyncFunction) {
if (descriptor.value instanceof AsyncFunction) {
descriptor.value = async function (...args) {

@@ -65,3 +62,3 @@ if (!this._running) {

}
else if (descriptor.value instanceof utils_1.GeneratorFunction) {
else if (descriptor.value instanceof GeneratorFunction) {
descriptor.value = function* (...args) {

@@ -74,3 +71,3 @@ if (!this._running) {

}
else if (descriptor.value instanceof utils_1.AsyncGeneratorFunction) {
else if (descriptor.value instanceof AsyncGeneratorFunction) {
descriptor.value = async function* (...args) {

@@ -96,4 +93,4 @@ if (!this._running) {

}
exports.ready = ready;
exports.default = StartStop;
export default StartStop;
export { ready };
//# sourceMappingURL=StartStop.js.map

@@ -1,10 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncGeneratorFunction = exports.GeneratorFunction = exports.AsyncFunction = void 0;
const AsyncFunction = (async () => { }).constructor;
exports.AsyncFunction = AsyncFunction;
const GeneratorFunction = function* () { }.constructor;
exports.GeneratorFunction = GeneratorFunction;
const AsyncGeneratorFunction = async function* () { }.constructor;
exports.AsyncGeneratorFunction = AsyncGeneratorFunction;
export { AsyncFunction, GeneratorFunction, AsyncGeneratorFunction };
//# sourceMappingURL=utils.js.map
{
"name": "@matrixai/async-init",
"version": "0.0.1",
"version": "0.0.2",
"author": "Roger Qiu",

@@ -11,8 +11,9 @@ "description": "Asynchronous Initialisation and Deinitialisation Decorators",

},
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
"create-destroy-start-stop": "./dist/CreateDestroyStartStop.js",
"create-destroy": "./dist/CreateDestroy.js",
"start-stop": "./dist/StartStop.js"
"./create-destroy-start-stop": "./dist/CreateDestroyStartStop.js",
"./create-destroy": "./dist/CreateDestroy.js",
"./start-stop": "./dist/StartStop.js"
},

@@ -19,0 +20,0 @@ "scripts": {

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc