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

@tsdotnet/disposable

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsdotnet/disposable - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

dist-esm/DisposableBase.js

48

.eslintrc.json
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"typescript"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "off"
}
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"typescript"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}

@@ -0,1 +1,2 @@

"use strict";
/*!

@@ -5,3 +6,5 @@ * @author electricessence / https://github.com/electricessence/

*/
import ObjectDisposedException from './ObjectDisposedException';
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const ObjectDisposedException_1 = tslib_1.__importDefault(require("./ObjectDisposedException"));
class DisposableBase {

@@ -42,3 +45,3 @@ constructor(_disposableObjectName, __finalizer) {

if (this.__wasDisposed)
throw new ObjectDisposedException(objectName);
throw new ObjectDisposedException_1.default(objectName);
return true;

@@ -54,3 +57,3 @@ }

}
export default DisposableBase;
exports.default = DisposableBase;
//# sourceMappingURL=DisposableBase.js.map

@@ -0,1 +1,2 @@

"use strict";
/*!

@@ -5,2 +6,3 @@ * @author electricessence / https://github.com/electricessence/

*/
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable @typescript-eslint/no-use-before-define,@typescript-eslint/no-namespace,no-inner-declarations */

@@ -13,6 +15,7 @@ /**

*/
export function dispose(...disposables) {
function dispose(...disposables) {
// The disposables arguments array is effectively localized so it's safe.
theseUnsafe(disposables, false);
}
exports.dispose = dispose;
(function (dispose) {

@@ -96,3 +99,3 @@ /**

})(these = dispose.these || (dispose.these = {}));
})(dispose || (dispose = {}));
})(dispose = exports.dispose || (exports.dispose = {}));
/**

@@ -113,3 +116,3 @@ * Just like in C# this 'using' function will ensure the passed disposable is disposed when the closure has finished.

*/
export function using(disposable, closure) {
function using(disposable, closure) {
try {

@@ -122,2 +125,3 @@ return closure(disposable);

}
exports.using = using;
/**

@@ -157,3 +161,3 @@ * This private function makes disposing more robust for when there's no type checking.

}
export default dispose;
exports.default = dispose;
//# sourceMappingURL=dispose.js.map

@@ -0,1 +1,2 @@

"use strict";
/*!

@@ -5,7 +6,11 @@ * @author electricessence / https://github.com/electricessence/

*/
import ObjectDisposedException from './ObjectDisposedException';
import DisposableBase from './DisposableBase';
import dispose from './dispose';
export { ObjectDisposedException, dispose, DisposableBase };
export default DisposableBase;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const ObjectDisposedException_1 = tslib_1.__importDefault(require("./ObjectDisposedException"));
exports.ObjectDisposedException = ObjectDisposedException_1.default;
const DisposableBase_1 = tslib_1.__importDefault(require("./DisposableBase"));
exports.DisposableBase = DisposableBase_1.default;
const dispose_1 = tslib_1.__importDefault(require("./dispose"));
exports.dispose = dispose_1.default;
exports.default = DisposableBase_1.default;
//# sourceMappingURL=index.js.map

@@ -0,1 +1,2 @@

"use strict";
/*!

@@ -5,3 +6,4 @@ * @author electricessence / https://github.com/electricessence/

*/
export default class ObjectDisposedException extends Error {
Object.defineProperty(exports, "__esModule", { value: true });
class ObjectDisposedException extends Error {
constructor(objectName, message) {

@@ -17,2 +19,3 @@ super(message);

}
exports.default = ObjectDisposedException;
//# sourceMappingURL=ObjectDisposedException.js.map
{
"name": "@tsdotnet/disposable",
"version": "1.1.2",
"version": "1.1.3",
"description": "A disposable base class and minimal set of interfaces to properly implement an object disposal pattern.",

@@ -9,2 +9,3 @@ "author": "electricessence",

"main": "dist/index.js",
"module": "dist-esm/index.js",
"keywords": [

@@ -19,4 +20,4 @@ "dispose",

"scripts": {
"clean": "rimraf dist/*",
"build": "npm prune && npm install && npm run clean && copyfiles -u 1 src/**/*.d.ts dist && tsc",
"clean": "rimraf dist/* && rimraf dist-esm/*",
"build": "npm prune && npm install && npm run clean && copyfiles -u 1 src/**/*.d.ts dist && tsc && tsc -p tsconfig.esm.json",
"bump": "npm run precommit && npm version patch",

@@ -23,0 +24,0 @@ "lint": "eslint src/**/*.ts",

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

describe("placeholder",()=>{
it("does nothing",()=>{
expect(true).toBeTrue();
})
});
describe('placeholder', () => {
it('does nothing', () => {
expect(true).toBeTrue();
});
});

@@ -7,3 +7,3 @@ {

"target": "es2015",
"module": "es2015",
"module": "commonjs",
"strict": true,

@@ -10,0 +10,0 @@ "sourceMap": true,

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