MCPcopy Create free account
hub / github.com/apache/fory / addDeclar

Method addDeclar

javascript/packages/core/lib/gen/scope.ts:25–31  ·  view source on GitHub ↗
(stmt: string, name: string)

Source from the content-addressed store, hash-verified

23 private idx = 0;
24
25 private addDeclar(stmt: string, name: string) {
26 if (this.declares.has(stmt)) {
27 return this.declares.get(stmt)!;
28 }
29 this.declares.set(stmt, name);
30 return name;
31 }
32
33 uniqueName(prefix: string) {
34 return `${prefix}_${this.idx++}`;

Callers 2

declareByNameMethod · 0.95
declareMethod · 0.95

Calls 3

hasMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected