node-opcua-object-registry
Advanced tools
Comparing version 2.0.0-alpha.8 to 2.0.0-alpha.9
@@ -0,1 +1,4 @@ | ||
/** | ||
* @module node-opcua-object-registry | ||
*/ | ||
export * from "./objectRegistry"; |
@@ -6,3 +6,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @module node-opcua-object-registry | ||
*/ | ||
__export(require("./objectRegistry")); | ||
//# sourceMappingURL=index.js.map |
export declare class ObjectRegistry { | ||
static doDebug: boolean; | ||
static registries: any; | ||
private _objectType; | ||
private _cache; | ||
private readonly _cache; | ||
constructor(objectType: any); | ||
static doDebug: boolean; | ||
static registries: any; | ||
getClassName(): any; | ||
getClassName(): string; | ||
register(obj: any): void; | ||
@@ -9,0 +9,0 @@ unregister(obj: any): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const _ = require("underscore"); | ||
/** | ||
* @module node-opcua-object-registry | ||
*/ | ||
const node_opcua_assert_1 = require("node-opcua-assert"); | ||
const node_opcua_debug_1 = require("node-opcua-debug"); | ||
const _ = require("underscore"); | ||
const gRegistries = []; | ||
@@ -41,3 +44,3 @@ let hashCounter = 1; | ||
let str = " className :" + className + " found => " + this.count() + " object leaking\n"; | ||
_.forEach(this._cache, function (obj /*,key*/) { | ||
_.forEach(this._cache, (obj /*,key*/) => { | ||
str += obj.constructor.name + " " + obj.toString() + "\n"; | ||
@@ -44,0 +47,0 @@ }); |
{ | ||
"name": "node-opcua-object-registry", | ||
"version": "2.0.0-alpha.8", | ||
"version": "2.0.0-alpha.9", | ||
"description": "pure nodejs OPCUA SDK - module -object-registry", | ||
@@ -13,8 +13,8 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"node-opcua-assert": "^2.0.0-alpha.8", | ||
"node-opcua-debug": "^2.0.0-alpha.8", | ||
"node-opcua-assert": "^2.0.0-alpha.9", | ||
"node-opcua-debug": "^2.0.0-alpha.9", | ||
"underscore": "^1.9.1" | ||
}, | ||
"devDependencies": { | ||
"colors": "^1.3.2", | ||
"colors": "^1.3.3", | ||
"should": "13.2.3" | ||
@@ -35,3 +35,3 @@ }, | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "7bbf38d5a3cd29cb6aed6ca38078f4d89d3f956a" | ||
"gitHead": "cd7120d1840593757f0f3c9e53be4e85883dc0e6" | ||
} |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @module node-opcua-object-registry | ||
*/ | ||
export * from "./objectRegistry"; |
@@ -1,4 +0,7 @@ | ||
import * as _ from "underscore"; | ||
/** | ||
* @module node-opcua-object-registry | ||
*/ | ||
import { assert } from "node-opcua-assert"; | ||
import { trace_from_this_projet_only } from "node-opcua-debug"; | ||
import * as _ from "underscore"; | ||
@@ -10,4 +13,7 @@ const gRegistries: ObjectRegistry[] = []; | ||
public static doDebug = false; | ||
public static registries: any = gRegistries; | ||
private _objectType: any; | ||
private _cache: any; | ||
private readonly _cache: any; | ||
@@ -21,11 +27,7 @@ constructor(objectType: any) { | ||
static doDebug = false; | ||
static registries: any = gRegistries; | ||
getClassName() { | ||
public getClassName(): string { | ||
return this._objectType ? this._objectType.name : "<???>"; | ||
} | ||
register(obj: any) { | ||
public register(obj: any): void { | ||
@@ -48,3 +50,3 @@ if (!this._objectType) { | ||
unregister(obj: any) { | ||
public unregister(obj: any): void { | ||
this._cache[obj._____hash] = null; | ||
@@ -54,7 +56,7 @@ delete this._cache[obj._____hash]; | ||
count() { | ||
public count(): number { | ||
return Object.keys(this._cache).length; | ||
} | ||
toString() { | ||
public toString(): string { | ||
@@ -64,3 +66,3 @@ const className = this.getClassName(); | ||
_.forEach(this._cache, function (obj/*,key*/) { | ||
_.forEach(this._cache, (obj/*,key*/) => { | ||
str += obj.constructor.name + " " + obj.toString() + "\n"; | ||
@@ -67,0 +69,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8921
11
155