@dws-std/registry 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,11 +42,11 @@ Register your instances once at startup. They're available everywhere after that
42
42
  import { Registry } from '@dws-std/registry';
43
43
 
44
44
  class DatabaseConnection {
45
- private _isConnected: boolean = false;
45
+ private isConnected: boolean = false;
46
46
 
47
47
  public constructor() {
48
48
  console.log('Database connection created');
49
- this._isConnected = true;
49
+ this.isConnected = true;
50
50
  }
51
51
 
52
52
  public query(sql: string): string[] {
@@ -56,12 +56,12 @@ class DatabaseConnection {
56
56
 
57
57
  class ApiClient {
58
58
  public constructor(
59
- private readonly _baseUrl: string,
60
- private readonly _apiKey: string
59
+ private readonly baseUrl: string,
60
+ private readonly apiKey: string
61
61
  ) {}
62
62
 
63
63
  public get baseUrl(): string {
64
- return this._baseUrl;
64
+ return this.baseUrl;
65
65
  }
66
66
  }
67
67
 
package/dist/index.js CHANGED
@@ -7,24 +7,24 @@ var REGISTRY_ERROR_KEYS = {
7
7
  };
8
8
 
9
9
  class Registry {
10
- static _registry = new Map;
10
+ static registry = new Map;
11
11
  static register(name, instance) {
12
- if (this._registry.has(name))
12
+ if (this.registry.has(name))
13
13
  throw new Exception(`Instance already registered: ${name}`, {
14
14
  key: REGISTRY_ERROR_KEYS.CLASS_INSTANCE_ALREADY_REGISTERED,
15
15
  cause: name
16
16
  });
17
- this._registry.set(name, instance);
17
+ this.registry.set(name, instance);
18
18
  }
19
19
  static unregister(name) {
20
- if (!this._registry.delete(name))
20
+ if (!this.registry.delete(name))
21
21
  throw new Exception(`Instance not registered: ${name}`, {
22
22
  key: REGISTRY_ERROR_KEYS.CLASS_INSTANCE_NOT_REGISTERED,
23
23
  cause: name
24
24
  });
25
25
  }
26
26
  static get(name) {
27
- const instance = this._registry.get(name);
27
+ const instance = this.registry.get(name);
28
28
  if (!instance)
29
29
  throw new Exception(`Instance not registered: ${name}`, {
30
30
  key: REGISTRY_ERROR_KEYS.CLASS_INSTANCE_NOT_REGISTERED,
@@ -33,10 +33,10 @@ class Registry {
33
33
  return instance;
34
34
  }
35
35
  static has(name) {
36
- return this._registry.has(name);
36
+ return this.registry.has(name);
37
37
  }
38
38
  static clear() {
39
- this._registry.clear();
39
+ this.registry.clear();
40
40
  }
41
41
  }
42
42
  export {
@@ -16,7 +16,7 @@ export declare const REGISTRY_ERROR_KEYS: {
16
16
  * ```
17
17
  */
18
18
  export declare class Registry {
19
- private static readonly _registry;
19
+ private static readonly registry;
20
20
  /**
21
21
  * Stores `instance` under the given `name`.
22
22
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dws-std/registry",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Centralized, type-safe registry for managing named instances.",
5
5
  "keywords": [
6
6
  "bun",
@@ -38,16 +38,16 @@
38
38
  "test": "bun test --pass-with-no-tests --coverage"
39
39
  },
40
40
  "dependencies": {
41
- "@dws-std/error": "^2.2.0"
41
+ "@dws-std/error": "^2.3.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@types/bun": "^1.3.11",
45
- "oxfmt": "0.44.0",
46
- "oxlint": "1.59.0",
47
- "oxlint-tsgolint": "0.20.0",
48
- "typescript": "^6.0.2"
44
+ "@types/bun": "^1.3.14",
45
+ "oxfmt": "0.55.0",
46
+ "oxlint": "1.70.0",
47
+ "oxlint-tsgolint": "0.23.0",
48
+ "typescript": "^6.0.3"
49
49
  },
50
50
  "peerDependencies": {
51
- "@dws-std/error": "^2.2.0"
51
+ "@dws-std/error": "^2.3.0"
52
52
  }
53
53
  }