@dws-std/registry 1.1.1 → 1.2.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/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- export { REGISTRY_ERROR_KEYS } from './constant/registry-error-keys';
2
- export { Registry } from './registry';
1
+ export { Registry, REGISTRY_ERROR_KEYS } from './registry';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  // @bun
2
- // src/constant/registry-error-keys.ts
3
- var REGISTRY_ERROR_KEYS = {
4
- CLASS_INSTANCE_ALREADY_REGISTERED: "registry.classInstanceAlreadyRegistered",
5
- CLASS_INSTANCE_NOT_REGISTERED: "registry.classInstanceNotRegistered"
6
- };
7
2
  // src/registry.ts
8
3
  import { Exception } from "@dws-std/error";
4
+ var REGISTRY_ERROR_KEYS = {
5
+ CLASS_INSTANCE_ALREADY_REGISTERED: "registry.class-instance-already-registered",
6
+ CLASS_INSTANCE_NOT_REGISTERED: "registry.class-instance-not-registered"
7
+ };
8
+
9
9
  class Registry {
10
10
  static _registry = new Map;
11
11
  static register(name, instance) {
@@ -1,3 +1,8 @@
1
+ /** Error codes thrown by the {@link Registry} class. */
2
+ export declare const REGISTRY_ERROR_KEYS: {
3
+ readonly CLASS_INSTANCE_ALREADY_REGISTERED: "registry.class-instance-already-registered";
4
+ readonly CLASS_INSTANCE_NOT_REGISTERED: "registry.class-instance-not-registered";
5
+ };
1
6
  /**
2
7
  * Global, type-safe store for named instances.
3
8
  *
@@ -23,7 +28,7 @@ export declare class Registry {
23
28
  * @param name - Unique identifier for this instance.
24
29
  * @param instance - The object to store.
25
30
  *
26
- * @throws ({@link Exception}) `name` is already taken.
31
+ * @throws ({@link Exception}) - `name` is already taken.
27
32
  */
28
33
  static register<TClass extends object>(name: string, instance: TClass): void;
29
34
  /**
@@ -33,7 +38,7 @@ export declare class Registry {
33
38
  *
34
39
  * @param name - Identifier of the instance to remove.
35
40
  *
36
- * @throws ({@link Exception}) `name` is not registered.
41
+ * @throws ({@link Exception}) - `name` is not registered.
37
42
  */
38
43
  static unregister(name: string): void;
39
44
  /**
@@ -46,7 +51,7 @@ export declare class Registry {
46
51
  *
47
52
  * @param name - Identifier of the instance to retrieve.
48
53
  *
49
- * @throws ({@link Exception}) `name` is not registered.
54
+ * @throws ({@link Exception}) - `name` is not registered.
50
55
  */
51
56
  static get<TClass>(name: string): TClass;
52
57
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dws-std/registry",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Centralized, type-safe registry for managing named instances.",
5
5
  "keywords": [
6
6
  "bun",
@@ -38,7 +38,7 @@
38
38
  "test": "bun test --pass-with-no-tests --coverage"
39
39
  },
40
40
  "dependencies": {
41
- "@dws-std/error": "^2.1.1"
41
+ "@dws-std/error": "^2.2.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/bun": "^1.3.11",
@@ -48,6 +48,6 @@
48
48
  "typescript": "^6.0.2"
49
49
  },
50
50
  "peerDependencies": {
51
- "@dws-std/error": "^2.1.1"
51
+ "@dws-std/error": "^2.2.0"
52
52
  }
53
53
  }
@@ -1,5 +0,0 @@
1
- /** Error codes thrown by the {@link Registry} class. */
2
- export declare const REGISTRY_ERROR_KEYS: {
3
- readonly CLASS_INSTANCE_ALREADY_REGISTERED: "registry.classInstanceAlreadyRegistered";
4
- readonly CLASS_INSTANCE_NOT_REGISTERED: "registry.classInstanceNotRegistered";
5
- };