MCPcopy
hub / github.com/flightcontrolhq/superjson / register

Method register

src/registry.ts:8–18  ·  view source on GitHub ↗
(value: T, identifier?: string)

Source from the content-addressed store, hash-verified

6 constructor(private readonly generateIdentifier: (v: T) => string) {}
7
8 register(value: T, identifier?: string): void {
9 if (this.kv.getByValue(value)) {
10 return;
11 }
12
13 if (!identifier) {
14 identifier = this.generateIdentifier(value);
15 }
16
17 this.kv.set(identifier, value);
18 }
19
20 clear(): void {
21 this.kv.clear();

Callers 4

registerClassMethod · 0.45
registerSymbolMethod · 0.45
registerCustomMethod · 0.45
registry.test.tsFile · 0.45

Calls 2

getByValueMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected