@c7-digital/ledger 0.0.3 → 0.0.5

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@c7-digital/ledger",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "type": "module",
6
6
  "main": "lib/src/index.js",
7
7
  "types": "lib/src/index.d.ts",
@@ -1,40 +0,0 @@
1
- import { EventEmitter } from "eventemitter3";
2
- import { PackageIdString } from "./valueTypes.js";
3
- /**
4
- * A specialized Map wrapper for template emitters that uses partiallyQualified
5
- * template IDs for comparison to ensure consistent lookup regardless of package ID.
6
- */
7
- export declare class TemplateEmitterMap {
8
- private emitters;
9
- /**
10
- * Set an EventEmitter for a specific template ID
11
- * @param templateId The full template ID
12
- * @param emitter The EventEmitter instance
13
- */
14
- set(templateId: PackageIdString, emitter: EventEmitter): void;
15
- /**
16
- * Get the EventEmitter for a specific template ID
17
- * @param templateId The template ID (full or partial)
18
- * @returns The EventEmitter or undefined if not found
19
- */
20
- get(templateId: PackageIdString): EventEmitter | undefined;
21
- /**
22
- * Check if an emitter exists for a specific template ID
23
- * @param templateId The template ID (full or partial)
24
- * @returns True if an emitter exists, false otherwise
25
- */
26
- has(templateId: PackageIdString): boolean;
27
- /**
28
- * Get all emitters in the map
29
- * @returns An iterator of all EventEmitter instances
30
- */
31
- values(): IterableIterator<EventEmitter>;
32
- /**
33
- * Clear all emitters from the map
34
- */
35
- clear(): void;
36
- /**
37
- * Get the number of emitters in the map
38
- */
39
- get size(): number;
40
- }
@@ -1,57 +0,0 @@
1
- import { partiallyQualified } from "./util.js";
2
- /**
3
- * A specialized Map wrapper for template emitters that uses partiallyQualified
4
- * template IDs for comparison to ensure consistent lookup regardless of package ID.
5
- */
6
- export class TemplateEmitterMap {
7
- constructor() {
8
- this.emitters = new Map();
9
- }
10
- /**
11
- * Set an EventEmitter for a specific template ID
12
- * @param templateId The full template ID
13
- * @param emitter The EventEmitter instance
14
- */
15
- set(templateId, emitter) {
16
- const partialId = partiallyQualified(templateId);
17
- this.emitters.set(partialId, { fullId: templateId, emitter });
18
- }
19
- /**
20
- * Get the EventEmitter for a specific template ID
21
- * @param templateId The template ID (full or partial)
22
- * @returns The EventEmitter or undefined if not found
23
- */
24
- get(templateId) {
25
- const partialId = partiallyQualified(templateId);
26
- return this.emitters.get(partialId)?.emitter;
27
- }
28
- /**
29
- * Check if an emitter exists for a specific template ID
30
- * @param templateId The template ID (full or partial)
31
- * @returns True if an emitter exists, false otherwise
32
- */
33
- has(templateId) {
34
- const partialId = partiallyQualified(templateId);
35
- return this.emitters.has(partialId);
36
- }
37
- /**
38
- * Get all emitters in the map
39
- * @returns An iterator of all EventEmitter instances
40
- */
41
- values() {
42
- return Array.from(this.emitters.values())
43
- .map(entry => entry.emitter)[Symbol.iterator]();
44
- }
45
- /**
46
- * Clear all emitters from the map
47
- */
48
- clear() {
49
- this.emitters.clear();
50
- }
51
- /**
52
- * Get the number of emitters in the map
53
- */
54
- get size() {
55
- return this.emitters.size;
56
- }
57
- }
@@ -1,40 +0,0 @@
1
- import { EventEmitter } from "eventemitter3";
2
- import { PackageIdString } from "./valueTypes.js";
3
- /**
4
- * A specialized Map wrapper for template emitters that uses partiallyQualified
5
- * template IDs for comparison to ensure consistent lookup regardless of package ID.
6
- */
7
- export declare class TemplateEmitterMap {
8
- private emitters;
9
- /**
10
- * Set an EventEmitter for a specific template ID
11
- * @param templateId The full template ID
12
- * @param emitter The EventEmitter instance
13
- */
14
- set(templateId: PackageIdString, emitter: EventEmitter): void;
15
- /**
16
- * Get the EventEmitter for a specific template ID
17
- * @param templateId The template ID (full or partial)
18
- * @returns The EventEmitter or undefined if not found
19
- */
20
- get(templateId: PackageIdString): EventEmitter | undefined;
21
- /**
22
- * Check if an emitter exists for a specific template ID
23
- * @param templateId The template ID (full or partial)
24
- * @returns True if an emitter exists, false otherwise
25
- */
26
- has(templateId: PackageIdString): boolean;
27
- /**
28
- * Get all emitters in the map
29
- * @returns An iterator of all EventEmitter instances
30
- */
31
- values(): IterableIterator<EventEmitter>;
32
- /**
33
- * Clear all emitters from the map
34
- */
35
- clear(): void;
36
- /**
37
- * Get the number of emitters in the map
38
- */
39
- get size(): number;
40
- }
@@ -1,57 +0,0 @@
1
- import { partiallyQualified } from "./util.js";
2
- /**
3
- * A specialized Map wrapper for template emitters that uses partiallyQualified
4
- * template IDs for comparison to ensure consistent lookup regardless of package ID.
5
- */
6
- export class TemplateEmitterMap {
7
- constructor() {
8
- this.emitters = new Map();
9
- }
10
- /**
11
- * Set an EventEmitter for a specific template ID
12
- * @param templateId The full template ID
13
- * @param emitter The EventEmitter instance
14
- */
15
- set(templateId, emitter) {
16
- const partialId = partiallyQualified(templateId);
17
- this.emitters.set(partialId, { fullId: templateId, emitter });
18
- }
19
- /**
20
- * Get the EventEmitter for a specific template ID
21
- * @param templateId The template ID (full or partial)
22
- * @returns The EventEmitter or undefined if not found
23
- */
24
- get(templateId) {
25
- const partialId = partiallyQualified(templateId);
26
- return this.emitters.get(partialId)?.emitter;
27
- }
28
- /**
29
- * Check if an emitter exists for a specific template ID
30
- * @param templateId The template ID (full or partial)
31
- * @returns True if an emitter exists, false otherwise
32
- */
33
- has(templateId) {
34
- const partialId = partiallyQualified(templateId);
35
- return this.emitters.has(partialId);
36
- }
37
- /**
38
- * Get all emitters in the map
39
- * @returns An iterator of all EventEmitter instances
40
- */
41
- values() {
42
- return Array.from(this.emitters.values())
43
- .map(entry => entry.emitter)[Symbol.iterator]();
44
- }
45
- /**
46
- * Clear all emitters from the map
47
- */
48
- clear() {
49
- this.emitters.clear();
50
- }
51
- /**
52
- * Get the number of emitters in the map
53
- */
54
- get size() {
55
- return this.emitters.size;
56
- }
57
- }