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

destroyable

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

destroyable - npm Package Compare versions

Comparing version 0.9.0 to 0.10.0

.whitesource

4

dist/Destroyable.d.ts

@@ -9,2 +9,6 @@ import { IDestroyable } from './IDestroyable';

export declare abstract class Destroyable implements IDestroyable {
/**
* Chcek whether the given object is destroyable
*/
static isDestroyable(obj: any): obj is IDestroyable;
private _isDestroyed;

@@ -11,0 +15,0 @@ private subdestroyable;

14

dist/Destroyable.js

@@ -42,5 +42,2 @@ "use strict";

var TeardownLogic_1 = require("./TeardownLogic");
/*
* TODO: Unite Registration and Destroyable
*/
/**

@@ -57,2 +54,8 @@ * Generic implementation of the IDestroyable

}
/**
* Chcek whether the given object is destroyable
*/
Destroyable.isDestroyable = function (obj) {
return obj && typeof obj.destroy === 'function' && typeof obj.isDestroyed === 'boolean';
};
Object.defineProperty(Destroyable.prototype, "isDestroyed", {

@@ -102,3 +105,3 @@ /**

}
// TODO: create remove counterpart to add
// TODO: Create remove counterpart to add
(_a = this.subdestroyable).push.apply(_a, subdestroyable);

@@ -124,2 +127,5 @@ return this;

exports.Destroyable = Destroyable;
/*
* TODO: Unite Registration and Destroyable
*/
//# sourceMappingURL=Destroyable.js.map

@@ -41,2 +41,6 @@ import { Promisable } from 'type-fest';

static fromSubscription(subscriptionFactory: (registerAdditionalSubscription: (additionalSubscription: Promisable<ISubscription>) => void) => Promisable<ISubscription>): Registration;
/**
* Creates a registration that is empty and has nothing to destroy
* Note: This is useful for implementing null object pattern
*/
static void(): Registration;

@@ -43,0 +47,0 @@ /**

@@ -196,4 +196,8 @@ "use strict";

};
/**
* Creates a registration that is empty and has nothing to destroy
* Note: This is useful for implementing null object pattern
*/
Registration.void = function () {
return new Registration(function () { });
return new this(function () { });
};

@@ -233,2 +237,11 @@ /**

exports.Registration = Registration;
/*
class ChildRegistration extends Registration {
}
const a:ChildRegistration = ChildRegistration.void();
*/
//# sourceMappingURL=Registration.js.map
{
"name": "destroyable",
"version": "0.9.0",
"description": "Multiple utilities that help to build destroyable objects in javascript",
"author": "Pavol Hejný <pavol@collboard.com> (https://pavolhejny.com)",
"contributors": [
"Pavol Hejný <pavol@collboard.com> (https://pavolhejny.com)",
"Jonáš Rosecký <jonas@collboard.com>"
],
"license": "ISC",
"repository": {
"type": "git",
"url": "git+https://github.com/hejny/destroyable.git"
},
"bugs": {
"url": "https://github.com/hejny/destroyable/issues"
},
"homepage": "https://github.com/hejny/destroyable#readme",
"--type": "module",
"main": "./dist/index.js",
"--exports": {
"./*": "./dist/*"
},
"scripts": {
"build": "rm -rf ./dist && tsc",
"develop": "tsc --watch",
"preversion": "npm test && npm run lint && npm run generate-main-exports-commit && npm run build && npm run documentation-commit",
"postversion": "git push && git push --tags && npm publish",
"documentation": "typedoc --excludePrivate --hideGenerator --theme minimal --out docs --name \"Destroyable\" ./src",
"documentation-commit": "git diff --exit-code && npm run documentation && git add docs && git commit --allow-empty -m \"Documentation\"",
"test": "jest --config jestconfig.json",
"test-watch": "jest --config jestconfig.json --watchAll",
"lint": "tslint -p tsconfig.json",
"generate-main-exports": "ts-node ./scripts/generate-main-exports/generate-main-exports.ts",
"generate-main-exports-commit": "git diff --exit-code && npm run generate-main-exports && git add src && git commit --allow-empty -m \"Updating exports\""
},
"dependencies": {
"rxjs": "^6.6.2",
"type-fest": "^2.5.2",
"typescript": "^4.3.4"
},
"devDependencies": {
"@types/jest": "^24.0.13",
"glob-promise": "^3.4.0",
"jest": "^24.8.0",
"mobx": "^6.3.2",
"onchange": "^5.2.0",
"ts-jest": "^24.0.2",
"ts-loader": "^4.5.0",
"ts-node": "^8.8.2",
"tslint": "^5.17.0",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.21.0",
"waitasecond": "^1.0.0"
}
"name": "destroyable",
"version": "0.10.0",
"description": "Library for managing misc stuff that can be destroyed after the creation",
"author": "Pavol Hejný <pavol@collboard.com> (https://pavolhejny.com)",
"contributors": [
"Pavol Hejný <pavol@collboard.com> (https://pavolhejny.com)",
"Jonáš Rosecký <jonas@collboard.com>"
],
"license": "SEE LICENSE IN LICENSE",
"repository": {
"type": "git",
"url": "git+https://github.com/hejny/destroyable.git"
},
"bugs": {
"url": "https://github.com/hejny/destroyable/issues"
},
"homepage": "https://github.com/hejny/destroyable#readme",
"--type": "module",
"main": "./dist/index.js",
"--exports": {
"./*": "./dist/*"
},
"scripts": {
"build": "rm -rf ./dist && tsc",
"develop": "tsc --watch",
"preversion": "npm test && npm run lint && npm run generate-main-exports-commit && npm run build && npm run documentation-commit",
"postversion": "git push && git push --tags && npm publish",
"documentation": "typedoc --excludePrivate --hideGenerator --out docs --name \"Destroyable\" ./src",
"documentation-commit": "git diff --exit-code && npm run documentation && git add docs && git commit --allow-empty -m \"Documentation\"",
"test": "jest --config jestconfig.json",
"test-watch": "jest --config jestconfig.json --watchAll",
"lint": "tslint -p tsconfig.json",
"generate-main-exports": "ts-node ./scripts/generate-main-exports/generate-main-exports.ts",
"generate-main-exports-commit": "git diff --exit-code && npm run generate-main-exports && git add src && git commit --allow-empty -m \"Updating exports\""
},
"dependencies": {
"rxjs": "6.6.2",
"type-fest": "2.5.2",
"typescript": "4.3.4"
},
"devDependencies": {
"@types/jest": "24.0.13",
"glob-promise": "3.4.0",
"jest": "24.8.0",
"mobx": "6.3.2",
"onchange": "5.2.0",
"ts-jest": "24.0.2",
"ts-loader": "4.5.0",
"ts-node": "8.8.2",
"tslint": "5.17.0",
"tslint-config-prettier": "1.18.0",
"typedoc": "0.22.11",
"waitasecond": "1.0.0"
}
}

@@ -1,3 +0,19 @@

# Destroyable
# 💥 Destroyable
<!--Badges-->
<!--⚠️WARNING: This section was generated by https://github.com/hejny/batch-project-editor/blob/main/src/workflows/800-badges/badges.ts so every manual change will be overwritten.-->
[![License of 💥 Destroyable](https://img.shields.io/github/license/hejny/destroyable.svg?style=flat)](https://github.com/hejny/destroyable/blob/main/LICENSE)
[![NPM Version of 💥 Destroyable](https://badge.fury.io/js/destroyable.svg)](https://www.npmjs.com/package/destroyable)
[![Quality of package 💥 Destroyable](https://packagequality.com/shield/destroyable.svg)](https://packagequality.com/#?package=destroyable)
[![main](https://github.com/hejny/destroyable/actions/workflows/main.yml/badge.svg)](https://github.com/hejny/destroyable/actions/workflows/main.yml)
[![Known Vulnerabilities](https://snyk.io/test/github/hejny/destroyable/badge.svg)](https://snyk.io/test/github/hejny/destroyable)
[![Issues](https://img.shields.io/github/issues/hejny/destroyable.svg?style=flat)](https://github.com/hejny/destroyable/issues)
<!--/Badges-->
Library for managing misc stuff that can be destroyed after the creation
TODO: Write some usage and description

@@ -10,1 +26,38 @@

```
<!--Contributing-->
<!--⚠️WARNING: This section was generated by https://github.com/hejny/batch-project-editor/blob/main/src/workflows/810-contributing/contributing.ts so every manual change will be overwritten.-->
## 🖋️ Contributing
I am open to pull requests, feedback, and suggestions. Or if you like this utility, you can [☕ buy me a coffee](https://www.buymeacoffee.com/hejny) or [donate via cryptocurrencies](https://github.com/hejny/hejny/blob/main/documents/crypto.md).
You can also ⭐ star the destroyable package, [follow me on GitHub](https://github.com/hejny) or [various other social networks](https://www.pavolhejny.com/contact/).
<!--/Contributing-->
<!--Partners-->
<!--⚠️WARNING: This section was generated by https://github.com/hejny/batch-project-editor/blob/main/src/workflows/820-partners/partners.ts so every manual change will be overwritten.-->
## ✨ Partners
<a href="https://collboard.com/">
<img src="https://collboard.fra1.cdn.digitaloceanspaces.com/assets/18.12.1/logo-small.png" alt="Collboard logo" width="50" />
</a>
&nbsp;&nbsp;&nbsp;
<a href="https://czech.events/">
<img src="https://czech.events/design/logos/czech.events.transparent-logo.png" alt="Czech.events logo" width="50" />
</a>
&nbsp;&nbsp;&nbsp;
<a href="https://sigmastamp.ml/">
<img src="https://www.sigmastamp.ml/sigmastamp-logo.white.svg" alt="SigmaStamp logo" width="50" />
</a>
[Become a partner](https://www.pavolhejny.com/contact/)
<!--/Partners-->

@@ -0,0 +0,0 @@ {

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